HNHacker News
TopNewBestAskShowJobs

_gabe_

1,843 karma · joined April 26, 2022

submissionscomments
_gabe_··on I Am Happy Not to Be a Web Developer Anymore
What industry hasn’t changed tremendously since 2000? Look at Vulkan vs OpenGL 2. Or C++23 vs C++03. Or C# today vs C# in 2000. Or even Java today vs Java then. Or CPUs of today vs CPUs of 2000. Those gosh darned hardware engineers keep making this stuff overly complex!

I find it funny when people from other domains complain about web development changing so quickly, when literally every other domain changes at about the same pace. React has been around since 2013 now, that’s the same age as Rust. Of course if you’re not in the industry and actively following it, it will feel foreign to you if you revisit it in 10 years. That doesn’t mean your industry hasn’t changed, it just means you haven’t noticed it because you’ve been following it all this time.

And you can still use plain JS, HTML, and CSS. And a lot of things have gotten way better using vanilla tools. You don’t have to use a super complicated stack if you don’t want to.

_gabe_··on Internet traffic in Israel surged 170% right after the Hamas attack
Yes, because why wouldn’t you call the people killing innocent 20 year olds at a fucking rave freedom fighters? Or going in families homes and killing parents in front of their children? Or raping and murdering innocent women? Or kidnapping and mutilating women and children?

Idgaf what nationality people are. When they commit acts like these, they are _not_ fighting for freedom, and they are _not_ worthy of any kind of respect. If it’s Americans, Russians, Chinese, Germans, or Palestinians committing these atrocities, it is disgusting, and they are _terrorists_, and I really hope that there is swift and harsh retaliation against these horrible human rights violators.

_gabe_··on Things Every Hacker Once Knew (2017)
It’s funny how you describe it as “ASCII with the top bit set”. As in, by default ASCII doesn’t have the top bit set. You can have malformed Unicode too. There are plenty of invalid ranges defined in the UTF-8 spec, does that mean that UTF-8 is just a convention and those malformed pieces are counterexamples to the convention?
_gabe_··on I got robbed of my first kernel contribution
If you have an overeager junior that went off and spent a week resolving a task that wasn’t prioritized and wasn’t what they were supposed to be working on, I think you could rightly take them aside and tell them “we’ll have to table this for now and come back to it later. Right now we’re prioritizing X and can’t be spending time on…”.

Being a professional is partly about learning how to dissociate yourself from your work, and to realize 99% of the time, your teammates aren’t trying to sabotage you for some nefarious scheme. We’ve all worked on projects for months that eventually got canned. We’ve all gotten rough comments in a code review. It’s up to you as a professional to take those things in stride and learn from it rather than letting that stuff destroy your morale.

And of course, the people who are blunt and rude will also have to learn that being blunt and rude ruins many relationships. But we’re all professionals here, not artists.

If a junior civil engineer was building a bridge and ended up designing it with structural defects, and the senior engineer came up to him and said “I’m sorry we’re just going to have to redo all this because it’s unsalvageable at this point”. The senior is perfectly fine in this case! I don’t want to drive on shoddy bridges built to protect a juniors ego.

Edit: I also think a lot of the comments responding talking about how toxic the maintainer is may not have much experience maintaining a large open source project. I’ve had contributors for some of my OSS projects, and accepting a PR from a random person is a lot of work. Often, it’s more work than doing it yourself. The amount of time needed to carefully review the code, communicate with the contributor to fix issues, make sure the code is upholding the expected quality and expectations is immense. At a job, a junior has already been vetted through an interview process. It’s not some random stranger requesting a change. There’s way more factors here than many of the dissenters here seem to be taking into account.

And getting a PR rejected does suck. But having been on both sides I understand both sides. It’s a difficult situation and it’s hard to resolve these things without upsetting someone unintentionally. (Based on the maintainers communication, it doesn’t seem like they were being particularly nasty or rude).

_gabe_··on Google assigns a CVE for libwebp and gives it a 10.0 score
Responses like this are why people still use C when it may make more sense to use a different language. Don’t just tell people, “trust me bro, never use C, there’s never a good reason”. Never make broad claims that leave no wiggle room, because the one thing that is always true is that there will be exceptional cases. Instead of saying this kind of stuff, why don’t you elucidate what circumstances exist where using C makes sense? Microcontrollers, FPGAs, glue code that can expose your API to other programming languages, maintaining an old code base already written in C, etc.

And as an aside, this is also why people don’t take security seriously. Not every bounds overflow will result in my database being breached and/or my computer being pwned. Instead of freaking out every time a bounds overflow or some sort of memory error is found, it may be useful to actually find out what the impact is. Is that code sandboxed? Is it local, or does it have access to the web? Does it request elevated permissions at any point? Does it even need elevated permissions?

There are many factors that can reduce or increase the risk factor of a bug. Security researchers need to start actually explaining the risk instead of blindly proclaiming everything as a “critical” vulnerability.

And everything I’m saying here has no bearing on this specific vulnerability. It’s in response to the general claim that every memory bug is critical.

_gabe_··on Unity's oldest community announces dissolution
You can share digital games. The PS5 allows you to share games with one other console if your account is logged in on that console. Steam allows you to share games with friends (or family I can’t remember). You and your friend just can’t play the same game at the same time, which is the same way it would be if you shared a disc anyways.
_gabe_··on Show HN: Learn piano without sheet music
> Instead of looking at a measure as a collection of individual notes that must be perceived, interpreted and executed in sequence, they take it in as a chunk.

I’m not professional, but I have been playing for awhile and can sight-read fairly easily. What you said here is 100% true, and I liken it to learning to read a language. Watch how kids learn to read, they have to look at each syllable and letter and sound out each word. Eventually, after enough practice, you don’t read individual letters, you read words. Then, you begin to observe the nuance of the grammatical structure.

I feel like reading music notation has followed a similar trend for myself. I no longer read individual notes, I see chords and progressions. Just like stories tend to follow a plot line, and you can predict how the story may end, music follows a plot line, and you can predict the movement. This is also why certain styles of music is so interesting! We expect the plot to move in a direction and then are surprised by the twist. This video by 8 bit music theory gives a good overview of how that can be done[0].

I especially love when I’m playing through a new piece and every part of the song just makes sense. Yiruma’s music in particular feels very natural for me, and it’s an absolute joy to play through the song and have it all flow together so well.

Anyways, I think a lot of people just don’t give it enough time and give up a bit too early. It’s magical when you pass that point of reading individual notes and enter into the territory of really reading pieces. I still have so far to go, but music will always be a relaxing and fulfilling hobby.

[0]: https://youtu.be/gzK1CTxxRH0?si=H3aUQo83lVl-2BQK

_gabe_··on Airlines make more money from mileage programs than from flying planes
Normally I don’t continue with arguments like this haha. But I just want to point out that I keep saying generally more code means a slower algorithm. And when I say slower algorithm, that implies I’m comparing it to something. The thing I’m comparing it to is an equivalent algorithm with less lines of code. An infinite loop will run forever with just a few instructions. But I’m not comparing an infinite loop to anything here.

And just to be clear, I do agree with everything you’re saying here, but I do think you’re still being overly pedantic.

> Less pedantically a sorting function that is far more efficient will result in the instructions corresponding to individual operations being called thousands of times less.

Exactly. The goal is to spend fewer instructions to achieve the same outcome. As soon as you start thinking about how different instructions take different amounts of cycles and you can speed up an algorithm by using more instructions that are cheaper, that kind of proves my whole point. You can speed up an algorithm by using more instructions, but you have to be intentional about it. The default will never be: more instructions = faster.

_gabe_··on Airlines make more money from mileage programs than from flying planes
Sure, lines of code doesn’t correlate to how much actual code is produced, but I feel like that’s just being pedantic. The assumption that I’m stating here is: the more stuff a CPU has to do, generally the longer it’s going to take to do the stuff.

I’m not arguing that a more complex algorithm can do the same stuff quicker. Of course you can do that. There’s plenty of examples of that. But in the general case, doing more things takes longer.

Of course, the CPU can execute instructions in parallel, it can pipeline instructions and gain a higher throughput, it can predict branches, etc. But those are things you have to be intentional about enabling more often than not. Making small changes in the higher level code can ruin whatever performance gains you had gained because you accidentally trashed the throughput or something.

Generally, more instructions takes longer to process. Of course, a more complex algorithm can do the stuff quicker. But it’s not the default and depending on the problem, it can be very difficult to get it to go quicker with more instructions.

This isn’t even something that should be hard to conceptualize. Getting an element out of an array using an index is O(1). Getting an element out of a hashmap is also O(1) (when there’s no collisions). Even though these both perform the same in terms of complexity (“constant” time) the array will win every time if you already know the index. Why? Because the hashmap uses more instructions to figure out where the index is.

So I really don’t understand why the assumption that: generally, more code = slower is a bad one to make. Unless you explicitly try to make the code with more instructions faster, it will usually be slower than if you did it with less instructions.

_gabe_··on Airlines make more money from mileage programs than from flying planes
> You can add lines of code which use a more efficient algorithm.

Yes, so the burden of proof is on the algorithm. Adding more lines of code, by default, makes the code slower. If the algorithm is more efficient, it can make the code faster. But it must be more efficient.

This logic seems to hold up to me, but maybe I’m missing something here?

_gabe_··on YouTube blocks Russell Brand from making money through its platform
You have a whole lot of words here and are making a lot of claims and provide no evidence. This story is still way too early to say whether any allegations have substance or not, but one of your claims was:

> In fact, the Times' investigation seems to insinuate that the 16 year old Brand was dating when he was 31 approached his publisher seeking an apology before being rebuffed. That seems to me to be the most likely origin for the investigation.

When I Google ‘why is Russell Brand being investigated now’ I get this in one of the first results[0]:

> The women said that they only felt ready to tell their stories after being approached by reporters, with some citing Brand's newfound prominence as an online wellness influencer as a factor in their decision to speak.

This directly contradicts what you said, and I can see why others think you’re giving deference to the media. If you have a source for your claim I’d be glad to revise my stance.

I don’t know what the truth of the matter is, but after hearing Russell Brand admit openly to a lot of gross stuff, it seems like he’s not trying to hide anything here. I’ve also seen accounts from other women who have completely different stories about how he did not mistreat them (and they spoke openly without having actresses speak for them).

All that to say, it’s still way too early to say anything one way or the other. But blindly trusting that the media has no agenda seems unwise.

[0]: https://time.com/6315326/u-k-police-urged-to-investigate-sex...

_gabe_··on Java 21 makes me like Java again
It’s not though. In lots of languages a namespace can span multiple files, whereas a class must be declared in a single file[0][1]. Modules can usually contain a collection of functions and classes. And namespaces can also contain multiple classes/structure/functions and sometimes modules depending on the language[2].

[0]: https://www.typescriptlang.org/docs/handbook/namespaces-and-...

[1]: https://learn.microsoft.com/en-us/cpp/cpp/namespaces-cpp?vie...

[2]: https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...

_gabe_··on So You Think You Know C? (2020) [pdf]
> Eventually I learned I had to rely on the standard instead of folklore

Isn’t this the opposite of what should have been done in the case of coding systems for a nuclear facility? I thought the whole point of the exercises was to show that C has lots of undefined behavior, so you should only rely on the behavior of the specific system you’re coding for. If the C standard doesn’t specify what happens when a signed integer overflows, that doesn’t mean you can just ignore it. You could crash the system, report an error, or find out what the targeted system is specified to do in the case of a signed integer overflow. Is there something else I’m missing here, or do the nuclear systems typically have several processors that may have varying behavior for this type of stuff?

_gabe_··on Java 21 makes me like Java again
100% agree. You can create a HammerFactoryFactory to churn out HammerFactories in any language. But the ecosystem in Java (and C# is similar imo) promotes and encourages this type of problem solving.

The one thing Java really does need is free standing (or namespaced) functions though. Sometimes I don’t want a class, what’s wrong with a function in a module or namespace in that case?

_gabe_··on Game Development Post-Unity
Math books can be a hit or a miss, but Game Engine Architecture is an amazing overview of all the major systems in a game engine. You’d also be doing yourself a disservice if you didn’t read something like OpenGL Superbible (that book filled in so many gaps in my knowledge and made graphics development so much easier).

As for the rest of your comment I absolutely agree. I wouldn’t discourage anybody from trying to write a game from scratch, but if you want to focus on art style, level design, game mechanics, and being able to easily ship to almost every platform, then I would definitely encourage you to use an engine like Unreal or Unity.

OP made it sound like Hollow Knight could’ve been a great game if only they didn’t use Unity, but I don’t believe that. It is a great game, full stop. It’s like people that complain about electron (which I also tend to agree with) irregardless of whether the final product is any good or not. VSCode is great, in spite of the fact that it was written in Electron. And ultimately, the people buying your games really won’t care how it was made, they’ll just care about how it plays.

_gabe_··on Game Development Post-Unity
> Again, I predict a couple weeks.

I’ve made similar predictions in the past… these days, I predict that a couple years actually makes a lot more sense. Especially if you’re not familiar with game engines, and especially if you have to figure out: physics, input mapping, window systems, graphics pipelines, audio systems, game logic component systems (basically the game loop), level systems, transitions, platform support (switch, PC, PS5, Xbox, …), level editors, serialization, animation systems, particle systems, and more!

I have a big fat book sitting on my bookshelf called Game Engine Architecture by some of the developers at Naughty Dog. That bad boy is 1,000 pages and just gives a high level overview. It does not teach you how to set up a graphics pipeline, open a window or write a shader. I have other big fat 1,000 page books for those. Those do not teach you the mathematics needed to fully grasp linear algebra. I have yet more big fat 1,000 page books for that. Those books do not teach you C++, I don’t believe any book is sufficient for that big fat language, but I have a few anyways.

It’s cool if you enjoy tinkering on engine stuff, but boy am I glad that the Hollow Knight devs (I believe there were only 2 people) just used an engine. It’s an amazing game, and I could care less how it was made. I’m just glad that it was made.

Edit: I forgot to mention game HUDs, UI systems, font rendering in general, and asset management pipelines to the list of things that come with an engine but you’d have to either code it yourself or just not have it if you don’t want to use an engine. All of these subdomains can have years of effort poured into them (speaking from experience). The rabbit hole never ends haha.

_gabe_··on Bitty Engine: An itty bitty game engine
That Lua debugger/editor with ImGui looks awesome! I’ve been wanting to do a similar project since Lua makes the API for creating breakpoints and stuff pretty easy. Styling ImGui to look like a normal code editor must have been no easy task though.
_gabe_··on Any sufficiently advanced uninstaller is indistinguishable from malware
There’s a Raymond Chen article (or maybe it’s in his book) about people that complain “why doesn’t windows just let me do…”, and he then goes on to give several examples and show what some of the downsides are if you allowed it. This article looks similar, but I’m not sure it is[0].

The name calling and lack of actual examples shows that you probably haven’t even thought about potential downsides. I haven’t either, but it’s because I don’t really care about this particular issue. I just care enough to point out that the “mentally-challenged foot soldiers” at Microsoft may have actually run into some exploits or malicious behavior because they did “allow useful things” at one point.

[0]: https://devblogs.microsoft.com/oldnewthing/20050607-00/?p=35...

_gabe_··on Unity plan pricing and packaging updates
I’ll have to check out the Lyra example! But yea, C++ definitely feels more comfortable for me at the moment. I’ll try blueprints again in a few years :)
_gabe_··on iPhone 15 and iPhone 15 Plus
> I am a satisfied owner of an iPhone 14 Pro Max, and every phone I’ve owned since the iPhone 3GS has been an iPhone.

I think this is the majority of iPhone users, and it really might behoove you to actually try an alternative (and give it an honest go, not a couple days and then returning the device or something). For years I was convinced I was missing out on the bliss of iPhone because I was on my crummy Galaxy phones which were clearly inferior to genius wrought Apple devices. So, a couple months ago I finally caved in and bought my first ever iPhone and… it’s just a phone. In fact, some things really suck.

For instance, when I tried to reply to you I tried to select the text in your comment to quote you and it took me 6 tries to select it (and I didn’t even select it all I gave up because moving the dumb cursor is just impossible so I wrote in the missing words manually). I never had those issues on my Galaxy, text selection just worked.

Add to that the lack of a back button (or any buttons at all), a keyboard that has no period or number row on the main page, no backtick key anywhere(!), crappy auto correct that corrects words I’ve already typed and moved on from, no customizability, no feature discoverability (I’ll often have no clue that a gesture exists or something unless I Google trying to figure something out), terrible volume controls, bad notification display, no option for TouchID, and did I mention I hate this stupid keyboard?

Anyways, I’ll gladly switch back to an Android in a year or two. Maybe I’m just used to Android’s quirks and an Apple user would hate all the Android features I like, idk. What I do know is that the phone brand does not matter. The features differ very very slightly, and the performance differences are negligible from my normal use cases. There is no superior phone brand, it’s all just preference at the end of the day.

Sorry for the long rant by the way, it’s not directed at you but more at the general zeitgeist in the comments I’ve been reading here. It’s crazy. I must be taking crazy pills or something reading how impressed people are with the most mundane features.

_gabe_··on Unity plan pricing and packaging updates
I just started using Unreal 5 to prototype a VR game (lots of quirks but this engine is amazing). I’ve been writing C++ for 5ish years now and am pretty comfortable with it. I’ve also been slowly converting all the blueprints in the VR template provided by Unreal to C++ for a few reasons and was curious if these effect you.

I tried using blueprints for awhile, but it just feels so cumbersome and time consuming. I can bang out 10 lines of code basically as fast as I can think, but converting those same 10 lines of code to blueprints often involves much more time. You have to click around a bunch, rearrange the routing wires, make it look readable, abstract a lot of stuff into functions that usually don’t need it just because it helps condense the blueprints. Then the blueprints end up sprawling a large area and are very difficult to keep in my head at once (whereas it would normally take less than a page of C++ code to write it out and you can easily hold that in your head).

Basically, I was wondering if these downsides to blueprints effect you much or if you’ve developed suitable workarounds? I want to like blueprints, but the time it takes to click around and make it readable is painful, in my opinion, more painful than compile times for the C++.

_gabe_··on My Node.js is a bit Rusty
Thanks for the clarification and detailed response! I think your final two points are probably the two things I was failing to take into consideration here. I’m used to trying to profile medium-ish systems (like 40-50k lines of code) so that was the context I was bringing into this. In regards to the example listed in the article, you are absolutely right about being able to intuit where the hot spots may come from because it’s such a small isolated piece of code.

I’ve still got a long way to go in learning more about profiling, especially when it comes to JITed stuff or things with a heavy runtime. But it’s always nice to hear about how other developers approach profiling (it can feel like black magic to me a lot of the time).

Thanks for the article on escape analysis too! I’ll have to check that out in a bit :)

_gabe_··on My Node.js is a bit Rusty
I’m curious, have you done much profiling? And what tools have you used if you have? This isn’t a judgment against you, it’s a genuine question because I’m wondering if perhaps I really am just this inexperienced. But the one thing I’ve learned is I’m always very surprised by where the hotspots in my code come from. I always assume big allocations, or bad cache coherency, or O(1) loops when I could use a hash map will be the killers, but then it turns out it’s something else entirely.

Because of this, I’ve just learned to never trust my intuition when it comes to this. Compilers are crazy these days, and it’s very difficult to tell if something will be slow or if the compiler is going to clean it up behind the scenes and make it a non issue. Add to that JIT for certain languages and I don’t even know how you would begin to intuit where a hotspot would be.

Edit: And just for additional context, I’ve used Intel’s VTune profiler, Tracy, Optick, and written a few manual benchmarks. Using these tools isn’t always easy, but they give a lot of insights that I wouldn’t pick up on my own.

_gabe_··on 25 Gbit/s at home, part 1
> but I always multiply transfers times 10 to estimate bandwidth, since there is some overhead in the TCP/IP protocol
_gabe_··on Historians have an increasingly strong incentive to tell dramatic stories
> I would not argue that these meta-narratives are "ahistorical", though

That seems to be what you were claiming though in your original comment:

> as there is no shortage of fictional narratives anywhere — look no further than US state-approved high-school history textbooks.

_gabe_··on The worst programmer I know
You both make good points, on second thought it’s all about how you spin it :)
_gabe_··on The worst programmer I know
Now when you Google “Tim Mackinnon programmer”, the 5th or 6th result for me is a link titled “The Worst Programmer” and the little descriptive blurb below that says “His name is Tim Mackinnon…”. I know the author was click baiting and flipping the story on its head, but I would be a bit annoyed if Googling my name + programmer surfaced something like that.
_gabe_··on Driverless cars may already be safer than human drivers
The 80:20 “rule” is interesting because it’s not a rule, it’s an observation. The Pareto Principle isn’t a law for a reason, because it’s observing the natural result of categorizing data. This medium article was surprisingly good[0] and makes a good point: even if you eliminate those 20% of drivers you won’t see an 80% decrease in accidents because the system as a whole fluctuates daily.

I don’t think anyone came forward with any data in the replies because this distribution is impossible to come up with. Like another commenter pointed out, we all account for those distracted drivers, or tired drivers, or “accident prone” drivers at some point in our lives (possibly many points in our lives). Because of this it’s impossible to remove the 20% of the poorest drivers and have a dramatic increase in road safety.

The only way to fix this system would be to remove all the factors that you listed completely. The easiest way to remove those would be to stop having people drive cars. We won’t know if it’s safer or not until we get there, and it will still have its own 80:20 distributions, just based on different factors (and hopefully to a smaller degree).

[0]: https://medium.com/pinstriped/when-the-pareto-principle-goes...

_gabe_··on Driverless cars may already be safer than human drivers
I thought that the whole point of self driving cars is it eliminates every single one of the problems you just listed. Humans get tired, drunk, distracted, ignore warnings about low pressure in the tires etc. A computer doesn’t worry about any of these things. It just complies or it doesn’t.

It’s kind of like the whole rust vs C++ debate. Rust proponents say that Rust as a language just eliminates a whole class of errors(memory errors). They’re just nonexistent anymore. Sure there are new problems, but they’re hopefully less commonplace. Your argument would be like a C++ programmer saying, “can we see some statistics on how many security vulnerabilities show up in code written by a modern C++ developer using smart pointers and RAII? That way they can make more informed decisions over whether rust is necessary.”

I think it would be interesting to see some alternative statistics, but I’m looking forward to the day nobody gets killed by an irresponsible drunk driver because cars don’t allow people to drive at all. Plus, once all the humans are off the road, I presume new technology can be made to reduce traffic patterns and other cool things.

_gabe_··on Practical parsing with Flex and Bison (2021)
Python is popular because of the ecosystem that’s been built around the language.
← PreviousPage 5 of 19Next →