28 ms·
JavaScript for People Who Hate JavaScript
- pbowyer 9y agoI've gone through the same experience this year, having picked up modern JavaScript, Angular2, TypeScript and RxJS for a project. For me it was TypeScript that did it. I came to appreciate strong typing. And ES6, fixing the 'this' scope problems and with a conventional class syntax (I understand prototype inheritance is clever, but it's not the way I've been trained to think). I didn't get to use async/await for various reasons, but that looks to remove my third pain point (callback hell/promises/observables). RxJS remains a mystery (I swear the API wasn't designed for humans) I use and hope it works, and combining code that use Observables with those that use Promises still wakes me up in a cold sweat. But now going back to old territory (PHP, Symfony) I miss it. Yesterday's miss was union types. TypeScript has spoiled me.
- TomMarius 9y agoThere is no callback hell if you're using promises correctly. While await is the best option, plain promises are pleasant to work with as well. Could you paste an example of how do you use them? If you're actually using them wrong, I'll gladly show you how to do it right.
- slackingoff2017 9y agoAmen for typescript. With TsLint and all the options on JavaScript is almost pleasant to work with.
- 5trokerac3 9y agoI left React for Angular 4 this year, because I came to the realization that once I made the decision to leave the loosie-goosie world of default JS, there was no reason to have my framework be loose either. I'm really loving the confines of a "one way to do it" framework like Angular 4. It makes teamwork much easier, speeds up development once you've gotten over the learning curve, and is damned impressive when it comes to app performance. I'm really looking forward to the day when TypeScript platforms like Angular 4 compile down to WebAssembly and performance goes through the roof.
- kneedeepclunge 9y agohow well does Angular perform on production? as far as i know, React is used more widespread
- 5trokerac3 9y agoIt's blazing fast. IMO React is more widely adopted, because it's been production ready for longer and because of the whole Angular PR debacle. Once the platform development settles down (v2 -> v4 anyone?), I think it'll be the clear option for enterprise level development.
- calafrax 9y agohorribly.
- pbowyer 9y agoWe used Angular inside Ionic for an iOS app. Performance is OK, but I can't tell you if a different JS framework would be faster, or if it's a device/Ionic limitation. The main problem has been with rendering large sets of data (say 100+ items) in a scrolling list.
- pps 9y ago> I'm really looking forward to the day when TypeScript platforms like Angular 4 compile down to WebAssembly and performance goes through the roof. You will be disappointed https://github.com/WebAssembly/design/issues/219 https://github.com/WebAssembly/design/issues/219
- disease 9y agoTypeScript also works wonders in React. Using a component that someone else made? TypeScript will make sure you are passing it the props it expects. Change the expected props for a component? TypeScript will immediately let you know what code you need to change for every component that uses that component. Also NoImplicitAny and StrictNullChecks are two great tastes that taste great together. Everything in your code is now typed, AND TypeScript will now actually make you think about how you are handling (or not handling) null values. These two flags have basically allowed us to completely eliminate all the 'X is not a function of Y' and 'Z is undefined in this' errors - which is pretty amazing because for me at least these were probably the most common JS errors I get.
- WorldMaker 9y agoMost of my projects I wound up switching from RxJS to xstream [1], for several reasons related to size/performance and synergy with a framework I heavily use (Cycle.js). It's RxJS influenced, but written from scratch in Typescript with a much simpler API surface and somewhat easier to reason with semantics (default "hot" and "shared" Observables versus default "cold" and "unpublished" Observables). Also, Typescript now supports (since 2.3) downleveling async/await all the way to ES5, which is very handy. [1] http://staltz.com/xstream/ http://staltz.com/xstream/
- flavio81 9y agoTypescript will give you compile-time type checking, but the actual runtime (javascript) is weakly typed. For me this is the main problem with the language, otherwise it is a good language even without compile time type checking.
- pbowyer 9y ago> Typescript will give you compile-time type checking, but the actual runtime (javascript) is weakly typed. Yes and this sucks. There have been a few bugs I've had (can't remember details) where the types or visibility looked OK in the editor but I was bitten at runtime. No doubt due to my loose configuration - tightening up the linter would help and getting rid of null/undefined overlaps is my next move.
- sametmax 9y agoTL;DR: JS with a ton of make up and tooling to not write JS is not as horrible as it used to be. Well. That doesn't make it awesome either. You just traded some problems for others. Like the damn source map never working correctly, the build time being longer and longer, and the never ending list of plugins you expend every day after stumbling on yet another small-minuscule-not-that-important-I-swear detail. The tool chain you spend more and more time on, despite all the "5-minutes" bundles provided by facebook or on githubs. Explaining things to new comers has never been as difficult as it is now. Teaching is a pain. Choosing your stack is a dangerous bet, and the odds and steaks are changing all the time. If you opt-in for a flux architecture, you will soon write Java-as-in-the-90 on the frontend instead of Javascript, with so many adapters and design patterns as layers you will become angry. If you don't (you-totally-don't-need-redux-to-use-react-guys) then most documentations and tutorials will not answer your questions, and you are own your own solving every single problems. Even the simplest ones, like redirecting on a route after data changes and closing a panel at the same time. "Libs, not framework" means you need to relearn everything, rewrite a lot of code, tests and doc and renew maintenance for each new project. Meanwhile nobody agree on what a the proper stack is. JS, despite all the paint on the rust, still has the old gotchas. This is still weird. ";" is still auto inserted. "==" still compares like nothing else. Errors come in different so many different forms it's not funny. Basic maths assumptions like commutativity are out of scope. Still no namespaces, but instead we use monstrosity like webpack and incompatible import systems to encapsulate things. Stdlib still doesn't have essential things like hashing, string/date formatting or encoding. Even basic operation like removing an element from an array using an index is a pain. No, I'm sorry, JS has not become awesome. We just arrived to a point were we accepted we have everything to built with it and agree to pay the huge price for it. That's all. Projects like vue.js makes me think there is still hope we end up with elegant tools from people who care. But right now I just embrace the madness and make money with it: all those poor customers don't realize the trap the current mindset lead them to, and I have so many solutions to the problem they should never have had to sell them.
- lhnz 9y ago> If you opt-in for a flux architecture, you will > soon write Java-as-in-the-90 on the frontend > instead of Javascript, with so many adapters > and design patterns as layers you will become angry. That's not necessary. It depends where you're working. I agree that teaching the complete stack is a pain. I guess there is `create-react-app` to help you there, but its scope is very small: you're not going to get static typing for example.
- kreetx 9y agoThis probably comes off as said from an ivory tower, but I don't think it's the people from other untyped languages who hate JavaScript nowdays. ES6+ looks pretty good compared to Python/Ruby/PHP perspective, and it works in the browser!
- amiga-workbench 9y agoI don't hate javascript for its quirks or implementation details, I hate what it has done to the experience of browsing the web, and now what it is doing to desktop software.
- ztjio 9y agoYou don't think a blinking cursor should use half your processing power, and a handful of small text files shouldn't use all of your RAM? Pfft.
- simonlc 9y agoThat was actually a css bug in chrome.
- plopz 9y agoAnd why should a css bug in chrome affect my text editor?
- amiga-workbench 9y agoThis is your text editor on meme tech stacks.
- snarfy 9y agoSome of my hate has been lessened after looking at microsoft's own benchmarks. NodeJS performs much faster than ASP.NET 4.6 + IIS. Core improves on this, but the point is after all these years writing .net applications I knew they weren't native performance but they were good enough. I didn't know javascript was just as good or even better in some areas. Now, implementing the entire browser rendering stack just so the dev can use css and html to develop the UI, that's a different issue, but not really a javascript issue.
- TazeTSchnitzel 9y agoI disliked JavaScript, but then I read JavaScript: The Good Parts, and I saw that with a bit of discipline* there's something quite pleasant underneath. It's a book that, rather than being focussed on telling you what not to use, instead shows you various approaches to programming with what you should use. If nothing else it'll give you food for thought and unlearn you of your worst beginner habits. Mind you, it's a dated book and ES6 added a lot to the language. *don't listen to every suggestion of Crockford though; e.g. having to hoist your variable declarations is as obnoxious an idea in JavaScript as it is in C
- dmitri1981 9y agoHow is hoisting your variables obnoxious?
- TazeTSchnitzel 9y agoDefinition and initialisation/usage get separated, which impairs code readability.
- pluma 9y agoIt mixes implementation concerns with functional concerns. He recommends hoisting the declarations because that's how `var` scope works in JavaScript. Normally you'd want to introduce variables where they're actually used to provide context for them. A variable definition at the beginning of a function implies the variable is important to understand the general flow of the function. This can be especially misleading for temporary variables like counters which only matter within a particular loop. Additionally assigning values halfway into the function implies they had different values before, leading you to go back and check whether they were assigned anything else (and used for anything else) or just declared without a value. Of course these problems can be avoided by simply using the new let/const variables which are block scoped, but even here Crockford would likely advocated for hoisting within the same block because of the Temporal Dead Zone (i.e. a block scoped variable exists from the start of the block but referencing it before it was declared is an error).
- 9y ago
- inopinatus 9y agoI've gone through a similar experience with Rails 5.1 which has, having ditched jquery, gained support for webpack, babel, yarn, and vue.js (& react) instead; and thereby made writing JavaScript an order-of-magnitude less painful for me. I feel that ES6 is a palace built on the ruins of a garbage dump and an odd stink still leaks through from time to time, but like the author, I can work with it now without loathing what I'm doing.
- cel1ne 9y agoBackground: I learned Javascript 1997 and kept up. I have extensive experience in ES6/React for the browser and Java/Kotlin for Server-, Desktop- and Mobile-Apps. A week ago I switched a fairly new project from the usual setup (react/babel/webpack) to Kotlin-code only. My IDE compiles the Kotlin to JS now and webpack serves it as usual. Writing the react-bindings took me an hour, after that my productivity went up by about 10.000%. It's finally on par with my productivity on server and desktop. No type errors, fast refactoring, no "undefined" errors and all the goodies (extensions) of Kotlin. Removing the complex eslint settings and babel-setup from webpack and package.json felt triumphant. My JSX looks like this now and is completely typesafe: val LieferungenList: (props: ListProps) -> ReactElement = { Datagrid { div { className = "..." ... } TextField { source = "date" } TextField { source = "produktname" } EditButton { } } } I even get compiler-errors when I nest HTML-tags the wrong way (h1 inside h1) or so. I couldn't be happier. I'll never touch plain ES6 again.
- bru 9y ago> source = "date" > source = "produktname" Honestly that doesn't look "completely typesafe": what are those "source"s? Don't they refer to another element? What happens if you make a typo there?
- Zolomon 9y agoI wager there is type inference going on and that the IDE will supply red squiggly lines beneath the expression if the author were to supply something that would not one way or the other convert to the types that source can consume.
- cel1ne 9y agoIt maps to database fields. The compiler checks that it's a string, but the rest is done by `admin-on-rest`'s mapping.
- 9y ago
- twii 9y agoOmg, so this guy thinks he knows why I'm hating Javascript? Well, it's definitely not because of the lack of types, or because without Prettier my code looks shit, neither would it be the lack of E6/ES7 features since I'm using Coffeescript 2. No, I hate Javascript especially for it's conitnuously changing ecosystem being forced upon you. You named Dan Abramov? Ah, the guy who deprecated almost all flux in favor of his own idea (Redux), or by deprecating React Mixins, because he thinks Mixins are bad, Higher Order Components is the new holy grail? If I am looking for a job as a Javasript developer at the moment it is not about my coding skills, it is about my willingness to adopt all those hyped technologies, and the author of this article is just making it worse. I also hate Javascript for all those people reading this that think I don't understand it yet, and are going to explain me how great ES6/ES7, Promises, and/or Typescript are. Please don't.
- whostolemyhat 9y agoWell, if you don't like learning then you can still use DHTML like it's 2003
- alixander 9y agoIf your only reason to hate a language is that it's making improvements (that you can't/won't keep up with), it would seem that language is doing something right
- gkya 9y agoIt's not that it's improving, it's that it's changing in every direction at light speed, and if you say went on holiday for a month offline when you come back the odds that you find the syntax and the ecosystem substantially different is very high. And whether all or most of these changes are indeed improving anything is doubtful. I personally can't follow JS anymore, it's a storm of not-so-news from every direction.
- tracker1 9y agoSince ES6/2015 the changes have been pretty minimal, so I disagree with your assertion. Since 2015 I find that async functions is probably the most alien addition... and the handful of others that are significant are mostly ignored or very natural extensions. The shift from callbacks to promises is kind of alien, but frankly that was started well before 2015 even. The .babelrc I use for node projects is pretty simple as well, here's one I use for an AWS Lambda build... { "presets": [ [ "env", { "loose": true, "targets": { "node": "6.10.3" } } ] ], "plugins": [ "syntax-dynamic-import", "syntax-object-rest-spread", "syntax-async-generators", "transform-class-properties", "transform-decorators-legacy", "transform-object-rest-spread", "transform-async-to-generator" ] } So that's literally 3 things that aren't in spec yet, and a couple that work around the runtime not having them. Most of what's going in is already in, or relatively well established and on the way. Now, you do have to include a lot more if you want IE11 support, but hey, that's a different thing. I'm not sure what exactly you're having a trouble wrapping your head around.
- dmitriid 9y agoJavascript is only going to get worse. Much worse. TC39 proposal "process" is driven by a never-ending self-congratulatory circle-jerk. Any concerns are dismissed with "people on TC39 discussed it, they know better, how dare you question their wisdom". While there's still time, escape to TypeScript (though it will be flooded by crap from TC39 soon enough), ClojureScript, Kotlin, Scala.js, Elm, Purescript
- porker 9y ago> While there's still time, escape to TypeScript (though it will be flooded by crap from TC39 soon enough), ClojureScript, Kotlin, Scala.js, Elm, Purescript And dartlang
- ztjio 9y agoDon't worry, Web Assembly (or something similar) will soon be ubiquitous and having one, thoughtlessly tossed together, horribly "designed" language which constantly receives updates that are wholly ignored where it really counts will no longer be the reality of web targeted development. If there is one good thing about web dev today it's that adoption of new tech in the client space is really fast. Of course, personally, I solve this problem by refusing any job that requires me to use JavaScript more than twice per complete solar eclipse. That's worked quite well now for over a decade.
- tempodox 9y ago> ...refusing any job that requires me to use JavaScript... I'm getting jealous. Most job offers I see conflate software development with web development and even jobs earmarked “backend” come with JavaScript baggage.
- menckenjr 9y agoNative mobile app development is the exception here if you can weed out the "we need an iOS developer with a strong understanding of Angular.js and HTML5" jobs or the React Native jobs that some consulting company talked a hiring manager into thinking they need.
- pluma 9y agoNitpick: I'm guessing you mean 10,000% and English isn't your native language. In English the period "." is a decimal separator, not a thousands separator, so 10.000% means 10%. EDIT: Holy cow, at least four downvotes so far. I hope the downvotes are for nitpicking and not out of disagreement. As cakemuncher seems to disagree (which doesn't mean they downvoted) this seems like a great learning opportunity about decimal separators and non-native speakers: The parent is most likely German (the example code uses German so that usually means Germany, Austria or Switzerland) which uses the comma as decimal separator and period as thousands separator. I'm German too, so I'm sensitized to this mistake. Here's the Wikipedia article for reference: https://en.wikipedia.org/wiki/Decimal_mark https://en.wikipedia.org/wiki/Decimal_mark The US, the UK, New Zealand, Australia and English-speaking Canada all use the dot as decimal mark. South Africa is the only major English speaking country using a comma instead, but they use a space as thousands separator rather than a period. The parent clearly intended "10.000%" to be read as "ten thousand percent" so that leaves the following list of countries which according to Wikipedia use a comma as thousands separator: Argentina, Austria, Bosnia and Herzegovina, Brazil, Chile, Croatia, Denmark, Germany, Greece, Indonesia, Italy, Netherlands (currency), Portugal, Romania, Russia, Slovenia, Spain, Sweden (not recommended), Turkey Exactly zero of these countries are predominantly English speaking. So in other words, in English 10.000% means ten percent (with a precision of three digits after the decimal point), not ten thousand percent.
- cakemuncher 9y agoThat depends on which English speaking country you're from.
- simplicitea 9y agocongratulations, you've taken a well-documented version of an abstraction about web components and turned it into an undocumented version of an abstraction about web components without adding anything useful to the expression language. W0W.
- dfcowell 9y agoI agree with this. When the library docs and examples are in the native language (ES*) it's easier for developers unfamiliar with the code base to get on board. We've switched to Typescript for our React projects because we've found it's the sweet spot between developer perks (type checking, static analysis, intellisense, inline lint errors) and abstraction of the actual code running in production. It's also a lot less of a readjustment to make if you need to dive into the transpiled source to track down a subtle or unusual bug.
- cel1ne 9y agoI agree principally, however I haven't found it to be an issue. Kotlin is rather literal in it's translation. Arrays are mapped to arrays, interfaces are mapped to objects. Plus you can use plain javascript anywhere in your code: val p: MyTypedObject = js("new require('something.js').default") val other: MyTypedObject js("Object.assign(other, p") Or you write wrappers which do what you think they do: @JsModule("react") external object React { fun createElement(name: String, props: dynamic, vararg children: dynamic): ReactElement interface ReactElement {} } It's definitely necessary to understand both languages though.
- snorrah 9y agoCurious, do you read your post back to yourself after posting, and think "hmm that might make me come across as overly sarcastic and mean rather than simply conveying I don't see the point of what he went to all this effort for" or do you just not care about that kind of thing?
- dmitriid 9y agoReact was never an abstraction over WebComponents. What the guy did was create another DSL over React's API. (JSX is another DSL)
- eecc 9y agoMeh, all I got from this article is that this guy is writing a calendar app. Perhaps that's the whole point of this post. ;)
- shime 9y agoSame here. Very clickbaity title. "I like JavaScript now" is basically a TLDR version of the post.
- jmull 9y agoYes, but I thought it was pretty funny, so I forgive him his little commmercial. Anyway, I doubt there's room in the world for yet another calendar app... so I also want to give him a break because I feel bad about him likely wasting his time.
- vmware513 9y agoInteresting, because Create React App is fairly new tool, however Ember CLI gives you the same thing for years now... so JavaScript World was always cool, at least for Ember.js developers. ;)
- shime 9y agoEmber CLI is a cool tool that preceded CRA, since it was inspired by Rails' CLI tooling. Unfortunately that's the only good thing about Ember, since it comes with the "batteries included" mindset making it one of the most bloated JS frameworks.
- GeneralMaximus 9y agoI primarily built frontend applications, so JavaScript is pretty much the only programming language I use on a daily basis. I'm not in love with it (although post-ES6 JS is quite pleasant to write), but I don't mind it as much anymore. The reason? I feel like JavaScript is heading in the same direction as Java. The core language is highly flawed, which has resulted in the community developing build-time tooling and editor niceties to keep things sane. In the future I expect to see more tools like Flow and Prettier, and existing tools and editors becoming smarter. I'm excited for improvements to JS as a language, but these days I'm more excited for new tooling.
- simonlc 9y agoWhat are the flawed parts of the core language?
- christophilus 9y agoThe comparison `==` is basically something you should never use. `this` is confusing for most people, etc. That said, it's fairly easy to avoid these problems.
- dbbk 9y ago> The comparison `==` is basically something you should never use. This doesn't feel unique to JavaScript though? It's the same with, say, PHP.
- cosarara97 9y agoAnd PHP is usually regarded as even more flawed than Javascript.
- john255 9y agouseless
- rcarmo 9y agoI've been using Node 8 again after a few years of staunchly avoiding it, and the pain of selecting the right kind of libraries to use async/await sanely without having to massage promises (and .then()) is still there - in that sense, I feel very much like that cat with the strawberry beret on the article heading...
- dbbk 9y agoWhy are you having to bring in libraries to use async/await? What does the native implementation not provide?
- rcarmo 9y agoI'm not bringing in libraries. I'm trying to put together a set of libraries that work well with async for my purposes (custom net I/O, databases, etc.) without having to wrap them or fiddle with resolving promises on my own.
- epicide 9y agoIs there something in particular that you do not like about Promises?
- rcarmo 9y agoYeah, having to deal with inconsistency across libraries inside the same project.
- epicide 9y agoI don't really see how Promises leads to that... do you mean the fact that not all libraries support them out of the box? Bluebird (probably my favorite Promises implementation) has nice features to interface pretty easily between callbacks and Promises.
- simonlc 9y agoLots of people relate ES2015 to giving us a better javascript, but the core language remains the same; the changes are just additions. Building a tool chain can be an extreme pain in the ass because everyone is still experimenting, and trying to make the web better. Things like web workers, hot module reloading, and code splitting are relatively new, and don't have mature tools or patterns. Yes it's hard to learn, and yes it takes a lot of time, but once you learn a few tools you can keep using them over and over. I've been using gulp and browserify since 2011, and recently switched to gulp+webpack for code splitting, and HMR, and the switch couldn't have been easier.
- finchisko 9y agoI'am huge fan of JavaScript and personally don't like both Ruby and Python, but would never write an article titled: "Ruby/Python for People Who Hate Ruby/Python". I just don't use them. Writing such a article is IMO arrogant and bad for your karma. I understand some programmers are forced to use JS against their will (because there is not other person for the job), but if you hate JS and you're not forced to use it, please just don't use it and then you don't have to write such a negative and opinionated articles.
- StevePerkins 9y ago> Writing such a article is IMO arrogant and bad for your karma. Works wonders for your clickrate and Reddit-karma, though. After all, we're all here discussing this, rather than some other substantive content with a more sober title. It's the way human behavior works, and the reward system produces content accordingly.
- goatlover 9y agoJS is more on par with Ruby & Python these days feature-wise, but I just don't see why one would prefer it. Ruby & Python are better thought out languages from the get go. Go listen to Brendan Eich discuss how he had to rush JS out the door as compromise between Sun & Netscape, and then how he couldn't fix the language warts even before ECMA.
- skocznymroczny 9y agoI switched to Dart few months ago, it actually makes JavaScript bearable. I never get to see the actual generated JS code.
- christophilus 9y agoDart is surprisingly nice, considering how little I hear of it. I picked it up recently as a target for my hobby project (a Clojure interpreter). Dart's VS Code integration is phenomenal. Its VM is pretty efficient from a resource consumption perspective (especially compared to the JVM). It's worth a look, for anyone who hasn't bothered with it yet.
- garaetjjte 9y agoDart as language is nice, but it compiles to unreadable, bugged pile of obfuscated JS code. I've written one application in Dart and now regret it.
- golergka 9y agoIt looks like the author didn't mention the main reason many of us hate Javascript: weak typing. Weak typing is great for small-scoped project without a lot of business logic. But when there's a lot of data, a lot of assumptions about it, and, most importantly, these assumptions change A LOT during development - which happens all the time in game development, for example - strong typing is a godsend. When I make a change in a strong-typed language, I deliberately make it in such a way that the code won't compile unless I complete it. If I can make something a compile-time instead of a run-time error, I do it (and that's why I dream of switching to Rust one day - on some game engine two generations from now, unfortunately). When I refactor something, I know that compiler will let me know if I forget to change it somewhere. Compiler is my dearest friend. Compilation errors are his gentle hints that make my code better and prepare it from failing in user's hands. Without it, I feel lost and always on my toes. I have to write tests instead. I have to launch the project (which, when it uses a lot of resources, always has overhead) and test everything by hand. When I write a big project in Javascript, I feel like a minefield, unsure of what's broken and what's not. I can't understand how people write serious, big projects in weak-typed languages.
- mathw 9y agoMe neither. It just seems really fragile and unwise. I've had people tell me that tests deal with all the issues I would fix with a decent type system, but this seems to involve writing tests to see if things are passing the right types around, which is code the compiler of any strongly typed language already has in it that you don't have to write. I don't even find dynamic languages faster to get started with, but maybe that's because I'm so used to static ones with good type systems. If you can call C#'s type system "good", that is. It's mostly adequate!
- davidreiss 9y agoPeople either hate javascript with a passion or they love it with religious zeal. Maybe it has to do with the fact that it's used mostly for web programming? But geez, there seems to be no middle ground when it comes to javascript. But it doesn't come close the division over Perl. Yikes.
- vitomd 9y agoIf React or Vue.js don´t click for you try Riot.js https://github.com/riot/riot https://github.com/riot/riot It´s a minimalistic js library with a lot to offer. I made a tutorial some time ago, I think it could give you a glimpse about what you can do http://vitomd.com/blog/coding/hello-riot-js-quick-tutorial-about-this-awesome-lib/ http://vitomd.com/blog/coding/hello-riot-js-quick-tutorial-a...
- mhd 9y agoMy problem with the current Javascript culture (which definitely includes the React infospace) is basically the inverse how I felt about C++ back in the day. Then, in the early years of the second age, I felt that the libraries and frameworks I was using should use more of the then-current standard, like the STL, RTTI or whatever was hip and promosing back then. These days, it seems that every feature that is semi-supported in at least one transpiler isn't just used (in various ways) but in fact begets a whole slew of libraries. Especially when we're talking about ways to circumvent the async-hole. Other transpiled languages will either have the equivalent features, use lots of inline JS or ditch large parts of the ecosystem. While the latter would be possible if NewLangs standard library is big and good enough, I'm not feeling particularly optimistic about that. Quite likely that C++ history will repeat itself: Just use the core language and a minimal library and do everything yourself (back then that was e.g. C++/Win32/ATL, not sure what it'll be for my future browser-based projects. Modula-3, I miss thee.).
- agentultra 9y agoI was a Python developer for about 10 years before joining a startup that works almost exclusively in Javascript. I had to swallow my pride and make the best of it. I had a huge, smug chip in my shoulder. ES6 has made the language tolerable. Enjoyable even. It has even been a decent medium for mentoring more junior developers who haven't had any exposure to functional programming in school. I can show them combinators, functors, applicatives without all of the usual ceremony in a more pure language. For that JS has been quite nice. However for my own projects I just use GHCJS or Bucklescript and compile down to JS. Google Closure and Webpack are fine tools for shaking out the unused code and bundling everything up.
- ajford 9y agoCurrent Python dev here. I've found the same thing. I really didn't like Javascript prior to using ES6. Now it's fairly tolerable. I'm currently building an app with a React based front end and a Flask-based API for data exploration and QAQC. The "where does the semi-colon go" game is really annoying, but I'm getting better at it, and ESLint will let me know when I mess up. But I do enjoy a lot of the features in ES6 that make JS (EcmaScript will never sound right to me) nicer to write. My huge pet peeve is that it feels like it takes so much work to set up an app compared to my experience in Python. But maybe that's tooling. I do have some boiler-plate code to get things working, such as setup.py templates and YouCompleteMe for code completion, and I use VirtualEnv and Pip to manage dependencies. I guess that's basically Webpack and NPM and package.json/webpack.config in JS development. Who knows. My issues with JS/ES might be all in my head.
- agentultra 9y agoI'm one of those people that just trusts ASI. Once you stop inserting them you stop noticing so much. After introducing an ESLint configuration to my team I still can't get the semi-colon lovers to consistently insert semi-colons. I made semi-colons a warning only just to see since ASI will insert them anyway. The worst offenders are the die-hards. I was originally a semi-colon person but that's only because I listened to a talk by Crockford once and never thought to draw my own opinion. As a Python programmer I thought semi-colons were silly already and this talk only entrenched the unfounded idea that Javascript was bad in my mind. I use them at work because when in Rome... but in my own projects there's no need for them. Currying is a nice effect of the fat-arrow syntax for lambdas. Currying in JS is still neutered compared to OCaml or Haskell where it's the default but it's still nice. Function composition is greatly enhanced by it. Python requires special help to do currying. As for tooling... it's the same deal in many languages despite all of the marketing. It might feel painful to get a good development environment set up for a Javascript project but it can be equally painful to setup a Python environment if you haven't done it before (or a .Net, Java, etc, etc). I'm not a huge fan of excessive configuration. But that's what you get with programmers. We're a fickle bunch. What Python does well though is to absorb good ideas into the implementation. Function decorators, iterators, and soon mypy; when you go with the grain, Python is a wonderful language.
- sAbakumoff 9y agoI really enjoyed the writing style of the article - "hottest shit on the street", "It’s just a yarn install away", "DHTML was totally rad, like how the Budweiser frogs were rad."...just brilliant! Also gave me a good nostalgic feeling about DHTML..
- 0xffff2 9y agoI wonder what the split on this is. I gave up on the article pretty early on specifically because of the writing style.
- sAbakumoff 9y agoI am not a native English speaker, maybe that :-)
- pmlnr 9y agoDon't compare JS (or any language) to any other language - or any language to another language. People wrote a lot about it (Your language sucks because... - type things). JS is just another language. The JS ecosystem is wild and moving way too fast, but even that is not really the trouble with it: it's that it's being overused. He mentions DHTML at the beginning, which was the perfect example of using too much of something: mouse trailing bouncy balls with falling snow, my, I don't really miss those days. Yet we're here in 2017 and React & Co. is crippling the web. Plain simple news or a blog site rendering with JS? AMP, loading megabytes of Javascript, claiming to speed up the web? When your product is text, how about you serve text and maybe only boost it or do analytics with JS? I know it's not fancy, but for a lot of sites out there, JS based rendering is completely unneeded. In case of web apps... A little while ago I listened to a talk of front end colleagues, claiming that we'll speed up the site by async calling some blocks, so the initial content will get down fast and the less important ones will follow. When I asked if we're measuring the very end render time - the one that heats the CPUs, because you offload the rendering to the client, which can get quite stressful - the answer was 'no', mostly because nobody knows how to do it. I also asked about how screenreaders will work with this, and they thought I'm talking about mobile, which is extremely sad, and no, I'm unaware of any screenreader-friendly JS based app. (Screenreaders are the programs literally reading out the text for visually impaired.) Google and FB offers fallback, HTML-only solutions to their services, because the realised their things don't work on slow connections and/or slow devices. Maybe this should be taken as a sign.
- prawks 9y ago2 quick points: - The paradigm shift in writing interactive web pages in the React "write your app like a game that re-renders every frame"-style is extremely compelling. You are correct that there are plenty of largely static sites that do not need JS-based rendering, but for people wanting to develop single-page web apps or other interactive content, that mindset is a godsend. - We recently re-wrote an ecommerce site with React and it is WCAG 2.0 AA compliant. To our knowledge, and to the independent firms that have audited our application, screenreaders have no problem with it. You still have to go through the diligence of all of the standard a11y-friendly techniques like semantic markup and thoughtful keyboard navigation, but React at least does not get in the way.
- DonHopkins 9y agoThe best way to truly hate something is to know it very well.
- lopatin 9y ago> [Prettier] It’s basically like gofmt for JavaScript. Gotta mention jsfmt, which is actual gofmt for JavaScript. Awesome tool, hasn't been updated in a while though. RIP Rdio. https://github.com/rdio/jsfmt https://github.com/rdio/jsfmt
- tchaffee 9y agoOne thing I like about the more quirky languages like JavaScript and PHP, or even the far less quirky but still dangerous C language, is that they force you to write good tests. You don't get the false sense of confidence some other languages give you. I'm still not positive if static types are a poor man's test suite, or if a test suite is a poor man's static types, but I find tests are far more flexible and great at describing intent.
- tambourine_man 9y agoThis guy's got a great sense of humor. I pissed my pents with the linked[1] 1x1.gif article. Or maybe I'm just as old as he is. [0] https://zachholman.com/posts/only-90s-developers/ https://zachholman.com/posts/only-90s-developers/
- w4tson 9y agoI enjoyed that bit too. I wondered how many people on here would have experienced trying to layout a webpage with 1x1.gif up your sleeve
- swlkr 9y agoThe latest js tooling is certainly light years ahead of where it was last decade, but it's a double edged sword, because now it takes a lot more effort to get something going. Indie hackers like myself are still better served by vanilla rails + turbolinks, it gets you something that feels fast wtih a lot less effort.
- peterbe 9y agoYes, CRA is a Huuuuuge step forward. https://www.peterbe.com/plog/10-reasons-i-love-create-react-app https://www.peterbe.com/plog/10-reasons-i-love-create-react-...
- mr_ali3n 9y agoSorry, not trying to be a d*ck here but I don't get the point. You said you don't like the NodeJS eco system as you need to install thousands of packages to get your work done whereas on the other hand, your find CRA which uses tons of NodeJS packages to get the work done. Secondly, code splitting, Babel, bundling has nothing to do with CRA, they are just standalone packages which works well together. Third, "What’s more, updates are great. It’s just a yarn install away.", Isn't this something which NPM does as well? Syntax - Again, nothing to do with ReactJS, it's babel which comes with polyfills. So am just curious here to understand that how exactly CRA changed your mind where 90% of what you are doing is pure JS and has nothing to do with ReactJS?
- manx 9y agoI also started learning JS in the DHTML era and wrote small games and toys for IE4. I did PHP stuff for almost 10 years and it was my main programming language. But at some point I stopped doing webdev, since the whole thing was a big mess and didn't seem to get better. I hated it. After a long break I decided to do another web project again and worked with Scala in the backend and Angular and ES6 in the frontend (about 2.5yrs ago). At first it seemed to be a lot better, but we ended up with another working but unmaintainable SPA. Adding new features required a lot of knowledge and was a pain. In this project I tried and failed to implement a solid Graph Library in JS. This motivated me to look at ScalaJS and write this library part of the app in Scala. It worked very well and I was amazed by the JS interop. From this point on I develop new web-apps with Scala in the full stack and am very happy with it. I suggest to try it yourself for the frontend, since it has a very similar syntax to JS. The type safety avoids most runtime errors and therefore painful debugging time. Compile times became a lot better recently. http://www.scala-js.org http://www.scala-js.org The real power comes when you share your data structures and algorithms with the backend, get a type safe REST API and macro-based high performance json/binary serialization.