HNHacker News
TopNewBestAskShowJobs

_gabe_

1,843 karma · joined April 26, 2022

submissionscomments
_gabe_··on I'm not a fan of strlcpy(3)
Yep, this all makes sense and is what I was thinking as well. I also think you’re right about truncation being a better idea in the rendering state rather than in the bytes themselves. Either way, truncation of strings being displayed to the user requires extra care no matter what language you’re using.

As far as this being the reason most C code doesn’t handle UTF-8 though, I’m still skeptical.

_gabe_··on I'm not a fan of strlcpy(3)
> It's also pretty telling that every article that tries to explain how to safely copy or concat strings in C, like this one, only ever works with ASCII, no attempt whatsoever to handle UTF-8 and keep code points together, let alone grapheme clusters.

Can you expand on this? Why does it matter to keep code points and grapheme clusters together in the case of truncation? If you’re already truncating the string, then you can just copy as many bytes as possible. Then, later when you interpret that string, you’ll hit a malformed codepoint and ignore it. I guess what you might be getting at is that if you have a codepoint sequence, then you shouldn’t copy the bytes if they can’t all fit in the truncated string?

I feel like this is an edge case and not “the reason almost all C software has problems with non-English strings”. 99% of the time, copying up until the null byte is fine, whether or not the string is UTF-8 or ASCII. The reason most C software doesn’t work with non-English strings is because the developer never added support. The bytes are still there, they just need to be interpreted correctly in the UI portions of the code.

_gabe_··on Let's stop counting centuries
If that’s the case why do the Celsius thermostats I used while on vacation in Canada use 0.5C increments? The decimals are used, because the change between 25C and 26C is actually pretty big :)

In my old apartment, the difference between 73F and 74F was enough to make me quite cold or hot. And that’s a difference of about 0.5C. I’m not arguing that Farenheit is better, but I definitely do prefer it for setting my thermostat (which is a day to day thing) , but then again I grew up using it so that could be why I prefer it too.

_gabe_··on I learned Vulkan and wrote a small game engine with it
They do know the difference[0][1][2]. I feel like gamers are notorious for complaining about fidelity issues and frame rate issues. I’m not sure why you would think they don’t understand the difference. The reason people complain about switch frame rates is because it’s often low fidelity games that still can’t hit a consistent 60 FPS.

[0]: https://gamefaqs.gamespot.com/boards/189706-nintendo-switch/...

[1]: https://www.nintendolife.com/forums/nintendo-switch/the_fram...

[2]: https://www.reddit.com/r/FortNiteBR/comments/gyn32c/seriousl...

_gabe_··on I learned Vulkan and wrote a small game engine with it
There’s a very big difference between ultra realistic PBR graphics and running games at 60 FPS at 1080p.
_gabe_··on Priced out of home ownership
Is the FTC unbiased enough for you?[0]. This is a real problem. Many landlords use the same software to determine how much to charge, this software is intended to maximize rent by fixing the price.

[0]: https://www.ftc.gov/business-guidance/blog/2024/03/price-fix...

_gabe_··on So We've Got a Memory Leak
> It seems that memory bugs carry a higher risk of being completely invisible except in deliberately contrived situations.

Do they really carry a higher risk of being invisible though? You don’t need to “contrive” situations either. My company just spent 6+ months trying to solve a JavaScript undefined symbol bug stemming from a library. When we finally tracked it down, it was because we were using import instead of require, which the documentation didn’t clarify was important. The fix we implemented was nowhere near where we expected the bug, and the only reason we finally solved it was because we had exhausted all other options. Sounds the same, if not worse, as a difficult to track memory bug to me.

_gabe_··on Stack Overflow users deleting answers after OpenAI partnership
This “curation” is what is killing SO. Software is soft. It changes. There is no “one true answer for all time”. It’s honestly sad how many times I search for an answer, only to see the exact question I’m looking for closed as duplicate, then when I look at the “duplicate” I see that it’s an out of date answer.

Stack Overflow could have solved the problem of duplication so many ways. Why not categorize and bucket duplicate answers? They could have even had yearly recurring questions with the most up to date answer! Why not add beginner/hobby/expert rankings to questions so that the people answering don’t get sick of seeing beginner questions all the time?

There is so much SO could have done, instead they rested on their laurels and now they’re left with an out of date repository. What use is a curated repository if it will only help me solve problems with solutions from a decade ago?

_gabe_··on Apple introduces M4 chip
Race car drivers. They are pros. Professional drivers. They definitely know how to drive a car much more efficiently than I do, or anyone that’s just into cars. I assume the race car engineers are the pros at rebuilding engines.

And as for the parent comment’s point, being into cars doesn’t mean you’re as good as a professional race car driver.

_gabe_··on Simplicity is an advantage but sadly complexity sells better (2022)
It’s funny that you mention this. The most helpful research papers I’ve read have been written by private companies. Here’s a couple off the top of my head[0][1]. Short and straight to the point.

[0]: https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007...

[1]: https://developer.download.nvidia.com/devzone/devcenter/game...

_gabe_··on Cognition: A new antisyntax language redefining metaprogramming
For what it’s worth, I was also thinking this is a very wordy article. It has lots of asides, and seems to get distracted from the main point. It gets distracted enough that I have a hard time following it, which is not conducive to what any writer wants to achieve: telling some sort of story.
_gabe_··on 3rd Edition of Programming: Principles and Practice Using C++ by Stroustrup
In addition to what CyberDildonics already said, C++ is also an (almost) superset of C. You can also inline assembly. If you find particular hot loops that need to be optimized at any point while profiling, it’s trivial to drop down levels of the stack to get the extreme performance you may need. There is no FFI needed in C++ to drop down a level. There is no barrier at all. You can write your code directly for the CPU, inline it into your code, and fine tune it as much as you want. I don’t know how that wouldn’t qualify as extreme performance.
_gabe_··on Feathers are one of evolution's cleverest inventions
That’s not the definition of invention.

> a: something invented: such as (1): a device, contrivance, or process originated after study and experiment (2): a product of the imagination especially : a false conception[0]

Studying, experimenting, and imagining all require agency.

[0]: https://www.merriam-webster.com/dictionary/invention

_gabe_··on Feathers are one of evolution's cleverest inventions
For real. I love how they can even call feathers the greatest invention without ever wondering who the inventor was. You can’t claim evolution is the inventor. Evolution is a description of a process, and anthropomorphizing it doesn’t make it possible of inventing anything. It’s similarly funny to me looking through these comments and seeing people marvel about the engineering and design of things like hearts and cells. Does nobody ever think to ask, who designed this? Who engineered this?

It would be like finding a watch someone had dropped on the ground and being like, “Wow what an amazing invention! It must have evolved over several thousands of years until it was able to accurately track the time!”. Or thinking that a chaotic natural process like a tornado could somehow assemble a car if it blew through a junkyard. Both of these are ridiculous arguments, but that’s what people claim evolution is like. After all, given enough time anything is possible? Right?

_gabe_··on Hardest problem in computer science: centering things
I misspoke in my comment and must have used Swing more than JavaFX (I’ve used both, but forgot which one I primarily used, this was 8 or 9 years ago and a short job). Either way, I really don’t like when only a subset of the language is supported, because then it becomes a constant guessing game of whether or not something is supported. In the case of JavaFX, there are a few features not supported and a couple gotchas mentioned in their docs.

And I think vanilla CSS is not that bad. I definitely don’t think it’s bloody awful. Most wrappers around the language added variables and nesting. CSS now supports variables and I think it even supports nesting :)

There’s probably other features that could be good, but for a language that’s just meant to provide style metadata for my UI, CSS works fine.

_gabe_··on Hardest problem in computer science: centering things
> Meanwhile, more than one web developer has communicated to me in private that they hate CSS and barely understand it after years of using it professionally to make money

They barely even understand it?? I think the biggest problem with CSS is the same problem plaguing C++ and other older languages. Cruft. If there was proper versioning and pieces of the language were deprecated in favor of modern techniques, it would remove a lot of ambiguity. Heck, if there was a built-in linter that warned you about common errors that would be a massive upgrade!

The only bad part about CSS is that there’s a dozen ways to do everything.

With that said, any developer telling you they hate it probably hasn’t worked with the “state of the art” in other UI development. Go work with WPF, UWP, QT, ImGui, JavaFX, Swing, or any of the dozens of other desktop UI frameworks. Then, try to make a moderately complex style and apply it to several elements. It’s a PITA. I too hated CSS… but then I worked with WPF and JavaFX and lots of those other frameworks: and they gave me a fresh dose of perspective.

I’ll gladly take the ability to do everything a dozen different ways over the inability to do anything that strays from the happy path in the framework I’m using.

_gabe_··on NPR suspends veteran editor as it grapples with his public criticism
The patty doesn’t get in my fridge unless I put it there… after I’ve gone grocery shopping and picked it up. On the other hand, I pass McDonald’s everyday on the way home from work anyways.
_gabe_··on Tesla Cybertruck deliveries halted for 7 days
> It is true, however, that Jobs was hot tempered, could easily start shouting at his employees and calling their work shit, and reduce them to tears. But he was not just cruel and brutal: he could also be a total charmer and make his colleagues feel like geniuses (this is how he hired most of them actually). While at NeXT, his employees dubbed this swift change of attitude "Steve's hero/shithead roller-coaster", a nice metaphor for the binary view with which Jobs described the world, and how he treated his fellow staff

https://allaboutstevejobs.com/persona/steve_at_work#:~:text=....

Doesn’t sound like everyone had fond recollections.

_gabe_··on I Lost Faith in Kagi
I don’t have a horse in this race, but the author of this post sounds insufferable based on their email responses and fediverse thread. They post a public email on their public website (I assume for people to reach out to them) and then gets mad when someone does so?

> I may not have spelled this out explicitly in my previous reply but I will do so here: I am not interested in getting more replies from you on this subject. Declining a call does not mean I want you to argue with me about Kagi in email either. I do not trust you, personally, either and do not want to have a conversation about that. And for the record, I read that blog page already. If you had read my own blog post, you would notice that I link to it.

If they don’t want to talk, just don’t respond.

The author also cross posted their blog to multiple social media platforms, which I assume means they wanted it to get attention. But then when the CEO does see it and offers some explanations they get mad that the CEO “vomited out” a reply that they didn’t want? I’m sorry, but the CEO of Kagi definitely sounds like the reasonable one here, thanks for linking this thread.

_gabe_··on Roblox executive says children making money on the platform is 'a gift'
I see. It’s not a prerequisite, I 100% agree. But by building a game you will most likely, maybe even unintentionally, develop a strong math background :D

The grandparent comment was talking about how all the different subjects in school can help give you very useful prerequisite knowledge that enables you to become a strong game developer. You made it sounds as if the math isn’t necessary, but I think we both agree knowing math will aid you tremendously in game development. You don’t need to know it to start developing games, but somebody that already has that knowledge will be leagues ahead of you in a lot of topics.

Heck, even the simplest data structure in almost every game engine a Transform (aka transformation matrix) is a loaded mathematical term. The guy that understands linear algebra and how you can combine a series of matrices to apply different kinds of transformations to a geometric object will “get it” way quicker than somebody who has no math knowledge. Then, when they want to do fancier stuff, like transform something relative to something else (like a custom 3rd person camera that hovers above and behind the main character), they don’t have to waste time trying to understand how linear algebra and using matrix multiplication can achieve that effect.

_gabe_··on Roblox executive says children making money on the platform is 'a gift'
> I disagree even though math was my favourite subject in the school. I think I truly only enjoyed math and physics. They were the only subjects I felt like I could actually problem solve and not have to memorise facts I can't relate to or do not know what to do with.

Why do you disagree though? Math is helpful in game design for: pathfinding, vector math, several graphics effects, physics, smoothing animations, setting up in game currencies, setting up probabilistic gameplay elements, random number generation, terrain generation, calculating enemy field of views, calculating trajectories, creating player controllers, and many other logic pieces in games.

If you want to be a good game designer, it would behoove you to have a strong math background.

_gabe_··on Sam Bankman-Fried sentenced to 25 years in prison
I worked at a grocery store for 5 years. A couple retirees worked there because they had to, but most of them just wanted something to do and health benefits.
_gabe_··on U.S. sues Apple, accusing it of maintaining an iPhone monopoly
Microsoft, Amazon, Google, Meta, OpenAI, Intel, Nvidia, AMD, Netflix just to name a few.
_gabe_··on U.S. sues Apple, accusing it of maintaining an iPhone monopoly
It’s not though. My company partners with several other Apple sized and larger tech companies. Some are better than others, and we have running jokes about the ones that like to try to throw around their weight. Because, as you might expect, they are unpleasant to work with.
_gabe_··on U.S. sues Apple, accusing it of maintaining an iPhone monopoly
Can it transfer the photos you have in iCloud? Or the passwords that Apple will “conveniently” store in its internal password manager? Or the bookmarks you have on safari? Or the messages you have on iMessage? Or the notes you have saved in your phone? Or the reminders you have set up? Or the alarms that you have?

I also recently switched from Android to iPhone. There was also an app that automated a lot of it. But there are a ton of tiny things that build up and lock you in to a platform. And they’re all marketed as helpful little addons! Why not backup your pictures to iCloud or get more storage space? It’s great in theory, but it makes that transition so much harder. It’s funny too, I’m actually very unhappy with my iPhone and want to switch back to an android, but I’m waiting. Why? Because it took me like 3 days to fully switch all my stuff over the first time and I don’t feel like going through that again.

_gabe_··on How web bloat impacts users with slow devices
> The largest problem is the over-dependence on the use of "Gesture Navigation" which is invisible and thus non-existent to them.

This is uniquely an iPhone problem, not a smartphone problem. It’s been one of my biggest gripes after switching from android. Where the heck is my back button? Home button? Any buttons? I really despise Apple’s obsession with minimalism and will be switching back to android when this phone dies.

_gabe_··on How web bloat impacts users with slow devices
> there is a large cohort of not that great web programmers who don’t know much

I think you mean “programmers” not just “web programmers”. I’ve worked with plenty of bloated over-engineered Java and C# codebases that take several minutes to start on a very fast developer machine with 32 gigs of RAM. Sometimes, the worst offenders use “lower level” languages! The performance averse problem is endemic in the entire field, not just in the web.

_gabe_··on :syntax off (2016)
It is putting the significance in the foreground. An if statement is a semantic part of the language. Highlighting that is calling out that there is a higher level of programming going on there than a sequential list of instructions. No programmer needs the keyword “if” to be highlighted to know what it means.

Also, how does having strings highlighted put significance in the foreground? The only thing it will show you is if you missed a delimiter. It doesn’t call out parts of the program that do something noteworthy.

_gabe_··on Apple hit with over 1.8B euro EU antitrust fine in Spotify case
Why should a refund even be necessary? What’s the point of Apple’s highly selective review process if they let apps like this through? The only reason that I can fathom is it’s because Apple will gladly take a 30% cut of that revenue. And that is my overall point here.

Everybody always jumps to Apple’s defense by explaining how iPhones are built for inept users that just want a phone that works with no BS. Therefore, they claim, it’s a good thing that Apple has a highly locked down environment. But what good is this locked down environment if Apple will happily allow scam apps to charge their customers for features the phone already does for free? What’s the difference between a user downloading a scam app from an untrusted source and downloading it directly from the App Store? If Apple is going to have a locked down environment, at the very least, they should make it effective.

_gabe_··on Apple hit with over 1.8B euro EU antitrust fine in Spotify case
My dad had installed a QR code reader app on his iPhone that was a monthly paid subscription. He was wasting hundreds of dollars every year for something his phone already did automatically for free by just opening the camera. Apple will happily let scammers create garbage paid apps to do the same thing their phones already do for free. No side-loading to let viruses in required.
← PreviousPage 2 of 19Next →