HackerTrans
TopNewTrendsCommentsPastAskShowJobs

vore

no profile record

comments

vore
·3 lata temu·discuss
I know that HN is not one homogeneous opinion, but it always comes up in these Apple threads that all this device attestation and secure enclave stuff is unambiguously good because Apple does it, but when it comes to TPM key escrow or Web Environment Integrity suddenly everyone is up in arms about how it's a total violation of a user's freedoms to do what they want with their device.

You shouldn't defend something that's inherently consumer hostile just because it happens to be for something you like.
vore
·3 lata temu·discuss
This is in fact the most popular HN opinion that always comes up on every Apple thread.
vore
·3 lata temu·discuss
Because if you've worked on any large scale software project, technical issues like this are almost always because of priorities and timeline.
vore
·3 lata temu·discuss
I think the developers are too overworked to feel embarrassment from a random person on the internet criticizing them.
vore
·3 lata temu·discuss
time_t has historically been a typedef to a 32-bit signed integer, so the signedness is baked into a lot of legacy software still running today.
vore
·3 lata temu·discuss
Performance measurements are only one dimension of code quality. Having a laser focus on it disregards why you would want to sacrifice performance for a different dimension of code quality, such as extensibility for different requirements.

You should check if your code is in the hot path before optimizing, because the more you couple things together the harder it is to change it around. For instance, in Casey's example, if you wanted to add a polygon shape but you've optimized calculating area into multiplying height x width by a coefficient, that requires a significant refactor. If you are sure you don't need polygons, that's a perfectly fine optimization. But if you do, you need to start deoptimizing.
vore
·3 lata temu·discuss
There you go, actually: you can have your clean code cake and eat it too if you have the right language abstractions (like parametric polymorphism).
vore
·3 lata temu·discuss
Have you never used C++ iostreams? Or the Python file abstraction? Or Rust std::io::Read/std::io::Write? Or Node.js streams? Or DOM Web Streams? Or Ruby files? Or Haskell conduits? Or hell, fopencookie/funopen in C?

The abstraction is super common and allows you to connect streams to each other without worrying about the underlying mechanism, which 99% of the time I don't really think you want to worry about unless you're sure it's a performance overhead. And that's great, because I surely don't want to write specializations by hand for all the different combinations of streams I need to use if I don't have to.
vore
·3 lata temu·discuss
I think it really truly depends. I think it's always good to do the minimal viable thing first instead of being an architecture astronaut, but if you've been asked for three (random ballpark number) different implementations for the same requirement it might be time to start adding some indirection.
vore
·3 lata temu·discuss
The shapes example is pretty contrived so I don't really have an opinion on it either way. But imagine you have something like a File interface and you have implementations of it e.g. DiskFile, NetworkFile, etc., and you anticipate other implementors. Why would you do anything other than have a polymorphic interface?
vore
·3 lata temu·discuss
This guy is so dogmatic about it it hurts. I would argue that clean code is a spectrum from how flexible vs how rigid you want your abstractions to be. If your abstractions are too flexible for good performance, dial them back when you see the issue. If your abstractions are too rigid for your software to be extendable, then introduce indirection.

We can all write code that glues a very fixed set of things end to end and squeeze every last CPU cycle of performance out of it, but as we all know, software requirements change, and things like polymorphism allow for much better composition of functionality.