Hacker News new | ask | show | jobs
by 1235971235 4032 days ago
Created an account for this post only.

As a novice javascript programmer, I am hugely confused by the variety of tools being recommended on Hacker News. Choosing and setting up tooling was harder than writing my first app in React. Not a new complaint, I know, but:

Is there anything like a best practice in modern javascript development that someone can point me to? Or is there a site that gathers the setups used by prominent front-end developers? Thanks for any advice.

4 comments

Welcome to hell.

The relentless creation of new javascript frameworks never ceases to amaze. They're all over the place and every one of them claims to be a magic bullet.

My recommendation would be to choose one that is extremely stable that underlies a lot of the core principles of other systems. Backbone comes to mind because it's fairly unopinionated about how the system should be built - this makes you understand how data can be tied together, how systems can be structured (because you have to make your own choices) and which ones seems to make the most sense to you. Couple that with something like react and I, personally, think that you've covered a lot of the front-end principles.

http://yeoman.io/ is a popular flow that's much more plug and play than writing your own gruntfiles/gulpfiles.

There are few best practices, and the ones we have aren't explicitly stated in one universally agreed upon place.

My advice to you is this:

1. Focus on learning Javascript firs and foremost. Kyle Simpson's "You Don't Know JS" series is amazing: https://github.com/getify/You-Dont-Know-JS

2. Best practices are hard to come by, they essentially are: Crockford's Javascript The Good Parts, The Mozilla JS docs, and some styleguides on Github. Also lint your code through JSLint or JSHint.

3. Don't worry about build tools like Brunch, Gulp, Grunt etc. unless your job forces you to use one. If you're building small sites and apps, you won't need one.

4. When it's time to use a Framework, pick one and stick to it until you know it quite well. Frameworks are very different from one another. Backbone, Angular and Meteor.js are all quite different, but in the end they all do one thing, serve a web app.

To paraphrase Michael Pollan: Write Javascript, not too much, mostly frameworkless.

I sympathize with trying to keep up with tools. I also sympathize with users who don't care about fancy interfaces nearly as much as they care about the information they're looking for. Load times and sluggish UI are killing the web relative to native mobile apps. We're offloading too much of the time-cost to users.

I won't make web apps any more. I use Javascript to add a little bit of ease to website functions, and I can do that with raw Javascript and if it gets complicated, jQuery.

I'm an experienced web developer but most of my projects were started a decade ago. I decided to use all modern tools and techniques for a very small (think two database tables) application. It had to work on mobile and have a good UI.

And on my god, the tools, so many tools. And so much boilerplate. And so much plumbing. I've spent only 50% of my time so far doing actual coding and the remaining 50% configuring tools, pulling down packages, pulling down tools which install other packages, and so on.

Now I will fully admit, the tools are very cool and the results are good but it still feels a bit ridiculous.

I feel your pain; try this starter project I created in response https://github.com/mindeavor/node-catapult . It only has three dependencies, yet it gives you a starting point to "npm install" in any direction you need (in the front end too, since browserify lets you require npm modules).