9 ms·
Typical dramatic Hacker News user. JS is a great language and enjoyed by millions of developers.
by scottoreily 7y ago
Typical dramatic Hacker News user. JS is a great language and enjoyed by millions of developers.
- YorickPeterse 7y agoYes, it's such a great language that `{} + []` is a valid program.
- s_y_n_t_a_x 7y agoWhat an extremely weak criticism that has been played out. 1) Don't concatenate them in the first place 2) Use TypeScript Pro-tip, if the world is going JS and you don't get it, it's probably you. With JS (TypeScript) I can develop on every platform natively (React Native). I can compile to native code. (AssemblyScript). I'm not saying you can't do those things on other languages, but JS is becoming a powerhouse thanks to it's ecosystem. Also, you see many other communities like Rust copying lessons learned from web developers (React/Redux/etc)
- caiocaiocaio 7y agoJavascript is such a good language that, even after two decades of fixes, it's only good when you use a different language - specifically created to address JS's many problems - that compiles to it.
- s_y_n_t_a_x 7y agoTypeScript is JavaScript. They follow and contribute to the Ecmascript spec. It pretty much just strips the typing out when "compiling". All the JS problems have been solved in ES6+ There are many languages that have supersets.
- ptx 7y ago> develop on every platform natively (React Native) If "native" means bundling a runtime and having your program pass serialized messages to a different thread where the actual native platform code lives, the same can be said for any language. You just need to build the wrappers for the native API – which is a lot of work but could be done for QBASIC running in DOSBox just as well as for JS running on V8.
- s_y_n_t_a_x 7y agoYes, but it hasn't been done for any other language.
- nobleach 7y agoDo you find yourself accidentally doing that often? A few of the things from the "Wat" video fall into that category. "Things no one would have ever thought to try, yet a dynamic language will fully allow". If you want to point out valid concerns with JS, the double-equal implicit coercion is a far more frightening "gotcha".
- b0rsuk 7y agoFew people do that outside of code obfuscation contests, but the point is JS has heaps of gotchas like that, each waiting to bite you. How about: x = 5; (no var declaration). Extremely easy to do by accident. Lots of these will be left for backwards compatibility. In JS errors often go silent and I developed a strong dislike for any language that does that, including Vimscript and Lua (and I do like Vim).
- jimws 7y agoProblems like this can be easily caught by linters like eslint or standardjs.
- nobleach 7y agoI'd agree that global declaration is far more egregious. A sibling comment recommends a linter, and I'd probably agree. It's sad that it was ever allowed as one that is copying and pasting code to another location can easily cause this case to happen.
- s_y_n_t_a_x 7y agoNo JS developer would do that. We all know that is global. Nowadays you use `const` or `let`. Any JS developer will have a linter that will tell them incase they somehow made that mistake.
- tombert 7y agoEh, I actually like JS but I have definitely forgotten to add a "var" or "let" a few times, or sometimes I will do it correctly, get a bit overzealous with cutting, and accidentally remove the initial var declaration. I'm not saying that it breaks the language, but it definitely is irritating, especially if you're not using a linter.
- mpfundstein 7y agoEvery read about the crazy things you can do with C?
- ngcc_hk 7y agoBut at least you know ... it is not dangerous if you know you are in danger kind.
- ynx 7y agoIt's useful and practical and has a lot of work put into it so it can't really be called bad, but it doesn't really stack up to what native languages can provide at the high end, and never will (even if it can get pretty darn close). Though I acknowledge its immense utility, I feel like JS always tends to go for "good enough" solutions rather than "best in class" solutions. That is its own kind of quality, but there's good reason to dislike JS for people who focus on those particular qualities in a language.
- erikpukinskis 7y agoFor sure, if you have a shot at making a world class system you probably don’t want JS. But I’ve never been in a job where we had a shot at building a world class system. Maybe I just have bad luck, but at each place I have worked the problems in the codebase are obvious and the impediments are institutional not technical. There are hundreds of problems I could list in our current codebase that are causing slowdowns, bugs, etc. None of them are because of the programming language. They are places where someone put a square peg in a round hole, where someone copied a bug over and over because they assumed the existing code was correct, where someone used a fancy feature of the programming language that made the program worse. None of that goes away if we start using Rust. So yes, I agree with you if you are within striking distance of making a perfect application use a nearly perfect language. I’ve just never been in that job. I’ve always been in the “let’s fix some of this low hanging fruit, and make sensible use of the tools we have” job.
- discreteevent 7y agoThe problem is that if the system was world class then it might actually be ok if it was in js. Most codebases are a bit of a mess, like you say, and js just makes it much harder to figure out what is going on. It's not just a dynamic language, it seems to encourage a gratuitously dynamic style. So you have to figure out everything in the debugger. That is if you can even determine where to set a breakpoint!
- erikpukinskis 7y ago
- b0rsuk 7y agoThe meaning of the second paragraph was ambiguous. Aside from Javascript dislike, which I don't pretend to deny, I believe learning new things is mind-expanding. When an intriguing movie - or book - comes out, it's often intriguing because it's quite different. When you convert it to a common language - or Hollywood - it becomes less different. Reading "Working With Legacy Code" forced me to absorb some C#, but it also allowed me an opportunity to compare it with Java, which I learned at university. What I understand from this is that people didn't really value Python as a pseudocode language. It was just fashionable at the time. Now it's Javascript's time. I wonder what's going to be next? Golang has a chance.
- ng12 7y ago> forced me to absorb some C# This book will force you to absorb some pure, functional JavaScript. There's so much more to programming than "what language is it written in".
- vmchale 7y ago> JS is a great language literally no one believes this
- erikpukinskis 7y agoI love ES5. The language has gone downhill though.
- colejohnson66 7y agoWhat about ES6?
- mpfundstein 7y agoNow thats an unusual viewpoint? Could you elaborate why you think so? I personally found js terrible before es6 and love it since then
- erikpukinskis 7y agoHere are some things I find problematic: https://news.ycombinator.com/item?id=21848597 https://news.ycombinator.com/item?id=21848597 But I’m happy for you that you like ES6. You all own the language now, so enjoy it. Us ES5 folks are going to have to rewind and fork so we can have a community again.
- zbtaylor1 7y agoThe non-vocal majority does.
- jasonmcaffee 7y agoI do.
- ajna91 7y agoIt's certainly been pleasant so far as I've been learning 2d game development!
- MisterOctober 7y ago
- giancarlostoro 7y agoI like JavaScript despite some of its quirks and there are some annoying ones. However with the mindset to embrace JS I find it easier to work with than blindly hating it. It could be worse. You could be coding in Monkey for Garmin.
- protonimitate 7y agoAgreed. I'm pretty sick of the anti-JS kneejerk rhetoric that happens here. It adds zero value to any discussion. It's nothing more than a desperate attempt to gain some internet points. It's a popular language and it has flaws, but that doesn't automatically make it worthy of the amount of hate it receives here. This type of discussion has more in common with /r/iamverysmart than it does with valuable discourse that HN used to be known for.
- b0rsuk 7y agoI do enjoy "Professor Frisby's Mostly Adequate Guide to Functional Programming", which uses JS examples extensively. Despite the fact my last job was mostly JS, I had to look up functions all the time and stretch my brain muscles. Modern JS is different than "keep it the same" JS. But... converting a book to a different programming language rubs me the wrong way. I miss an opportunity to see another language, too. It's not even some very arcane language. If it really was a knee-jerk reaction, I'd have said: "Learn less edition", or "2D remake" So please stop with that strawman.
- ahuth 7y agoAdapting a book for another language doesn't really make you miss an opportunity, though, right? The original is still freely available for you to look at and see another language.
- Buttons840 7y agoIt's not an attempt to get internet points. It's an expression of frustration that one of the most important platforms of our time has first class support for only one language, and the only reason that language is used is because of its monopoly on the platform. Were it no for that monopoly it would rarely be used. I'm just glad JS is as good as it is, considering it didn't have to be good. It could have been even worse and still would have succeeded due to its monopoly.
- TurkishPoptart 7y agoBut WebAssembly was just made a new standard by W3, which, correct me if I'm wrong, will allow browsers to natively support literally any other language the developers choose.