top | item 17940636

State of JavaScript 2018 Survey

60 points| cstrat | 7 years ago |stateofjs.com | reply

50 comments

order
[+] messit|7 years ago|reply
Javascript is becoming the next c++, what a mess. I can now write a function in about 10 different ways.. In all their efforts to fix it, it only becomes worse. Loads of fancy new features (mostly copied from Coffeescript), but the basic type system is still not fixed!

I miss the simplicity, readability and power of Coffeescript. -> function without context binding, => function with binding. That's it! does?.this?.prop?.exist, nope still not possible in JS. Ah well, the community hates CS and loves all the amazing new features of ES+. Until you look at a random codebase out there of some outstanding JS dev's utilising all the latest features. One big mess of conflicting strategies, unreadable code, poorly documented, bloated, etc.. etc.. But hey, we're using promises, reducers and spread operators everywhere, we're super smart!

When will the JS community start improving on the quality of the code instead of adding new language features, tooling, frameworks and so on? Try to think of better names for your identifiers to start with, using an intuitive naming system throughout a large codebase so it becomes actually readable. No, will not happen, too boring I guess.

I'm writing Typescript now to pay the bills. Adding even more complexity, it scales so well, mainly because you can use the 'any' type. Said enough?

[+] andrewmcwatters|7 years ago|reply
Honestly, I think the only thing that sticks out to me is that JavaScript treats addition and catenation as the same thing, and, humbly, I don't think they are. Maybe some folks here more intimately familiar with good type handling can give their two cents.

But, I've enjoyed dynamic typing in languages where values had types and variables didn't, and because there wasn't any consolidation of addition and catenation, everything was fine. Also type coercion seems to be a pain point in JavaScript for some, whereas explicit type conversion through function calls in other languages seems to remove these issues, in my experience.

And TypeScript seems to bring a lot of powerful concepts to developers who enjoy the benefits of strict typing, which is great.

But, languages that continually expand their grammar complexity and usage conventions feel harder to master to me. Now and again I come back to Lua's reference manual and learn something new that I don't see other developers in that space recognize, and that's the simplest practical scripting language I know. It's complex syntax in Backus-Naur form is one section of the reference manual.

ECMAScript literally has multiple chapters to explain its grammar. I just don't understand how you can truly master that. At least, you certainly would not know all of the edge cases with the language.

[+] jph|7 years ago|reply
Svelte is the best JavaScript UI framework I've seen in many years, better than React, Vue, etc. I'm using it for real work. I would love to see Svelte on this list.

https://svelte.technology/

[+] shaabanban|7 years ago|reply
Hmm I briefly looked at it and I am certainly intrigued. I really like the simplicity of await blocks, but I have some reservations about the template syntax, namely that it reminds me a lot of angular.js. Syntax like

  {#each cats as cat}
reminds me of ng-repeat, and of course there are other similarities.

I'm not necessarily saying that that's bad, but as a matter of personal preference I tend to prefer the html-into-JS approach of JSX / React over what is essentially implementing a subset of javascript as part of the template syntax.

I don't like that you have to ask what parts of javascript you are allowed to use within a template.

[+] danielbankhead|7 years ago|reply
I like emphasis on performance by keeping things light on the browser. I feel many of the popular frameworks focus too much on abstraction rather than providing the best user experience for the end user (primarily load times and disregard for accessibility).

Thanks for sharing!

[+] Someone1234|7 years ago|reply
Mock me if you want but I found this survey confusing to take. The titles/subject areas are disjointed from the questions, then the first question is just the word "Reason." No explanation, just one word, "Reason." Took me longer than it should have to realize what was going on.
[+] tobyhinloopen|7 years ago|reply
Same here. I recall vaguely that "Reason" was some kind of tech and not an order to reason about something.
[+] combatentropy|7 years ago|reply
Is it a survey of the state of JavaScript or a demonstration of it?
[+] diminish|7 years ago|reply
the survey lacks basic UX visual hierarchy and drove me nuts - so I had to abort it :(
[+] spullara|7 years ago|reply
The state of JavaScript 2018 is the 10s spinner as it loads all the JavaScript necessary to run the survey.
[+] andrewmcwatters|7 years ago|reply
Just some feedback to share here for thoughts (I shared it in the survey): most of the time I didn't really care enough to give specific reasons why I did or didn't like something, and felt like it was a retention pain point in the survey.

If I like or dislike something, that should be enough. I know people want to know where things can improve, but honestly, a lot of the time the answer is "the whole damn thing is worthless to me, and there's too many cons to correct and not enough pros to validate its existence to me."

I realize that's not constructive, but if something is fundamentally unappealing, no amount of steering is going to fix that in my eyes.

[+] tobyhinloopen|7 years ago|reply
This. There were too many & vague reasons for like/dislike to choose from and I didn't feel like answering that for every technology
[+] SoylentOrange|7 years ago|reply
Great survey, very excited to see the results.

The option of complexity really spoke to me. If you’re building a small one-off website, then you want something short of a framework like React, but something more modern than Jquery (manage state, reactive style programming). What can you use?

I feel modern client side JavaScript assumes you’re working on a large, long lived site that you plan to maintain. There’s no equivalent of “I just want to create something quickly for use by about 100-1000 people for a few weeks”

[+] was_boring|7 years ago|reply
This is how I coach my team through this: use the right tools for the job.

Now what does that mean? Just displaying some data and accepting some input, or requirements are unclear? No js required. Now they want some interaction, like a hover effect? Use vanilla js, jQuery, or plain css. Requirements keep changing and you have more the 25 lines of js? Maybe start thinking about vuejs to enhance the page and using a simple script tag. Starting to have several hundred lines of js and you can't remember where in the file that function is, or you are required to minify? Start thinking of vuejs plus a build tool.

Do you need js everywhere? The answer is almost certainly no. Do you need to enhance a page with js? That's about a 50/50.

Obviously this is just my advice, but was born from working on small teams, at startups where requirements are often unknown, change frequently, and time to market matters.

[+] runarberg|7 years ago|reply
100-1000 people a week seems like a lot. I’m mostly into ”something to impress my friends and forget about in a month” which—in my utopia—would account for the majority of all websites.

But when I was most active in having fun building websites for fun and showoff, about 3 years ago, I would use [microjs](http://microjs.com/#) quite a bit. I don’t know if that is relevant anymore though

EDIT: Vanilla JS is also a good option and has been getting exponentially better over the years.

[+] spankalee|7 years ago|reply
Web Components are really a great option here. You don't need any library to use them, because they're built-in, or if you choose a library, they're very small.
[+] pjmlp|7 years ago|reply
For me a small one-off website means server side MVC rendering with minimal JavaScript (vanilaJS) for the dynamic parts.
[+] niyazpk|7 years ago|reply
Vuejs is a good option for lightweight websites. Just include the library as a <script> tag and you are good to go.
[+] vinayms|7 years ago|reply
What's funny about the JavaScript world is that there are basically two activities that happen: create yet another SPA framework and create yet another "script" suffixed language in which to code and transpile. Nothing is done to JavaScript itself at structural and semantic level. Even the standards seem to focus too much on peripheral aspects such as spread, arrow function etc which are no doubt useful but don't improve the language itself. The language is still as flawed and imperfect as it has always been.

Why don't anyone think of incorporating at least the low hanging fruits for which developers have to migrate to a different language and transpile? What they do add is halfa$$ed, like const. It boggles my mind. I created an experimental framework called JEEP to remedy the sort of things I am ranting about. Jeep has been happening in several iterations since 2015 and before every iteration I checked if the latest standards would make the framework redundant but sadly the need for Jeep only intensified. Finally I posted the 2018 version here on Show and elsewhere and the response was staggering, in that nobody gave a f.ck. I am not bitter, no, really, but just amazed as to what people find interesting and flock to and what they ignore happily. Admittedly, the framework is quite unconventional and needs some reading and experimenting to be done in order to be fully appreciated, leave alone adopt, and it may even be advocating the sort of things that an average JavaScript developer is not interested in, but the sheer lack of even "what the f.ck is this $hit" was astounding. Some stats: collectively there has been over 3500 views but only 2 comments and a handful of likes, stars, upvotes etc. I am sure it will get attention eventually, hopefully sooner rather than later, its been just 10 days yet, but the initial response is something that has made me recaliberate the priority of an average JavaScript developer.

[+] nelsonic|7 years ago|reply
Does anyone else get the feeling this survey is designed/run (or at least "sponsored") by the Facebook engineering team...? It's heavily biased towards React, GraphQL & co. with a token mention of Vue.js and Angular so as to be less obvious. Of course "the state of JS" is going to say "everyone is using React" if the questions are designed to collect that biased data...
[+] Apaec|7 years ago|reply
I have the same thoughts when seeing comments like "I switched to VSCode from Vim and I couldn't be happier".

Almost all software development articles on HN are feeling more like advertising than honest opinions nowadays.

[+] jkoudys|7 years ago|reply
If it makes you feel better, I shat all over flow and praised typescript.
[+] Keyframe|7 years ago|reply
What do they have to gain from it?
[+] jkoudys|7 years ago|reply
I was surprised to see no mention of rxjs at all, considering observables (and pipelines) are phase 2. Somehow ramda is there, though.

I'm hoping the results show a lot of passion behind koa! I love that approach in general, especially since I find express pretty clunky for reporting errors from async operations. It still seems like the public hasn't really taken to koa yet, unfortunately.

[+] tjholowaychuk|7 years ago|reply
It has improved in some ways but it's still incredibly fragmented, maybe more so with CSS-in-JS, TS, Flow, etc. Especially with the potential of languages like Elm, Rust, Go and others via WASM, it's going to be very hard to justify JS IMO—unless you understand the tradeoffs and still just prefer JS as a language then that's cool, the others aren't perfect either.
[+] christophilus|7 years ago|reply
Odd how ClojureScript is in the survey, but Clojure is not listed in the possible “other languages” section. Oh, well. We Clojurians are used to being overlooked.
[+] jwr|7 years ago|reply
I added it myself. Another problem was in server-side support: I'd wager that most people who use ClojureScript have their backend written in Clojure, to leverage shared code.
[+] golergka|7 years ago|reply
ClosureScript is trying to replace JS for areas where you have to compile to JS such as front end and and Node.js, just as all other languages in that category.
[+] mlthoughts2018|7 years ago|reply
At the bottom of the page,

“Note: to improve results relevance, we keep track of data such as your referrer, location, device, browser, and OS.”

Give me a break. Obviously not relevant for a survey. Only relevant for whatever bullshit they’ll do with this data later on, unrelated to the survey.

“To improve results relevance...” this is just pure contempt for site visitors.

[+] sgdesign|7 years ago|reply
Survey author here. We didn't have the time to correlate device/browser/etc. to other data points last year but we did use the location:

https://2017.stateofjs.com/2017/front-end/worldwide/

Also I'm curious what kind of nefarious "bullshit" you think one can do with browser statistics. Market special weight loss pills uniquely targeted to Safari users?

[+] tazard|7 years ago|reply
Presumably it's also so you don't spam the survey over and over again with your favorite. But yes, overall I agree with your point.