49 points · by nielmalhotra · 11y ago · 59 comments
It would be nice if there was a Rails of javascript, but there seems to be a lot of competing technologies. Obviously, you can learn new things at a new job, but it would still be better to learn something with a lot of adoption. I'm thinking a MEEN stack (using ember instead of angular) or even using react and flux. Meteor is another choice, but I'm not sure how widely adopted it is. I think it would be best for him to pick one stack and master it well before moving on.
It's annoying because, when it comes to Rails, I know exactly what skills a beginner needs to learn. Does anyone know what the more successful js bootcamps like hack reactor teach? Or do you have any advice on a good stack for a prospective full stack js developer to learn?
After doing a small project with backbone, other frameworks like react + flux / angular or ember will be easier to pick up, and the tradeoffs they make will be easier to understand.
Then I would suggest building a project with jQuery. It has been around for years. Any seasoned JavaScript programmer will have encountered a project that was based on jQuery. It will also help you understand the motivations behind the creation of the more recent frameworks: React, Angular, etc.
So if anyone's reading this and feeling bad that they don't feel like doing that, just dive in and do something fun. The longer you spend learning, the more likely you are to pick up all of those important details anyway.
But it's not that bad when you have someone behind you, helping you when really needed, and showing you what you can achieve afterwards.
Jumping into JQuery, copy/pasting snippets from google and such won't (well, not often anyway) bring novices very far. Plus, they'll have a hard time learning other frameworks if needed (new job, etc.).
Example of first week complexity: make a choose-your-own-adventure player from a list of {id="sec01", text:"..", links:[{'Continue':'sec02'}, ]}s.
Second week: Wrap the chrome speech API[1] to produce a "game editor" for the above format.
Third week: make a youtube playlist editor that plays a list of time intervals from youtube videos: [{'tStart':0, 'tStop':451.3, 'url':'utube/URL'}, {..}, {..}, ... ]
It's just "toys," but they're immediately useful. In general I think ''file://localhost'' development of .js is a good place to start because of the immediate feedback---it either works or it doesn't.
@nielmalhotra One thing you can tell ur friend is that everyone is a beginner with the most of the modern APIs. So by reading the docs and trying things out he's already a "research level" web dev ;)
- http://www.codecademy.com/en/tracks/javascript
(I haven't used any of them, but these are the ones that I've heard about)
I just wrapped up the one for Hapi.js which was slightly out of date in NPM (the source on Github does seem up-to-date).
I'd like to add also that a simpler approach is often the best choice for experts as well. The big complex frameworks simply are not the right tool for many (perhaps even most) projects.
Personally I am into React/Flux lately but that's because I like doing things at a bit lower level, with more control. Note, lower level doesn't mean better.
I'm not saying this is the "ideal" front end stack (because that has yet to be created) but a good simple starting point IMO would be backbone + react. Very simple, flexible introduction to concepts like router, functional reactive, and components.
Backbone is not needed with React and although it is possible for them to be together (hell, we lived React+Backbone for almost a year), everything gets so much nicer when you can finally drop Backbone baggage.
It might be possible though that in order to see where Flux shines, one has to sweat through limitations of Backbone. That may be valuable experience.
For the backend I would stick with Rails. I see no benefit of moving to Node for a general application when you already know Rails.
Ember, Ember Data and Rails works incredibly well together.
1. Start with vanilla JavaScript/DOM and try to make a small app with that. You'll learn encapsulating DOM into some kind of DIY views, and browser APIs such as pushstate, requestAnimationFrame, etc. This is an essential step.
2. (Optional) Try a classic MVC framework, simpler is better. Backbone is very basic and might be a good idea as middle step. Refactor your simple app to use Backbone views and models. Learn the hard way about their shortcomings.
3. Learn React and Flux (any flavor). Throw Backbone away. Ditch imperative DOM updates, learn top-down data flow. Even if you don't stick with React, other frameworks (e.g. Ember) are starting to embrace top-down data flow, and it's an essential concept that simplifies webdev so much.
4. (If you really feel like it) Try some Angular. This will help you see why one-way bindings, no templates, no direct DOM manipulation and minimal API surface rock over other approaches.
5. (If you want to stay on the edge) Try exotic stuff like Cycle.js or Om (or Omniscient.JS if you don't want to leave JS land). These build up on ideas React pioneered, but one uses Observables as primitive and other uses Cursors.
- React: by far the most enjoyable UI tool I've used in a long time. Single-direction data flow is easy to reason about and requires very few new concepts to learn.
- Reflux: have your react components trigger events that update your data store. I find flux to be a little too complicated for my tastes. Reflux removes the need for a dispatcher and just has events and stores.
- Browserify: makes writing modular JavaScript much much easier by using node-style CommonJS imports.
- react-router: react style routes makes structuring your apps routes intuitive.
I've included these tools and more in a starter project I have on github: https://github.com/builtbybig/starter
Another great resource is You Might Not Need jQuery (http://youmightnotneedjquery.com/). Take what you need, leave the bloat behind!
The advice of learn "vanilla javascript" break if your targets (=browsers) are older than, lets say, THIS YEAR.
So, is the interest to do only "modern javascript" aka "this year release of browsers implementation of JS"? or "javascript as understood by, please not! internet explorer 6?".
So "vanilla javascript" is different depending in how much "modern" we are talking about. With truly recent JS, is possible to avoid jquery. If you are only in the server-side, Javascript IS == NODE.
So? No universal version (that could be retrofit to older devices) of JS exist on this earth (and the same apply to CSS3).
Think is like C/C++: The same bloat, pain as experience by the first users at the dawn of it, plus half-baked new shinny things, that are not universally used, and never equally across the board.
So, is very likely you need to learn "real vanilla javascript = as understood in the IE6 era, perhaps some versions up (if lucky) plus "jquery".
You can avoid jquery if use some kind of niche stack, but, jquery IS javascript as "everyone" use it. Think no only in raw use, but, interfacing with libraries and stuff. So, jquery is the "rails" of js, could be argued.
IF you actually have total control on the deployment environment, and on the use of external dependencies, you can SKIP JS and use coffescript, elm, typescript, etc. But you need to be very lucky to be in this position ;)
FWIW, we were working with Sails.js (http://sailsjs.org/), with the intent to getting to use Socket.io, Angular.js, and MongoDB - the setting up of Sails and understanding what things did in Sails ended up being the problem spot.
Instead, I changed my approach to act more like a mentor and have my friend go along the excellent Ruby on Rails Tutorial (https://www.railstutorial.org/). Things have been much better, although my friend has fallen on his face a few times with Git & SSH in general. I now believe a good intro text is worth far more than picking the right framework(s) to learn.
There are a lot of benefits that come from using mainstream existing frameworks and libraries from the beginning. You learn conventions pretty quickly, and immediately learn to write idiomatic code for that language. When you use a major framework or library there are typically a lot of blog posts and stackoverflow answers, more so than just for a language itself. When you track down errors you'll end up learning about how the frameworks and libraries work, and thereby learning about how to implement things you wouldn't have considered independently.
As a result, what I'd recommend is coming up with two extremely simple ideas for tools that he'd find useful for himself and implement one each with Ember and React.
Personally, I've been following this approach for many years (I'm currently simultaneously working on three new projects in multiple new-to-me languages like this) and it works extremely well in my experience.
An essential that might be obvious but in case he missed is that learning JS is much easier in the developer console. If you want to experiment with underscore, go to http://underscorejs.org/, hit cmd-i/f12 and type in _.map([1, 2, 3], function (x) { return x * 2; }); or if you want to understand moment, go to http://momentjs.com and type moment().fromNow(); in the console -- the library objects are available there and this makes it really fast to try things out.
If your friend's a total beginner, though, then it's better to just learn vanilla js for now.
So I don't really know what to tell you, except that you probably have the wrong idea about JavaScript, and so the best recommendation is, as others have said, to work without a framework (other than jQuery, of course) until you understand what JS's role is in web development.
In analogy form, I think his question is:
Ruby::Rails
Javascript::???
http://backbonejs.org/docs/backbone.html
If you don't understand all of that, probably learn more javascript.
After that, you should have enough JS knowledge to start building a client-side app that consumes your API. I honestly prefer AngularJS, but React+Flux seems like a fine choice.
Whatever you're working with will most likely be out of touch with what the job requires and outdated in a year, but the ability to pick up new things is an indefinitely transferable skill.
In addition to not bothering with stacks, I would also advise you not to limit yourself to JS.
Using it to make something stupid definitely won't get you a job, but it's easy to using it will encourage you to use/learn about the cool parts of JavaScript.
When youre more familiar you can roll your own cutting edge framework, maybe use koa, write a yeoman generator, fancy non-relational databases like couchDB. Learning to recite APIs as one comment pointed out will actually help you understand good api design, and give you a working idea of how theyre wired usually, allowing you to ramp up faster on a new framework than if you jut knew vanlla js and individual components. IMO. Sorry for any spelling errors, temporarily on a samsung v1 chromebook, things appear a few seconds after i type and the internet is hard to use while listening to music
It's not something that can be learnt over the weekend and takes time to master.
Just like Rails, it seems to be able to a lot of things by magic and needs some dedicated effort to understand. This article from their blog [2] and this video [3] gives a very good comparison of what Sencha ExtJs covers with respect to other Javascript frameworks.
[1] http://www.sencha.com/products/extjs
[2] http://www.sencha.com/blog/4-questions-to-ask-before-choosin...
Focusing on learning frameworks seems like a good idea for resume-building purposes, but they come and go like fashion. Learn Javascript the language very well first, and then learning the framework du jour will be trivial.
React is probably the best candidate to achieve that simplicity along with Angular, although I would give Angular the edge, simply because it does not rely on tooling to build a small app and still benefits just as well from it when it is present. The documentation, even two years ago, was better than Backbone's at the time (and as far as I can tell from a recent study of Backbone, still is) - Ember's might have been a little better, but it also threw more stuff at you upfront.
The expert can probably work with all of these frameworks just fine - in the end, finding what framework (or no framework) jives with you is the best for your long term development. Become an expert with one, then experiment with others to draw good ideas from them and incorporate it into your code style, that is what separates the good developers from the rest.