839 karma · joined April 19, 2012
1) Not calling promises in parallel. Easy to do because it's impossible to run them in parallel with just "await", need to use Promise.all() or something.
2) Forgetting to write "await". If you try to use the return value then now you have a Promise object instead of the actual value. But the worst is when the code doesn't use the return value. Then it has a really subtle race condition that's hard to find. Or if the promise has any errors, then you might get the dreaded "Unhandled promise rejection" with a useless stack trace, and you might need to search the entire codebase to find where it happened.
- It doesn’t do great as the code gets older or more complex. Google “fragile base class problem”.
- Inheritance doesn’t do a good job of modeling most real-world problems. Most situations don’t map into a simple “class Dog extends Animal” kind of hierarchy. Steve Yegge’s “the kingdom of nouns” is a great rant on this topic.
- OOP actually requires expert-level knowledge to do right. It seems like it’s beginner-friendly but that’s kind of deceptive. If you’re using inheritance then you should understand Liskov substitution, otherwise it’s not going to work well. And if there’s generics involved then you might need to understand covariance vs contravariance, which is also a beginner-hostile expectation.
Imo, out of the newer languages, I really like Golang’s take. Interface-heavy, no inheritance, and some nice sugar around composition. Dunno if I agree with their lack of generics but I understand the choice, generics create a lot of complexity.
Either way, definitely find something where you have an in-person coach. Its way too easy to develop bad form habits if you’re just learning from Youtube or something.
The benefit of WASM is that it's more general purpose because it's lower level. It's agnostic to your memory model, so you can have a not-Java object model if you want.
I don’t think there’s value in teaching a beginner about the prototype chain. It’s kind of obsolete knowledge at this point. ES6 classes work great, and will be very familiar to people coming from other languages.
I mean.. if someone was a beginner in Python would you first teach them about the metaclass system? (I wouldn’t)
Don’t use unnecessary compile-to-js syntaxes like Coffeescript since they will just be a burden in the long run. TS and JSX is an exception, those are worth it.
Don’t write “undefined” in your code, just write “null”, and treat those values the same. Some programmers will assign different meanings to “undefined” versus “null” but usually these meanings are arbitrary and silly. In most situations you don’t even need one kind of null, let alone two.
Maybe it depends on the person, but that actually sounds more difficult to me than just lifting the weights.
But on the topic of switching your brain, you have to know that not all developers can switch between languages as easily, they aren't all special geniuses like you.
In response to "But JS can be obfuscated/minified" - Minified JS is still much easier to examine/modify than WASM, and it's really rare for a site to deliberately obfuscate their JS beyond minification.
But anyway, that's history, now we have nice languages that have safe nulls, so the interesting questions moving forward are: why are people still creating new languages that have unsafe nulls (looking at you Go), and why are people still choosing to use languages with unsafe nulls?
Or to say it another way... considering that they didn't have any extra checks on this transaction, what reason is there to think that they would actually use that multi signature thing, if they were on Bitcoin?
"Unnecessary complexity" is all those arcane coding rituals that we do, that our users don't know or care about, but we have to do because our current tools demand it.
We can't get rid of necessary complexity and so we probably can't design a programming interface for someone that is completely illiterate in math & logic.
But what we can do is 1) Eliminate unnecessary complexity, and 2) Provide helpful, structured, interactive, learnable tools, which help guide the author as they do all the "necessary" steps. If we just did that then that would be a huge improvement from the state of the art.
For the other aspects like getting the cache timing, that does seem harder. I don't really know if it's feasible in practice.