3 ms·
Learning to code (C) I thought I found a compiler bug lots of times and was almost always wrong. It gave me the heuristic that if I thought I found a compiler b
by procaryote 2y ago
Learning to code (C) I thought I found a compiler bug lots of times and was almost always wrong. It gave me the heuristic that if I thought I found a compiler bug, it was time to take a break, have a snack and go for a walk or something before looking again. It usually helped me find my mistake much faster.
The thing I disliked most about later learning PHP or Javascript was that my previously usually wrong reaction of "the compiler is insane" suddenly turned out to be commonly true. Even when it wasn't an actual bug PHP and javascript were often so poorly designed that intended behaviour wasn't much better than one.
- dominicrose 2y agoThanks for reminding me that the two programming languages I'm using are poorly designed :) Joke aside, JS is getting better especially when paired with the right tools, like Typescript, VS Code, ESLint, Prettier, React+JSX, etc. PHP has been evolving for a long time to be a bit safer with more static analysis. I'm not a fan or PHP's variables that are available in a bigger scope than they should, arrays that can be filled without having been defined in the first place, or that are falsy when empty. The solution is to not abuse these features (not use them at all, really) and code as if it was not PHP.
- Vilian 2y agoJavaScript become good when you create another language of top of it and use at least 2 different frameworks isn't a good sign
- procaryote 2y agoYeah, Javascript has definitely gotten a lot better since those days. It's possible PHP has too, but I haven't had to check Both of them do this weird type coercion that break a lot of things if you pretend they're not JS or PHP; I found I had to learn where the traps were, and use a lot more === and !== and >== etc