4 ms·
There's not much to it. 1) Pick a build tool (gulp, grunt, webpack - if you don't want an option, use webpack). You don't need a build tool but it helps with t
by aaron-lebo 9y ago
There's not much to it.
1) Pick a build tool (gulp, grunt, webpack - if you don't want an option, use webpack). You don't need a build tool but it helps with transpilation and it's a good base for the future.
2) Make or copy/adapt your build tool's config file to use Babel so you can use the latest ES version but compile down to work in browsers. You'll have to Google but these exist all over the place and they aren't confusing.
3) Pick a front end framework. Do you like Vue? It doesn't really matter because they're all doing basically the same thing in slightly different ways (like Rails, Django, Sinatra, Flask, etc).
You're good to go. It's not more difficult than setting up a Python, C, or any other environment, you simply have options. Hell, if you're doing terminal apps, you gotta decide between ncurses, blessed, termbox, raw escape sequences and so on. The JS world really isn't different than anything else.
- omginternets 9y agoI appreciate your help, but it's somewhat comical to note how much your comment resembles this satire: https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f https://hackernoon.com/how-it-feels-to-learn-javascript-in-2... > It's not more difficult than setting up a Python, C, or any other environment, you simply have options It's decidedly more complicated than Python. Being on par with C is hardly appropriate for a dynamic language. To be clear, I really do appreciate the help, and I absolutely will tackle this someday (soon). Still, JavaScript has a serious problem here.
- aaron-lebo 9y agoI understand it's frustrating and the onboarding process is annoying. However, once you've done it yourself, you understand that it's overstated. I can setup a template for a JS project quicker than I can a Python one these days. You have to learn how to do that, yeah (which is the annoying part), but it's not hard, just scary cause without having worked with it, all you see is options.
- deleted 9y ago[deleted]
- jessaustin 9y agoYeah it's easy to start coding in python. Eventually one wants to distribute that code, and then the tears begin.
- omginternets 9y agoThat was true years ago. It's really not the case anymore. Related reading: https://glyph.twistedmatrix.com/2016/08/python-packaging.html https://glyph.twistedmatrix.com/2016/08/python-packaging.htm... More to the point, even if what you said were true, the tooling is still absurdly complicated in the JS world. Your comment is a mix of of a red herring and whataboutism.
- jessaustin 9y agoThanks, I read that last year. This seems telling: There should be tools that help you write and update a setup.py. In my experience, this was always the hardest part. I started using python in 1999, and I never really had any problems setting up dev environments or doing any of the other things that Glyph discusses at length at that link. As I said above, distribution is the difficulty. The javascript "complications" about which some complain at every opportunity are only possible because distribution is so easy. If comparing the pros and cons of two languages in response to another such comparison is "whataboutism", then I have no fucking idea what that term means.
- omginternets 9y ago>If comparing the pros and cons of two languages in response to another such comparison is "whataboutism", then I have no fucking idea what that term means. The issue at hand is not whether Python is superior to JS. Rather, we're talking about a specific problem in the JS world -- the apparent need for tooling and its so-called "dependency hell". Bringing deployment into the conversation is whataboutism.
- SquareWheel 9y agoI know you're trying to be helpful, but I'd like to make clear that if you're a noobie, you don't need any of these tools. Plain Javascript is just fine, especially with the improvements of ES6. Tools are here to solve problems. Don't bother with them until you have that problem yourself. If you one day decide you want to set up things like auto-minification, image compression, CSS-preprocessing, then look into build script options. Otherwise, it'll just overwhelm you.
- aaron-lebo 9y agoYou don't need any of those if you are doing a node project, yeah, but if you want to do any work on the browser, you're gonna need to transpile anyway, so it's something people should be aware of. Plus it's literally a 20 line config file to do so. module.exports = { entry: './src/app.js', output: { path: './bin', filename: 'app.bundle.js', }, module: { loaders: [{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }] } } Include your app.bundle.js file in your webpage and you are good to go.
- nilliams 9y agoSoon with the new webpack-cli, you'll just be able to 'webpack init': https://medium.com/webpack/announcing-the-new-webpack-cli-75ce1d9b8663 https://medium.com/webpack/announcing-the-new-webpack-cli-75...
- _pmf_ 9y ago> Plain Javascript is just fine, especially with the improvements of ES6. With React pushing hard to use JSX and discontinuing the in-browser JSX-to-JS transformation step, this is no longer completely true. You have to introduce the tooling from the start. (Yes, technologically you are not forced to use JSX and can use JS, but this is clearly declared as unwanted in the React ecosystem.)