Earlier quoted context omitted.
Not everybody can afford a Tesla or a BMW. For some of us, A Toyota Corolla or a Honda Accord is more than capable of getting the job done.
Hey, Toyota and Honda are good quality cars, did you mean chevrolet, ford or renault?
JavaScript. The Core: 2nd Edition
61–70 of 96 posts
Re: JavaScript. The Core: 2nd Edition
#62This is a very solid foundation to work with, for anyone who might have struggled with the contexts and how arrow functions, local variables, thises (hah) and prototypes fit into the bigger picture. It also clearly shows that Javascript is not the mess that it looks like from a beginner's perspective. Yes, anyone can create a 15-20 min video about how == and === can mess up stuff, how you cant just pass around a func…
I wonder why nobody has created a version of JavaScript that just throws exceptions for all the WTF cases? That is, it would basically be a mode like 'use strict-at-runtime'; . This would be incompatible, but it would be a useful development aid. Surely most frameworks like React and Angular avoid these corners of the language, and they could be trivially modified to run on such an interpreter? It would improve their…
Re: JavaScript. The Core: 2nd Edition
#63Earlier quoted context omitted.
Sure this car get dust on the ventilation, and you can mess up if you use the 3rd gear and you can't really use the blinkers without being careful and the seat warmers are wtf. But in the end of the day, stick to this car long enough and it works for you. Plus the most popular road of the world only accept this car so take it or leave.
I fail to get the flak that javascript faces ! Coming from java it was a breath of fresh air. This was the car that let me drive without a seatbelt when i wanted, let the doors be open if i wanted, stepping on the gas accelerated without fail and the brakes functioned fine, i could change the gearbox orientation, choose which side the steering wheel i wanted to be in general let me do what i wanted to without getting…
Re: JavaScript. The Core: 2nd Edition
#64Earlier quoted context omitted.
You've got me thinking now. Can you/anyone give me 3 solid cases where the flaw was in javascript and not the programmers understanding of the language ? I can't. (Not at the moment at least). Most of the times I got things wrong it was my understanding of how js works that was at fault.
>Can you/anyone give me 3 solid cases where the flaw was in javascript and not the programmers understanding of the language ? I can't. These were problems in various stages of JS's history, but not necessarily now: Browser differences in javascript by not having a good specification or strong governing body. Not having block-level scope despite convention in other C-like languages. Optional semi-colons. typeof incon…
Its the browser implementation that was at fault. The ambiguity in specs was and is minimal to negligible for the past 8 years (since I started following). But like you said, not relevant today.
> Not having block-level scope despite convention in other C-like languages. > Optional semi-colons.
Its a feature, not a bug!
> typeof inconsistencies.
Maybe. Never faced it.
> Another problem with JS changing so much is developers picking up the language at various points in that development.
What I see constantly changing is JS frameworks and preprocessors, not the language itself. Newer folks tend to learn some JS framework first before the language itself (just like I did) and the constant change can hurt and impede progress and confidence. The language itself has been well documented and forgiving in my experience.
So yeah, point taken. You do not like JS. I do. Let's make peace with that.
Re: JavaScript. The Core: 2nd Edition
#65Earlier quoted context omitted.
It gets flak for the same reason php gets flak. They both more or less accidentally became popular. None of them were very well designed. They both lacked type safety. Unlike php though javascript became not only popular but it actually ended up being the only alternative.
It's jealousy. Most languages had major design flaws. Rubyists will gladly complain about how OO is bolted on in Python, Python users will gladly talk about how slow Ruby's interpreter was and how god awfully complex the syntax is. Both of them have limitations in their runtimes and are actually catching up to JS in some areas (see Python's adoption of async). We can talk about how baroque CL is or how much Java suck…
Re: JavaScript. The Core: 2nd Edition
#66Earlier quoted context omitted.
You've got me thinking now. Can you/anyone give me 3 solid cases where the flaw was in javascript and not the programmers understanding of the language ? I can't. (Not at the moment at least). Most of the times I got things wrong it was my understanding of how js works that was at fault.
I understand that Javascript will silently do something stupid and keep going if I accidentally call a function with an argument left off, but I'd still prefer to get an error message. I understand that I need to use === instead of == to check if two things are actually equal, but I don't like that either. It's not that you can't understand how the language works, it's that the language does some things that feel stu…
Re: JavaScript. The Core: 2nd Edition
#67Earlier quoted context omitted.
I wonder why nobody has created a version of JavaScript that just throws exceptions for all the WTF cases? That is, it would basically be a mode like 'use strict-at-runtime'; . This would be incompatible, but it would be a useful development aid. Surely most frameworks like React and Angular avoid these corners of the language, and they could be trivially modified to run on such an interpreter? It would improve their…
Probably because the WTF cases are exaggerated. After a couple of months coding JS you will know it well enough so it doesn't bite you. It really is a non-issue for people who work with it daily.
But there are plenty of people who would recommend Python over JS as a first programming language for exactly this reason. Python gives better error messages and has fewer WTFs.
I think JS could be a good teaching language if it were not for the confusion over types, which is an important thing for a beginning programmer to understand.
Re: JavaScript. The Core: 2nd Edition
#68Earlier quoted context omitted.
I wonder why nobody has created a version of JavaScript that just throws exceptions for all the WTF cases? That is, it would basically be a mode like 'use strict-at-runtime'; . This would be incompatible, but it would be a useful development aid. Surely most frameworks like React and Angular avoid these corners of the language, and they could be trivially modified to run on such an interpreter? It would improve their…
TypeScript, Flow? That's kind of what you're asking for.
Re: JavaScript. The Core: 2nd Edition
#69Earlier quoted context omitted.
It's hard for me to take these comments seriously unless you feel this way consistently across most other dynamically-typed languages -- at least it'd be consistent. I've used most dynamically-typed langs at this point and I've run out of reasons to use something aside from modern Javascript if I would have originally used Clojure or Ruby in the past. Though it feels sheepish to reward your low-effort comment with a…
I still find a lot of reasons to use Ruby, though like you I spend a lot of time doing JavaScript in places I wouldn't have a couple years ago. (For a long time I've been anything-but-JavaScript, but I was also using JavaScript before it was cool--somewhere on a hard drive somewhere is a JavaScript implementation I wrote as a scripting layer for a game I was working on in like 2006...) My experience with API design i…
It sounds like if that's the sort of kit you want, then Ruby is for you compared to Clojure/Javascript.
What I do like about Javascript is that it's easy to write ad-hoc types via Typescript for my SQL functions to specify the shape of the data that comes from the database. I would never go back to something like Active Record that tried to make me canonicalize all of my data.
I have to wonder if these are more identity-level ecosystem differences.