All code already exists in Plato’s world of perfect abstractions. Programmers merely view this ideal world darkly and scribble what imperfect algorithms they can vaguely remember.
Probably not bad. If I could have memorized the entire dotnet framework documentation, I would. Until then I will keep googling, and I will usually recognize if the solution is sound. Probably the same with doctors and health.
Agreed, I’m simply pointing out that the comic makes it seem like programming is something you can always just Google the answers for, instead of a skill that requires honing and a basal foundation, similar to medical science or law.
Sometimes I use various swears. Depends on how long I’ve had to debug. Also depends on whose work I’m debugging and whether they’re in earshot. Usually it’s just my own sketchy code though.
This will generate lots of fun moments when developers use Bun and the runtime environment is stuck at Node for some reason. For instance, because of AWS Lambda.
It’s sad to have the rushed ramblings of a bigot become the fundamental block of the modern world wide web. Why couldn’t it be at least made by a more competent bigot like Carmack?
Sounds like a good use of comments. Explain why, not how. (that should be readable from the code for the most part. Unless you’re having function calls like xmmmuldp (simd) )
This actually makes a lot of sense. A computer executing the code and a human maintaining it need to know different things. A human needs to knon what the code does on a high level (what the programmer intended), how it handles (or does not handle) edge cases, etc. A computer only needs to know how to run the code at a super low level. Without comments, it is impossible to know if code is doing the right thing, or what is expected from the caller.
Except strict equality, that’s a JavaScript only problem. Imagine thinking “0” should be falsy in comparison due to string literal evaluation, but truthy with logical not applied based on non-empty string. Thus !“0”==“0” is true. They couldn’t just throw away == and start over nooooo let’s add === . Utter madness
Browser compatibility. Design flaws can’t easily be fixed like how other languages can just switch to a new major version and introduce breaking changes. ES must keep backwards compatibility so has had to do more additive changes than replacing behavior altogether so that older web pages pages don’t break.
Strict vs loose equality has gotten me so many times, but I can sort of see why they did it. The problem you mention with integers 0 & 1 is a major annoyance though. Like it is fairly common to check whether a variable is populated by using if (variable) {} - if the variable happens to be an integer, and that integer happens to be 0, loose quality will reflect that as false.
But on the other side, there have been plenty of occasions where I’m expecting a boolean to come from somewhere and instead the data is passed as a text string. “true” == true but “true” !== true
Lua does intrinsic evaluation of strings that i’d argue is not nearly as crazy. I get the value of it since half of interpreted languages it just churning through strings. But I also don’t recommend any large codebase ever use JS’s == or string coercion because it can go against expectations. This graph argues in JS’s favor but comparison is a little more crazy algassert.com/…/Better-JS-Equality-Table.html
programmer_humor
Top
This magazine is from a federated server and may be incomplete. Browse more on the original instance.