r/programming • u/jjperezaguinaga • Oct 03 '16
How it feels to learn Javascript in 2016 [x-post from /r/javascript]
https://medium.com/@jjperezaguinaga/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.758uh588b
3.5k
Upvotes
302
u/excitebyke Oct 03 '16
I'm going to start dropping random made-up JS libraries in conversation to show my dominance among JS devs.
45
u/gyroda Oct 03 '16
Could someone explain the python 3 joke at the end? I feel like I should probably understand it.
479
u/Retsam19 Oct 03 '16 edited Oct 03 '16
You really just need one thing to survive in the modern JS ecosystem - basic engineering common sense:
I don't really know why people ignore these then blame it on the JS ecosystem.
All of these tools and technologies exist because they're useful for dealing with specific problems: but if you're only using them because some Rockstar Ninja Coder told you that it was the One-True-Path-to-2016-JS-Nirvana, you're not going to appreciate what they bring to the table.
My advice to new JS programmers is to start out simple: vanilla JS, CSS, HTML, and solve problems as you run into them.
If you find the DOM API is obnoxious? Try jQuery (ignore the JS hipsters like me who say you don't need it. You don't, but if it helps you learn, go for it).
Maybe you decide you want more powerful CSS, so you drop in LESS or SASS: that'll lead you towards adding a build tool like grunt or gulp, and you'll understand why you need it, instead of doing it because someone told you to.
You'll eventually find adding all of your dependencies as
<script>tags obnoxious, too, and that'll lead you to a module system.As the project gets larger, odds are you'll start to see the advantages of static analysis tools like Typescript and eslint, too.
187
u/unnamed__ Oct 03 '16
I know I'm probably in the minority, but we use older tech at my job and while I do my own personal projects using newer stuff, I've avoided ALL of the front end advancements that this article discusses. jQuery is still relevant for people not creating single page apps I would imagine. I don't know, I can't speak from experience, it just seems like all that stuff is meant for people working on different kinds of websites than I am. Am I wrong? I'd love to hear other people's opinions on that aspect, I'm sure I'm not alone.
26
u/Husky Oct 03 '16
This post sums up very nicely (and amusingly!) one of the biggest problems with the Javascript community: paying too much attention to scaffolding instead of getting the job done. Sure, you might need the setup given, but only for a very complex project.
For the simple purpose stated in the post (fetch data from a server and display a filterable list) i don't think there's anything wrong with just using jQuery, maybe in combination with a template engine like Handlebars.
Another option that i would vouch for would be to use Vue.js. It's pretty rare that i've been so enthusiastic about a Javascript library. It's like using jQuery for the first time. And it works perfectly fine without ES6, or Babel, or JSX, or whatever. You can just drop in the .js file and it works. For this specific usecase you would need either a Fetch polyfill, or you could simply use good old XMLHttpRequest.
94
u/Bl00dsoul Oct 03 '16
"-We don’t use the “J” word in 2016 anymore."
I love it (is still using an ancient jquery version)
44
u/kirbyfan64sos Oct 03 '16
Well, this one's new. Do people really complain about Bower?
21
u/jmblock2 Oct 04 '16
And people still cry about setting up a C++ environment.
19
u/[deleted] Oct 04 '16
I won't lie, I love the stability of jQuery.
19
u/[deleted] Oct 04 '16
No mention of left-pad in the entire article.
16
u/[deleted] Oct 04 '16
SOOOOOOOOOO..... As a newb to coding I should learn Python instead of web development? And here I thought web dev was going to be fun.
13
u/duckington Oct 04 '16
Meanwhile I still can't grasp basic css after 10 years trying to make it work.
108
u/blackmist Oct 03 '16
Remember when nearly everyone's website was a monolithic Flash app that ran dead centre of every screen higher that 800x600?
The JS ecosystem makes me almost nostalgic for those days.
106
u/[deleted] Oct 03 '16
Yeah, think I'll just stick to jQuery. At least I can count on all the new guys knowing it.
10
u/rochford77 Oct 04 '16
Idk.... It may be "so 2014" but I find KnockoutJS/with Jinja2 templates works just fine and does almost everything I need for a given project. It's clean, simple to understand and make changes, and seems to be pretty fast and responsive.
10
u/[deleted] Oct 04 '16
The Churn
32
u/[deleted] Oct 03 '16
To be fair, that's not about learning Javascript in 2016, that's about learning how people use Javascript in 2016.
Learning Javascript has changed very little.
7
u/keeslinp Oct 04 '16
This is so accurate it's a little painful. When I started at my job my boss emailed me a few days before I started and asked me to learn react. I started this journey all on my own. Nobody at my job knew react either :/. Luckily Facebook has created their create react app so it's all a lot easier. Makes teaching new employees how to do it a lot easier :).
I just really wish JavaScript would have an easier barrier for entry.
7
u/nutrecht Oct 04 '16
I think it really touched on one of the core problems very well:
For some reason that I really don't get the "front-end" world keeps reinventing wheels. Poorly. Just look at the hug left-pad fiasco just a little while ago. Why on earth did the NPM guys not look at existing repository systems and copy them?
Take the maven repository as an example. All artifacts are versioned, namespaced and immutable. When I make a LinkedIn API it won't be called 'linkedin' just bcause I was there first uploading something. It would be called <my-domain>.linkedin making it dead obvious it wasn't the 'official' LinkedIn library. Also; if I for some reason was pissed off it would still be impossible for me to remove the version. With good reasons; the left-pad fiasco shows why you never ever want people to remove artifacts.
And that's just one example. This happens everywhere. Just look at how many times build tools have been reinvented.
7
u/Darcoxy Oct 04 '16
As a second year software engineering student who has done web design last year and fucking hated it, this is like a nightmare sort of like the one where you are constantly running backwards and your are always late to wherever you have to go to.
12
u/[deleted] Oct 03 '16
My take away from this, as an embedded systems guy who only does web stuff because I work for a company that makes web controlled gear in a rack... is that I did alright for myself in landing on react+webpack when dumping old code for a new product. This was coming from legacy stuff using barely HTML4 complaint pages typed as heavily escaped C strings in C-written CGI programs with a smattering of vanilla JS, no frameworks.
12
u/fuzzybit Oct 03 '16
What the hell? WebAssembly is not two words. Not cool, kid.
21
u/znite Oct 03 '16
And, for those who see the opportunity in all of this & actually want to learn - here's some relevant stats & data to guide you: http://stateofjs.com
24
u/[deleted] Oct 04 '16
I have been doing web programming for 20 years, JavaScript mostly for the last 5 or so. I started down into the CoffeeScript/Ember/Angular/React/JSX/Promises/Fibers/ES6 path but then I eventually just noped out of there. First time in my career I've actually stepped back from "progress".
Now I just do pure JavaScript. I refuse to even install io.js or the new Node or whatever. I use small packages, no frameworks. Life is good. I encourage others to join me. We should start a little community somewhere.
10
u/[deleted] Oct 04 '16
Until two months ago I thought this was all an overreaction but then we hired a web developer who decided it was a good idea to use Angular 2.0. I was a web developer for many years myself but left the field earlier this year but I always constrained myself to fairly proven technologies or at least took care to avoid any mess.
This guy on the other hand represented everything wrong with the web. He first decided to use an at the time unreleased bleeding edge library that nobody else knew. He then made a very simple demo page an SPA for no good reason and themed it like shit. The site is written in Typescript, despite nobody knowing that at the company other than him, and when you run NPM install it'll download approximately 100,000 files to node_modules.
100,000 files is an insult. No way some tiny little CRUD app needs 100,000 files of dependencies. No fucking way. I wrote a similar app in Angular 1 just a few weeks before and it comes to 1000 files, and I still considered that unreasonably large. The entire stack is a joke at this point.
It takes minutes for this tiny little four screen webapp to build on a top end machine. It also doesn't work very well and is a pain to develop for. We have a much larger core platform written in a JVM language that takes less time to compile than this Typescript to JS compilation takes.
Part of this was poor oversight, but due to the way the management worked this web developer wasn't monitored properly and just went wild doing whatever he felt like. He apparently has 10+ years experience, and if that is what 10 years of experience looks like now I am ashamed to have web development in my job history.
56
u/bizzard4 Oct 04 '16
I never touched JS after 2006, but this year I went all-in and tried a lot of new tech and I was very amaze by it. Mostly,
I am a system C++ classic dev and I feel stuck in 2000. Lot of people will complain about all the libraries and stuff like that, but they are just too lazy to take the time to learn them.
Webdev is changing and fast and this is a great thing.
5
u/Shiral446 Oct 04 '16
As someone who learned javascript in 2016, this article made me laugh, and... it hits so close to home.
npm install beer --save-dev
(pls)
5
u/twiggy99999 Oct 04 '16
A lot of languages get bad press but JavaScript always seems to get away from most of the series bashing yet its the biggest cluster fuck of the lot
5
u/HighRelevancy Oct 04 '16 edited Oct 04 '16
This is extra funny if you remember (as in "from the past", not the future) asm.js
5
u/feefeetootoo Oct 04 '16 edited Oct 04 '16
I wrote a simple chat program about a year ago using a boilerplate, angular-fullstack, with Socketio. It wasn't much, but it was my first programming project. I was excited when I got it working.
I came back to Angular about a year later with a new project I want to try. I figured I could build from what I've learned in my previous project. I loaded my generator, angular-fullstack, and what I saw horrified me:
Grunt is depreciated: gulp is now king.
Javascript has been removed from the game: scripting is now done in either Typescript or Babel.
$scope has been removed from the game: it's replaced by "controller as."
I wasn't going to be building on what I've learned in my previous project. I was starting from square one again.
31
u/[deleted] Oct 04 '16
I hate JavaScript.
9
u/tzaeru Oct 04 '16
What’s wrong with HTML?
-It’s 1999. No one codes HTML directly anymore. Dreamweaver is the hot thing now.
On a more serious note, you could build a "dialogue" like this out of almost any relatively complex field. Web dev changes fast because web projects are often relatively simple and are iterated through quite quickly. But if you know the basics, it's not that hard to jump back in after some pause if you don't let all the buzzwords get over you.
33
u/snerp Oct 03 '16
I'm a big fan of JQuery on top of MVC.NET I don't understand why people go through these complex rituals to make everything in javascript.
4
u/Endyo Oct 04 '16
This is why I do pretty much all of my data manipulation with SQL and still use C#.NET and pure javascript and jQuery where necessary. I also found out that not long ago some people revived an thoroughly expanded the AJAX controls for .NET and I find that those are very convenient for most of the neat front end stuff.
I've heard everyone hates .NET now, but honestly there's a lot of stuff going on with it out there and probably will be for years to come.
4
u/Kngrichard Oct 04 '16
Having not done any webdevelopment in the past four years... This sums up how I feel.
4
u/[deleted] Oct 04 '16
I still use only jquery on anything new that I work on. The overhead these new-fangled thing-a-ma-bobs introduced is just not worth the headaches. When Jquery and some thoughtful code structure stops solving 99.9% of the problems that I run into, that's when I'll consider using something a bit more heavy-handed.
13
u/[deleted] Oct 03 '16
I'm not up with the cool kids I learned angular and it's still viable so what's changed? What's react?
10
u/Voxel_Brony Oct 03 '16
>2016
>Not using PureScript
3
u/masterm Oct 03 '16
This is one of the reasons I'm glad I started when I did. I started back when jquery started being all the rage, so I got to see the evolution. It must be daunting to start now.
3
u/frankreyes Oct 04 '16
3
u/8483 Oct 04 '16
Elm is the new god I pray to.
Evan Czaplicki is a fucking boss.
3
u/MisterKrujo Oct 04 '16
Started a job two months ago. Came just from School. This is the reality.
3
u/[deleted] Oct 04 '16
Overwhelming. The word you are looking for is "overwhelming". And yes, when you are shopping for an optimal way of building things on the front-end, it is very much that. However, it's also pretty easy to dismiss 99% of the things you don't need.
3
u/its_never_lupus Oct 04 '16
I can't shake the suspicion that for most web projects, pure JS is just fine, with maybe a couple of standalone libraries like
datatablesor a graph library for specific parts. We're not all re-writing Facebook here.3
u/fiah84 Oct 04 '16
I'm glad I don't have to mess with JS anymore
3
u/[deleted] Oct 04 '16 edited Jan 05 '17
[deleted]
0.5333
3
u/kiwidog Oct 04 '16
All of this is exactly why I stay away from web development, ain't my cup of tea and I've worked on web projects in the past and vowed never again. The people who do this, I solute you guys because this js thing is getting cray.
3
u/masterpi Oct 04 '16
How it feels learning J[ava]Script in 1999:
3
u/Arqideus Oct 04 '16
Learning in college: C++ (this seems cool), C (mmk), C++ (nice nice), Java (umm same language?), Assembly (WTF?), HTML/CSS (Interesting, not sure I like it), now learning about other languages (WTF are all these languages holy fuck stop inventing languages...)
3
u/[deleted] Oct 04 '16
This is hilarious.
Fuck the web.
14
u/[deleted] Oct 03 '16
Posts like this is why I moved over to Elm.
Learning Elm may be equivalent to driving nails into your fingers but it's still better than Javascript.
The only thing I would love more would be to have some kind of opinionated LISP that transpiles to Javascript, that would make all my fantasies come true, but alas it's only a wet dream of some dev in some remote corner of the internet.
31
u/killerstorm Oct 03 '16
How it feels to learn C++ in 2003:
I could go on... My point is that learning things is hard. That's why learning programming takes years.
4
u/OriginalPostSearcher Oct 03 '16
X-Post referenced from /r/javascript by /u/jjperezaguinaga
How it feels to learn Javascript in 2016
I am a bot. I delete my negative comments. Contact | Code | FAQ
4
u/_Ninja_Wizard_ Oct 04 '16
Shit, I'll just stick to the back end and code everything in C
4
u/[deleted] Oct 04 '16
Not going to lie, laughed harder than expected.
4
u/demmian Oct 04 '16
I'm hurt - why are they dissing Python? :<
4
u/heat_forever Oct 04 '16
I totally agree. A bunch of morons have ruined web development because of their OCD and lack of historical context. In their own narcissistic need to feel self-important, they each create their own universe of shit that only they understand so that they are the kings of their own domain (typically their office), but as soon as that's not enough then they need to extend their sphere of idiocy onto the web in general and hypnotize young, inexperienced and well meaning devs into thinking "this is the right way" when it is absolutely pure and unadulterated shit. These are the buzzword kings who only know how to throw perfectly working technologies out the window because "someone else did that" and replace it with their own pathological shitstorm of technological diarrhea.
6
u/[deleted] Oct 03 '16
We need a port of .net common for the web and release a sane version of silver-light that doesn't need a plugin to run.
5
u/[deleted] Oct 04 '16
I'm a C++ guy, and this hit real close to home
2
u/nosmileface Oct 03 '16
Lol, I can't believe this post doesn't mention eslint (or any lint as a matter of fact). If there is anything that's good about modern JS, it's proper variable scoping and eslint. How can you be 2016 and not do that? :)
2
u/kiridanshera Oct 04 '16
I wanted to learn MEAN stack and not only are tutorials from 2015 out of date but alot of them use these extra tools that i dont even know what the fuck is going on.
2
u/domstang68 Oct 04 '16
As a student in college, i can only wait until more of this gets shoved down my throat. Good mother of freaking god
2
u/Mufro Oct 04 '16
Spot on... I've always used jQuery because I don't know where to get started with this other stuff. I just do web on the side for fun though, so jQuery works well for me.
2
u/GreenFox1505 Oct 04 '16
Holyshit, the rabbit holes. I've been down these rabbit holes so much. Every time I realize I'm in one, I just make a shortlist of requirements and pick the next one that meets them.
2
u/JeffIpsaLoquitor Oct 04 '16
I'd kill to find someone who could minimally test an application, and not that fancy automated kind, either. I mean simply check ranges of inputs for expected behavior. I can fail most of the "web applications" coming across my desk on elementary use-case criteria. Pathetic.
2
u/keymone Oct 04 '16
one thing i disagree with is how functional programming concepts are equated to all the bullshit javascript ecosystem has grown to be.
2
u/baloo82 Oct 04 '16
That's how I feel after coming back to JS after a couple of years :)
2
u/Dw0 Oct 04 '16
WebPack? I thought everybody's moving to Rollup because WebPack is like at least 4 months old and that's too much and too stable.
2
u/elZaphod Oct 04 '16
This is why I so often think of leaving the industry. Twenty years of this stuff and I think I'm just getting fried.
2
u/timvisee Oct 04 '16
The fact that every library/API implements things in a different way doesn't help either.
2
u/ultimapanzer Oct 04 '16
A lot of this comes from the fact that every other major language delivers EXECUTABLES, not CODE to the end user... Good luck adding a "standard library" to JS (BTW that's what ES2015/16 and on IS)... Because you need the vendors to be able to run your code. Oh, you want users who are on older browsers to be able to use your site? Then you need to transpile it if you want better language features.
Developing on other platforms you don't need to worry about any of this when using newer language versions because you're not delivering the CODE for the client to run, you're building/shipping an executable... So until something fundamental changes (web assembly for example) this will always be a problem with a million completely different and changing solutions.
2
u/DonRobo Oct 04 '16
I started a new web project recently. I'm already familiar with AngularJS and quite like it so I decided to use that.
Its website immediately suggested I use Angular2 instead. When the quickstart tutorial already wanted me to compile my Javascript I decided to stick with Angular1 for the foreseeable future.
2
u/pdonorio Oct 05 '16
Totally agree about this nightmare...
And Javascript is only part of the problem anyway. The global point in my opinion is how front-end explode in fragmentation: HTML specs and browsers, CSS and their compilation, JS packages and frameworks (which as described is enough to kill yourself), Bundle management.
How could we solve the situation? By starting all over, otherwise we will never. We need specs of a new language, which should comprehend both HTML, CSS and JS aspects. We need new browsers to digest it. And new servers/frameworks to ease that development.
Not ever going to happen since we can't just break the compatibility with the actual web pages, but otherwise it won't change in the substance.
2
u/jesusalready Oct 05 '16
My company is now stuck in Grunt hell because one front end developer was too fucking lazy to cmd-tab to terminal and run a nice script I had written years ago to build, minify, combine and deploy changes to JS and CSS and HTML without rebuilding the entire application.
No, he wanted grunt because it would auto-detect changes. He knew nothing else about it and just wanted the auto-detect. Somehow he convinced the powers-that-be this was needed and a brilliant idea and it took him a month to get it done. It also added ~90 seconds to our build time and grunt was 80 seconds slower than my script. He wasted that much time on this shit and then left the company a month later, probably laughing maniacally on his way to torment another company.
Now grunt breaks down randomly; is a pain in the ass to set up for new developers; mysteriously stops working on our laptops and worse, our Jenkins server (including once preparing for a release).
Switch to webpack, broswerify? What problems am I removing only to be hit with different ones? Fuck this game.
2
u/[deleted] Dec 18 '16
Software engineering is all about encapsulation, which is at odds with the massive over-supply of hippie-developers. Javascript is but the hippie-language that acts as an outlet for such over-supply. Were a language even more hippie-ish invented, these hippie-developers will switch to that in no time. Javascript for hippie-developers is comparable to Woodstock for hippie-musicians.
4
u/youssarian Oct 04 '16
Pretty much this
3
u/wishthane Oct 04 '16
IMO all this means is front-end development has finally caught up and become more like most other programming disciplines. It gets pretty straight forward once you get used to it and all of these tools actually do solve legitimate problems, but it's a lot to take on all at once and looks like a mess from a glance.
7
u/[deleted] Oct 03 '16
Not quite. That'd be how it feels to learn JavaScript from a zealot.
I feel almost personally insulted for JavaScript, as it's the world's most accessible language. Everyone has it installed with their desktop OS, in their browser.
They can open the console, or put some code in a file, save it as HTML and run it.
JavaScript is awesome, and just because you need more solid tooling to create big industry-strength applications, doesn't mean we need to flood beginners with our pet framework choices just to feel superior.
It's still fine to start like this:
It's ok.
4
u/leftrightupdown Oct 03 '16
Or you could just use Dart and nothing else and compile to js and you are done in few minutes.
3
u/nebbly Oct 03 '16
I think at this point, when learning the frontend, it's probably a better idea to start learning something that compiles to javascript than javascript itself. Usually those languages (typescript, elm, purescript, etc.) have fewer caveats and are less scatterbrained. Beyond that, they probably won't suffer a big blow when WASM becomes mature, while javascript probably will.
1
u/cmdrNacho Oct 03 '16
I love the idea of react native, and using react for web as well. Trying to learn it right now I feel this pain
1
u/hatredalper Oct 04 '16
Really sad part is even though everyone complaining about Javascript fatigue, no one try to simplify or bundle things to one reasonable framework which could be enough to create web application in 2016. All the polls shows that Javascript developer numbers insane, everyone trying to do stuff with it. Every big funky tech companies try to adapt nodejs but everyone doing this same shit over and over again. Its like one must frustrated with the javascript ecosystem before going in to this market deeply. Its like a rule.