News for hackers. Stuff that matters.
Re:React/JavaScript fatigue by hoodoof on Sunday December 27, 2015 @11:42PM (#10799905)
The problem is that new and better ways to do things come along (ES2015 versus JS, webpack versus grunt/gulp), but the old ways hang around like a bad smell.

How the heck as a beginner are you meant to fight your way through all the noise of the old, bad ways of doing things? How is a beginner meant to know that really they should be using ES2015 and webpack rather than JS and gulp/grunt? How does a beginner even come to understand that in the reactJS world they might be reading something relevant, but then again they might be reading something completely irrelevant and in compatible (i.e. ES2015 verus JS).

Really when a new technology comes along that is a clear "winner", serious consideration should be given to just getting rid of the "old" way.

Unless Grunt and Gulp are going to somehow make a big comeback, the should be loudly killed off.

Damn - whenever I read the React documentation I have to filter out all the irrelevant code that is not ES2015. Why is all that non-ES2015 code there still?

Old tech should be visibly and loudly killed. No wonder its hard for beginners - its all the damn noise made by the "old" ways of doing things.

The react ecosystem is filled with the living dead - technology that has died but just won't go away.

Things should remain backward compatible but only for a very short window, it's really unhelpful to have many many different ways of doing the same thing, it fragments everything including the learning curve. Witness Perl.

Beginners (and I am one) don't need to be shown every possible way to do things - they need be given a rock solid, opinionated path on the current right way to get the job done. I don't care if that opinionated path changes every month, I just want to not have to work it out by fighting through two years of zombie tech to eventually figure it out.

Re:React/JavaScript fatigue by statictype on Monday December 28, 2015 @12:09AM (#10799972)
Things should remain backward compatible but only for a very short window, it's really unhelpful to have many many different ways of doing the same thing, it fragments everything including the learning curve. Witness Perl.

Sounds like a terrible way to build commercial software.

The problem isn't that old things don't die away quickly - far from it - the problem is that we have too many new things coming in that keep changing every few days.

I'm building a 10k line coffeescript app that works on top of react. All I care about is getting a toolchain to compile the coffeescript and generate source maps.

I don't care about dicking around with npm and node and grunt other than to make the build process work.

Tell me why I should care about grunt or gulp or webpack?

React introduces a massive win over traditional ways of building UIs that makes learning how to write apps with it worth learning. Why should I care about learning grunt and then learning gulp and then learning webpack, when all I'm using it for is to compile my coffeescript?

If I could get away with a Makefile, I probably would.

Re:React/JavaScript fatigue by bphogan on Monday December 28, 2015 @12:31AM (#10800033)
> If I could get away with a Makefile, I probably would.

You kinda can. I'm seriously considering that in conjunction with <http://entrproject.org/> for watching file changes.

I wrote the book Automate With Grunt out of anger at the terrible docs for Grunt and my displeasure that there was yet another build system out there. And just as the book was released, Gulp came along. Then Webpack. And now there's tools like Brunch.

I still use Grunt, because I spent time learning it. And I'll be damned if I'm going to waste time learning a new tool without a really good reason other than "Coke vs Pepsi".

(edited for organization because I'm tired.)

Re:React/JavaScript fatigue by DCoder on Monday December 28, 2015 @02:02AM (#10800234)
Nitpick - Grunt is a task runner, Gulp and Brunch are build tools, Webpack is just a module bundler, it's not a full build tool - it's more a replacement for r.js than for Gulp (and it's remarkably faster than r.js).

After trying out Grunt and Gulp, I found Gulp to be more to my liking because the tasks are written as actual JS code, not as a pile of configuration. Plus, it runs the tasks in parallel if they don't depend on each other, whereas Grunt defaults to running them sequentially.

Re:React/JavaScript fatigue by bphogan on Monday December 28, 2015 @01:42PM (#10802599)
Sure but they all end up being used as a build tool. Webpack may be a module bundler, but it has hot reloading, live reloading, and plugins to transpile. Watch any React tutorial and the first thing they have you do is set up a Webpack config that gives you a live-reloading build system with ES2015. And it's a different one than the one I used 5 months ago.

It's nice that there are people willing to address problems, but it would be nice for web development to grow out of its "oooh shiny" phase.

Re:React/JavaScript fatigue by DCoder on Monday December 28, 2015 @11:24PM (#10805190)
> Watch any React tutorial and the first thing they have you do is set up a Webpack config that gives you a live-reloading build system with ES2015.

To be honest, I prefer learning by reading specs/documentation, tinkering and Google-ing specific bits, not by watching tutorials, so I did not know this. That's not ideal conceptually, but it does mean one less tool in the pipeline, which is not a bad thing for beginners.

> it would be nice for web development to grow out of its "oooh shiny" phase.

Absolutely. Just as long as it doesn't swing to the other extreme, like PHP does, where 12-year-old and deprecated techniques are still entrenched at the top of Google... :)

Re:React/JavaScript fatigue by Scarbutt on Monday December 28, 2015 @12:17AM (#10799996)
Damn - whenever I read the React documentation I have to filter out all the irrelevant code that is not ES2015. Why is all that non-ES2015 code there still?

Because browsers don't fully support ES2015 yet? not everyone wants to use/learn new buggy transpilers, new build tools, add more boilerplate, etc..

Re:React/JavaScript fatigue by reinhardt on Monday December 28, 2015 @03:17AM (#10800378)
> I don't care if that opinionated path changes every month

Good for you, you'll feel right at home because that's exactly what's happening in JS-land, and it's a major reason many of us opt to stay the hell away from such a fad-driven development ecosystem.

Re:React/JavaScript fatigue by tptacek on Sunday December 27, 2015 @11:50PM (#10799927)
Sell me on Webpack, and, in particular, on why I should care about this particular bit of plumbing.
Re:React/JavaScript fatigue by hoodoof on Sunday December 27, 2015 @11:54PM (#10799936)
My (simplistic) understanding is that webpack is more simple than grunt and gulp to configure. Backed up by my observation that most of the most current projects seem to be embracing it - that's enough for me, it's the current winner so it's what I use. I don't have time and I'm not interested in doing a detailed technical analysis - my approach is just to try to understand what technologies are the latest - and on the assumption that they are the latest because they are better, and on the assumption that previous technologies that did the same thing will be superseded - I use them.

You can criticise this approach as just following the trends but I take this approach because it would be stupid to try to understand every single component of the ecosystem and then make my own careful choices - what is everyone else using right now? Probably good enough unless I know some good reason not to use it.

I am a beginner and struggle hard to understand the vast array of tech I need to do reactJS development. It hurts me very badly sometimes and I feel stupid because I don't grasp it all, but I have to get shit built so for the most part I'm just doing what others are doing and as I go I am learning more and more and in areas that I have gained real understanding I then make my own educated decisions about exactly how to do it in the right way.

Re:React/JavaScript fatigue by clessg on Monday December 28, 2015 @12:00AM (#10799949)
> webpack is more simple than grunt and gulp to configure

That's the first time I've heard that one. In my opinion, what makes Webpack great is its raw power and module-based (rather than file-based) focus. Browserify is easy to work with and get started with but less powerful. (Granted, it's quickly catching up.) Webpack is a lot of things, but easy to configure is not one of them.

By the way, Webpack doesn't really replace Grunt or Gulp. It replaces Browserify. That said, if you use Webpack, you can easily get by with npm scripts instead of Grunt/Gulp.

Re:React/JavaScript fatigue by tptacek on Sunday December 27, 2015 @11:56PM (#10799941)
This response sums up something important about the Javascript development community that I cannot put into words.
Re:React/JavaScript fatigue by bpatrianakos on Monday December 28, 2015 @12:39AM (#10800056)
I think it sums up the Beginner Community in general, not the JS community. You see this with beginners in everything.
Re:React/JavaScript fatigue by modarts on Monday December 28, 2015 @12:10AM (#10799978)
You take the struggles of a beginner as an indictment on the broader professional JS development community?
Re:React/JavaScript fatigue by tptacek on Monday December 28, 2015 @11:04AM (#10801733)
It has nothing to do with them being a "beginner".
Re:React/JavaScript fatigue by mbrock on Monday December 28, 2015 @02:41AM (#10800300)
My reaction to your comment is likewise ineffable and mysterious.
Re:React/JavaScript fatigue by amorphid on Monday December 28, 2015 @03:47AM (#10800428)
The JavaScript "community" feels like more a large country.
Re:React/JavaScript fatigue by spicyj on Monday December 28, 2015 @12:12AM (#10799981)
I believe (and hope) this is not representative of the JS community.
Re:React/JavaScript fatigue by isolate on Monday December 28, 2015 @12:20AM (#10800006)
Given that front ends have a huge visual component, it kind of makes sense that developers would approach them like clothing fashion: you don't have to watch the designers to look reasonably good, or even pay attention to construction, you just have to watch everyone else.

Well, at least that's what I picked up from this rather honest opinion.

Re:React/JavaScript fatigue by NDizzle on Monday December 28, 2015 @12:08AM (#10799970)
Don't take this the wrong way - I mean this with the most respect possible.

You shouldn't be recommending software to anyone.

Re:React/JavaScript fatigue by hoodoof on Monday December 28, 2015 @12:18AM (#10800000)
I'm sorry you feel that way.

I know a huge amount about software development and work with a wide range of technologies.

Learning some completely new field like browser based development is best done by just jumping in and trying to make stuff work. You learn along the way and much of it will be unfamiliar. Over time things will become more and more familiar until you start to develop expertise across the entire field.

If you are suggesting that instead I should learn by sitting down for six months in an ivory tower and learn all the theory and function of every part of the software ecosystem that I plan to work with so that I can then take every step of my journey as an expert, then you are misguided.

All software developers live in a fog of ignorance which they work to push back. No one knows everything. The best way to push back the fog of igorance is to start working with the technology to get real stuff done. To do so, it is necessary to make pragmatic decisions such as "well it looks like everyone in this field is using technology X - so that's what I'll use until I know enough to decide otherwise".

Are you someone with a deep knowledge of JS and react development? If yes, did you step in to it as an expert in all things? Did you use things without knowing why? Of course you did. Everyone has to.

Re:React/JavaScript fatigue by zodiac on Monday December 28, 2015 @03:14AM (#10800371)
I completely agree with your characterization of how beginners can feel. That said,

> If you are suggesting that instead I should learn by sitting down for six months in an ivory tower and learn all the theory and function of every part of the software ecosystem

It's not simply a choice between "learn for 6 months" and "use whatever the latest thing is". You seem to be advocating for the later, which I think is just as unworkable a solution as the former. For instance, a nice medium ground would be to read the github README as well as the front-page website of the candidates.

Also, as someone else here pointed out, you can't kill off gulp/grunt even if webpack exists, because webpack is not a task runner, and some people use the task-runner features of gulp to do more than combine modules, etc.

Re:React/JavaScript fatigue by Bahamut on Monday December 28, 2015 @12:51AM (#10800071)
You admitted to being a beginner - a beginner shouldn't be recommending technology choices beyond that a particular choice might help people get started. There is too much a beginner does not know was his/her point.
Re:React/JavaScript fatigue by skrebbel on Monday December 28, 2015 @01:22AM (#10800150)
> You admitted to being a beginner

He said he was a front end JS beginner. He also mentioned being a seasoned software engineer overall.

His advice is completely sound, and a very valid approach: Want to learn a new platform/ecosystem? Take whatever is the most popular and make stuff work. It's the fastest way to learn by far and with an free bonus you get actual valuable software.

Nobody flames people who learn Rails while learning Ruby! What's the matter with you guys?

The only mistake the GP made was "admit" on HN that he's a beginner at something.

Re:React/JavaScript fatigue by hakanderyal on Monday December 28, 2015 @03:04AM (#10800355)
From my limited POV, this is how I see most of the newcomers to JS community currently behaves. And it's a good example of 'learning by doing', which is the advice that everyone gives around here.

- Do some research, look what successful/smart/sane people are using/working on, and why.

- Jump in, hack stuff, make things work.

- Learn while creating. Discover the insights behind the choices that people you're following made.

- Start making your own informed choices.

As long as you're not stuck in the step 2, and advance beyond doing what everyone is doing, you're probably on the right track.

That's how I learned to build maintainable/scalable/successful applications.

It worked out perfectly for me.

Edit: typo, clarified first sentence.

Re:React/JavaScript fatigue by spicyj on Monday December 28, 2015 @12:01AM (#10799951)
I am not sure why the parent compares webpack to gulp/grunt. The latter are generalized task runners (think "make"), but the former is a tool for bundling together many small JS files into one.

Webpack (and browserify, a competitor that's very similar) bring you a module system so that dependencies are explicit with a require() call and you don't have a global namespace with hundreds of objects. JS doesn't have any such system built in. Packaging it into one file in the end, which they do, is necessary for performance so you don't make hundreds of network requests.

Re:React/JavaScript fatigue by gedy on Monday December 28, 2015 @02:06AM (#10800244)
I think it's due to Webpack replacing/eliminating much of what we used to do "manually" in Grunt/Gulp such as transpiling, building, combining, etc.

In most of my projects, I no longer needed Grunt for anything aside from deploying to production, etc.

Re:React/JavaScript fatigue by carbocation on Monday December 28, 2015 @12:07AM (#10799966)
Bundling JS files into one big file is obviated by http2.
Re:React/JavaScript fatigue by spicyj on Monday December 28, 2015 @12:09AM (#10799973)
You still have the round-trip time for each level of dependencies if they're resolved on the client, at the very least. And a real-world performance comparison where the recursive dependencies are listed up front but sent in separate requests shows unbundling losing:

http://engineering.khanacademy.org/posts/js-packaging-http2....

Re:React/JavaScript fatigue by peterhunt on Sunday December 27, 2015 @11:59PM (#10799944)
In order to be sold on webpack you need to understand the stack of problems it solves. I tried to do this during a talk last year; the relevant part is https://youtu.be/VkTCL6Nqm6Y?t=9m39s
Re:React/JavaScript fatigue by sandGorgon on Monday December 28, 2015 @12:38AM (#10800053)
What do you think about jspm and systemjs - the way it separates front end vs back end dependencies and generates a config.js was very nifty.
Re:React/JavaScript fatigue by peterhunt on Monday December 28, 2015 @01:26AM (#10800164)
Haven't used it, but I don't believe it has code splitting?
Re:React/JavaScript fatigue by fenomas on Monday December 28, 2015 @03:38AM (#10800415)
Webpack isn't really plumbing like a task runner, it's primarily a dependency wrangler. If you have a page template, which declares dependencies on various partials, each of which declares dependencies on images and JS modules and CSS partials, then Webpack can grok all those dependencies and do things like bundling the images/JS/CSS needed for this or that subset of pages (along with hot loading, source maps, etc.).

Of course, it can also do stuff like minification and transpilation while it does this, so it tends to get compared to grunt/etc. But the magic of webpack isn't the bundling, it's that you can build highly modular pieces of web content and leave webpack to work out what needs bundling.

Re:React/JavaScript fatigue by leo_mck on Monday December 28, 2015 @12:14AM (#10799987)
I do not think any way of doing things should be killed. People should educate themselves to be able to choose the tool they feel comfortable to do what they need. It is simply as that. If the old tools work and you like them, use them. If you are a beginner and do not know what tools you should use it is your problem. I agree that the things could be better but I think that this idea of making everything super easy for beginners is not a thing we should always focus first. I do not meant to sound harsh but I do not know if things could be much better considering all the things happening with JS on the last years.
Re:React/JavaScript fatigue by ocean3 on Monday December 28, 2015 @12:22AM (#10800015)
Why not just npm scripts instead of webpack/grunt/gulp?
Re:React/JavaScript fatigue by Tankenstein on Monday December 28, 2015 @12:38PM (#10802235)
Because just bash would be insane to get the features of something like webpack or gulp.