4 ms·
Is javascript really so bad? Edit: Why did this question get down voted? It was an honest question...
by JustSomeNobody 12y ago
Is javascript really so bad?
Edit: Why did this question get down voted? It was an honest question...
- tinza123 12y agoIt probably is if you have to deal with > 25k LOC code base like what Angular has.
- JustSomeNobody 12y agoWell, there's their problem... Edit: Ok, for the down voters. Angular is HUGE. And all that code has to get shoved onto the client side when someone visits a page. And that's JUST for the framework. We aren't even talking about the application code yet. More and more clients are mobile. Nobody sees a problem here? You're using more (precious) data, it's slower to load and slower to run. It's just a nasty little trend going on. NOW LET'S SEE SOME FREAKING DOWN VOTING!!!
- jaredmcateer 12y agoOnly if you have caching disabled. If you use a CDN, the library is likely already on the users computer. That said their 25k loc code base is 123kb (45kb gzipped)
- path411 12y agoI find a common theme among the people who freak out about 45-100kb of js are often the people with 3MB of images on their page.
- dang 12y agoPlease don't comment about downvotes or bait other users into downvoting you. Those are rules of the site: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- WalterSear 12y agoNot unless you try to make it look like Java.
- possibilistic 12y agoIt can be a challenge for sizable codebases, especially ones with many contributors and that undergoes steady refactoring. That feeling you get when you see code with lots of type checking... A lot of engineering effort could be recovered with static typing.
- WalterSear 12y agoOh, I have no problems with strong typing. In fact I think it's a good thing to add to angular. Angular, (And I say this as once upon a time contributor to Protractor) however, is kind of a step in the wrong direction, and I concluded this before they started flapping about with all these giant course corrections.
- deleted 12y ago[deleted]
- ensmotko 12y agoTo be fair, JavaScript started out as a language that looks like Java. "JavaScript was designed with Java's syntax and standard library in mind. In particular, all Java keywords were reserved in original JavaScript, JavaScript's standard library follows Java's naming conventions, and JavaScript's Math and Date objects are based on classes from Java 1.0" -- http://en.wikipedia.org/wiki/JavaScript#JavaScript_and_Java http://en.wikipedia.org/wiki/JavaScript#JavaScript_and_Java
- Sammi 12y agoThat cherry picking you just made just completely reversed what was actually said in that article: "A common misconception is that JavaScript is similar or closely related to Java. It is true that both have a C-like syntax (the C language being their most immediate common ancestor language). They also are both typically sandboxed (when used inside a browser), and JavaScript was designed with Java's syntax and standard library in mind. In particular, all Java keywords were reserved in original JavaScript, JavaScript's standard library follows Java's naming conventions, and JavaScript's Math and Date objects are based on classes from Java 1.0,[116] but the similarities end there. The differences between the two languages are more prominent than their similarities. Java has static typing, while JavaScript's typing is dynamic. Java is loaded from compiled bytecode, while JavaScript is loaded as human-readable source code. Java's objects are class-based, while JavaScript's are prototype-based. Finally, Java did not support functional programming until Java 8, while JavaScript does, as it contains many features based on Scheme." And read this part too, it has much relevant info: http://en.wikipedia.org/wiki/JavaScript#Beginnings_at_Netscape http://en.wikipedia.org/wiki/JavaScript#Beginnings_at_Netsca...
- CmonDev 12y agoYes, it is really, really, really bad. http://wtfjs.com http://wtfjs.com Whole web is a mess and people are trying to monkey-patch it.
- kyberias 12y agoThis list has some weird examples. It's like the author makes some crazy requirements for Javascript. For example, I don't think it's particularly bad that array[-1] and array.charAt(-1) return different values. Also, I don't get the Math.Max() example with booleans. Seems perfectly logical to me.
- pyrocat 12y ago> Whole web is a mess and people are trying to monkey-patch it. That has been true for the last 20+ years, but it gets less and less accurate as time goes on. The web today is way less messy than it was even 3 years ago. The way we write JS is way less messy, the way we write CSS is way less messy. Standards have improved, lighten up.
- smrtinsert 12y agoAny dynamically typed language is absolutely horrible once you break a certain line count.
- davexunit 12y agoCitation needed. Static typing isn't a panacea.
- mikerichards 12y agoThe parent's post doesn't mean anything, but the please don't do a "citation needed". Even if he had a citation it wouldn't mean much. That said, static typing does help with intellisense/code completion, on-the-fly error checking, refactoring, etc...
- JustSomeNobody 12y agoAt that point, maybe it's better to take a few paces back instead of just one. This is an example of taking only one pace back.
- ianbicking 12y agoI don't personally find TypeScript a rejection of JavaScript in the way that some other transpiled languages are. It feels to me like optional typing plus a bunch of features JavaScript will get in ES6 or beyond.