5 ms·
I rather have the language say "Error, this is garbage!" than silently output garbage.
by wdroz 5y ago
I rather have the language say "Error, this is garbage!" than silently output garbage.
- madeofpalk 5y agoWhich is why we use Typescript
- AnIdiotOnTheNet 5y agoThe fact that there has to be a different language on top of your language to make it same days all that needs saying really.
- lotsofcows 5y agoI keep having this argument with my boss but he refuses to let me write machine code.
- dangerbird2 5y agoIf the good lord wanted us to code in assembly language, he'd have made transistors operate on mnemonics, not electric currents.
- lostcolony 5y agoIf the good lord had wanted us to interact with transistors based on mnemonics, not electrical currents, he'd have implemented our brains in mnemonics, not electrical currents.
- akiselev 5y agoNitpick: voltage potentials and ion channels. There's not much actual current flowing.
- AstralStorm 5y agoNitpick over nitpick: synapses are not exactly electrical or ion current based, they have active transporters. If all electrical activity ceases, does memory survive? (Answer is very likely yes given cryonic experiments. Brain is protein, ion currents have tendency to auto fire on defrost.)
- akiselev 5y agoAh, I was under the mistaken assumption that ion transport was a subset of ion channels but I see now the latter is passive only.
- madeofpalk 5y agoPragmatism of an runtime/ecosystem that highly favors backwards compatibility above all else.
- deleted 5y ago[deleted]
- Griffinsauce 5y agoThis goes for all compiled languages?
- AnIdiotOnTheNet 5y agoWe invented compiled languages because of issues with writing everything in assembly. In other words, we invented C because assembly wasn't very good. Just like we invented TypeScript because JavaScript wasn't very good.
- AnIdiotOnTheNet 5y agoMan do I hate my phone's autocorrect. For anyone confused as shit: The fact that there has to be a different language on top of your language to make it sane says all that needs saying really.
- cygned 5y agoTypescript doesn’t save you from all the weird things happening at runtime. A missing check at a context boundary and you can have a wild time (been there).
- kevinmgranger 5y agoContext boundary meaning where it interfaces with javascript?
- cygned 5y agoThe points where you parse JSON, for example.
- sli 5y agoThis particular annoyance has made me a huge fan of Elm's (and other languages') JSON decoders, and specifically No Red Ink's JSON decoding pipeline. All the type safety I could ever want and no falling back to writing defensive JS to maintain safety at runtime.
- hajile 5y agoThe sad truth is that this stuff was not in the first version of JS. It was added AT THE REQUEST OF DEVS (a decision Eich has said he regrets). Like most bad things, it's only around because a big company said so. Like all bad things in JS, there was a push to remove it at ECMA, but Microsoft had reverse-engineered JS into JScript and refused to go along with the changes to fix the weirdness.
- blacktriangle 5y agoThe root of the problem is the original intent of Javascript. Javascript was intended to be a small layer of dynamism added to web pages that were mostly defined via HTML which were presented to a human for interpretation. When your user agent is a human trying to look up an address for a restaurant, they can look at a garbled piece of crap where the JS crashed and still maybe find what they were looking for in the rendered text. Limp along the best you can is a great failure strategy for Javascript's original use-case. Only now that we've turned Javascript into a general purpose programming language is this a failure. Even Javascript's weak typing makes sense in this case. Why automatically convert everything? Becausethe expectation was that inputs to your Javascript would be HTML attributes which are all strings. Automating type conversions from strings made sense. But once you move to larger scale programing, Javascript's weak typing is awful