3 ms·
My first contact with js was trying to make a button change its color on mouseover. There was no css back then. I bought a book and was so put off from the synt
by Surac 4mo ago
My first contact with js was trying to make a button change its color on mouseover. There was no css back then. I bought a book and was so put off from the syntax that i never looked back to js from that day on. Never regretted my decision
- notesinthefield 4mo agoI had a similar path and never came back to JS until work forced me to learn. To me, it has only gotten more readable.
- julianlam 4mo agos/JS/PHP
- comrade1234 4mo agoI kind of like real JavaScript with prototype inheritance. It's not how we use it in browsers though. And now with typescript and running it in the server... I'd rather just use Java.
- falcor84 4mo agoThe syntax? I got 99 problems with js, but syntax ain't one of them. It's just C-style syntax, no?
- TheOtherHobbes 4mo agoC syntax was never that great. It's basically mnemonic PDP-11 assembler with a few added data structures. js is mutant C with dementia - hacked together over over a fortnight, full of inconsistencies and weird corners. console.log(1 + "2"); // "12" console.log(1 - "2"); // -1 console.log(NaN === NaN); // false console.log(+0 === -0); // true const obj = {}; console.log(obj.foo); // undefined, not an error
- lezojeda 4mo ago[dead]
- bryanrasmussen 4mo agoNaN is a standardized dynamic languages datatype governed by IEEE 754, this is not something to complain about as its behavior is part of the official standard and for good reason, as outlined in the standard.
- SonOfLilit 4mo agoWhy dynamic? `NAN != NAN` is just as true in C.
- bryanrasmussen 4mo agowell as I understood it, it was implemented for languages without static data typing although I suppose you could implement it in other languages. Also I suppose my memory could be pretty foggy as I don't think I've looked at the spec since about 2014.
- SonOfLilit 4mo agoTo my understanding, NaN is a range of particular values (all exponent bits set to 1, mantissa nonzero) of the IEEE 754 float datatype, and its semantics are defined in the standard, including the "not equal to itself" semantic. If your language uses IEEE 754 floats and it has div or sqrt operations that don't raise exceptions on out of range inputs (which is something scientific computing people want very much, so it probably has them), then it must ensure nan != nan.
- flufluflufluffy 4mo agoNone of those examples are showing something you find wrong with the syntax
- Dwedit 4mo agoC syntax dropped the ball badly on operator precedence. Left Shift <<, Right Shift >>, and Bitwise And & should have been at the same priority as multiplication or division, while Bitwise Or (|) should have been at the same priority as addition.
- afavour 4mo agoThere are a ton of reasons to object to JS but the syntax? It isn’t even all that unique.
- satvikpendem 4mo agoI find these sorts of comments quite strange. So one tried something over 30 years ago and was put off by syntax of all things and then decided they'd never look at it again? So weird to base opinions on 30 year old experiences that were not even in-depth experiences but cursory glances.
- DonHopkins 4mo agoReminds me of one of Microsoft's first Dynamic HTML demos: There were two buttons, one labeled "Our Web Site", the other labeled "Our Competitor's Web Site". When you moved the mouse over the "Our Competitor's Web Site" button, it would quickly slide out from under your cursor before you could click it! Then when you stopped moving your mouse, the "Our Web Site" button would slyly slide right underneath your mouse! Dammit Microsoft!!! ;)