No. Not this. Net even close to this. Let me illustrate:
How to become great at Sports:
- Read books about sports.
- Watch other people play sports.
- Read in-depth analysis of past sports games.
How to become great at Playing Violin:
- Read books about playing violin.
- Real sheet music by the great masters.
- Listen to many concerts.
It's inherently obvious that the above approaches are totally and completely wrong. How do you become good at anything? You practice it. You do it. You have a coach or teacher or mentor who can give you pointers, but lets you make mistakes. You have someone who lets you get things wrong the first time, so that you can see the consequences.
There is a time and place for theory, for reading, for analysis, and this is too part of the learning process, but this is not at all the most important tool for becoming great at something.
Theory, analysis, critique, history, and context all matter when learning any skill, but first, you must build the fundamentals. First, you must do the thing and once you reach a level where you really understand the thing, then and only then can you begin the more introspective task of theory and analysis. Even without these steps, the best way of becoming great is to DO.
I don't think that's actually the best way to be great at chess, or math.
On chess, from a GM: "The key to their success is that they kept playing a lot, and learning from stronger opponents. Don't get me wrong: I am not suggesting stone age technologies in studying. Of course, you should take advantage of the best modern learning methods. However, the most important component of success (at least at weak GM and below level) is practice."
Any great chess player (let's define that as near-IM fide ratings and up) will tell you that it's a highly iterative process between practice, analysis and reading that is very much anchored around practice.
They play thousands and thousands of hours and, yes, also spend quite a bit of time reading, thinking, analyzing (both their own and others') games and learning from mentors/teachers. However, practice is king and all the reading/analysis would be worthless in its absence. They would have no anchors to grab onto in your brain - no way to really become operational.
A chess "player" that mostly reads, studies and analyzes with a little bit of practice sprinkled in between would indeed be hilariously weak.
Reading, watching and in depth analysis might be necessary conditions for true greatness but they do not constitute the biggest part of improvement/greatness.
The biggest part is the ability to move a large part of the necessary skillset to your unconscious mind. As a joke Capablanca said "I only see one move ahead, but it is always the best one", this is how every strong chess player thinks, they can instantly evaluate the position. It is just like once you have learned to drive well, you would recognize a potentially dangerous situation(a child playing with a ball on a sidewalk) without actually thinking about it consciously.
I believe this is how the best programmers work too, they have an immediate grasp of possible techniques they can apply without necessarily thinking about them or looking them up in google.
You become great at your craft when you internalize/obtain unconscious mastery of a large number of techniques in your craft. You become truly great when you can combine these techniques in novel ways.
I will mostly speak about chess, because I am an average programmer and average mathematician but am a pretty good chess player near IM strength FM (2350) and have spoken to various strong chess players (up to 2700) on this subject.
There have been players who have become very strong with very little reading (GM Flohr is a famous example from 1930s) but with a lot of playing, however I am not aware of anyone who become good without practice.
So let's start with a simple example. You must absolutely learn how the pieces move, this would be equivalent to what loops and conditionals are in a programming language. If you have to think how the horsie jumps when playing, you are not going to get very far.
A more complicated example, it is very useful to be aware of the standard h7/h2 sacrifice. As you get stronger, you develop a better sense on when this sacrifice will be strong and when it will be likely fail, even before starting to calculate consciously.
How do you obtain this knowledge, the best way is iterative by playing and applying in practice what you learned.
Dunno about chess, but when it comes to doing original pure math research, bookwork is necessary but not sufficient. Practice is also necessary, and lots of it. Even when it comes to reading math textbooks, the exercises are the most important part.
There is a saying in coaching: "practice does not make perfect. Only perfect practice makes perfect."
What that means is that the point of practice is to reset habits to the best possible technique, so that when the athlete is under duress, they are habitually as efficient/effective as possible. Any practice done with poor technique is basically wasted time, and potentially counterproductive. This is true at any point in the athlete's development, from day one to just before the title game (or match or whatever).
So, just writing a lot of javascript will not make someone a great javascript developer. If they write a lot of crappy code, they will become an experienced, crappy developer.
The best way to achieve greatness is to have a great coach (or teacher, or mentor). That person can help one shortcut to the best technique, and they can catch and correct one when one strays from that.
But if one does not have that, then disciplined self-study of known great performers is an ok substitute.
And, when it comes to "how to become great" articles, I think the writer usually assumes that the reader is already somewhat engaged--that their target audience is already writing javascript but wants to get better at it.
It continually amazes me that programming books are as popular as they are. I can't think of a format I'd prefer less than static text when it comes to learning new programming languages.
Much better to just jump in and start figuring things out. Google your questions, find Stack Overflow questions. Fiddle with CodePen (etc) examples to see what variables and functions do what. Once you're well versed, read the occasional blog post about emerging techniques and patterns.
I work in JS day in, day out, and this approach hasn't seen me wrong. But we're all different.
Because they have the depth of experience that is otherwise unavailable except by months or years of hard-fought struggle.
It only takes being bitten a few times by rushing into a new tech and doing everything completely wrong from the start. The smart learn from their own mistakes, but the truly wise learn from others'.
Books are about communicating experiences. A great book can give you the knowledge it would take years to get by personal experience alone. If anything, people involved in programming don't read nearly enough. We have giants on whose shoulders we should be standing, and instead we just retrace their footsteps. We need to stop ignoring our past.
Obviously, practice is also critical, but my point is most people who love to program love the act of programming, so they obviously already do a lot of that.
In my opinion programming is a linguistic skill. A more apt analogy is trying to learn French by reading textbooks on learning French. I spent 5 years teaching English as a foreign language and I can tell you that learning a language from textbooks will not allow you to be "good" at the language when compared to the fluency and proficiency of a native speaker. You will certainly be able to accomplish various tasks and to get your message across to others, but you don't really have a hope of being a "good" speaker or writer of the language compared to even the average child. Your language will be full of tortured constructions that are (hopefully) grammatically legal but idiomatically terrible.
I hope this situation seems familiar to programmers because we see it every day -- programmers who write code that "works", but is tortured in its design. We can see people who can not express themselves in code because they are not fluent enough to do so. We can see people who can not understand common idioms because they never have read other people's code (in quantity). They ivent their own idioms, just like baby talk, and often decide that their baby talk is superior to the living language around them.
The biggest difference between a human language and a computer language is that most people aren't exposed to incredibly fluent users of the language in great quantity. It is really easy to fool yourself into thinking that you are a great programmer, when actually you can just barely make the code work. The same happens very frequently to learners of a foreign language that are rarely exposed to native speakers. You have no yardstick to measure your progress other than your textbooks.
Although I agree with your assesment that you must DO, but even more so you need to seek out communities of fluent users of the language and interact with them. That means reading their code, writing code, having them correct it, etc, etc.
A professional software engineer should be regularly reading to keep up with their craft. It's a balance, and one that I've generally noticed is tipped away from focused reading/learning because the modern Stack Overflow-driven world nudges people to "just do it." Telling people "you should read a lot of books" shouldn't be necessary, but nowadays it is.
In one of my recent interviews, I was asked how do I learn a new language. I rely on good 'ol practice of reading from top to bottom intertwined with YouTube, conf videos and blogs. This highly experienced architect called my approach non-agile. He was expecting me to take a quick and dirty SO-route for fast results.
I think of books/knowledge as an experience accelerant. One could set a log on fire and it will burn, but it will burn a 'hek of a lot faster when liquid oxygen is poured onto it. Books do the same thing for practice. You'll get there one day with practice but you'll get there much faster when you're practicing under the influence of performance enhancing books.
One example from my own experience is Estimating.
It's something we all do, week in, week out. Yet there are still plenty of developers with years of experiences who delivery poor estimates week in, week out. I was one of these poor souls when I started developing. I would spend countless nights up late trying to finish a feature I promised someone else would be delivered yesterday.
So I did what my grandpa always recommended and I picked up a book, Steve McConnell's Software Estimation : The Black Art. And it taught me all types of tricks like making sure to break tasks into the smallest possible pieces.(Along with many other things. Seriously by this book, and every book Steve McConnell has written)
Maybe I would have eventually figured out tips like these on my own. But instead of having to wait to practice breaking up tasks into smaller more estimatable chunks, I got a 5 year head start and quickly was able to surpass many coworkers who had more years of experience but had spent less time in a book.
And now I can spend those late night posting on hacker news and not writing code trying to catch up for work :P.
TL;DR : Books are awesome. I read one once and I am a better estimator for it. And being a better estimator lets me spend more time on Hacker News. So if you wanna spend more time on hacker news, read a book.
Exercises are very different from projects. When you support a project over the long-term, you engage a very different set of skills than what you'll get in a book. You learn how to push your way through a seemingly unsolvable bug that nobody has encountered before, often one in code that you didn't write. You learn how to make technical choices that reduce the likelihood of encountering these bugs. You learn how to come back to your program in a few months and pick up where you left off, and what sorts of coding practices will inhibit this. You learn what sorts of bugs occur in practice, and how to avoid them. You learn how to diagnose performance problems, how to speed them up, when to speed them up, and you build up a mental model of how the systems you work with behave. You learn how to limit complexity, and what the complexity budget of your brain is, and how to break up projects so that you stay within that budget. You learn how to communicate with other programmers, and what they care about. You learn how to build up a codebase incrementally, how software evolves, and how the why of the code usually matters more than the how. You learn how to communicate with users, and how to accept their input, and how to weigh the costs of their feature requests against the complexity of the code base.
All of these are emergent problems that only occur when you work with large, long-lived software systems. You won't get them out of a book.
This is bad advice. Theory is vastly more important in computer science and math. Given your logic, one will simply practice their way to linear algebra, machine learning or AI. Good luck with that. There's a giant toolbox of shortcuts that seem like magic to the inexperienced. Becoming a great _user of tools_ (programming languages, etc.) is level 1.
Isn't reading books a good way to build fundamentals? I don't think reading a book necessarily precludes you from working on the exercises in that book, which would indeed be a great way to build your understanding of a language. This is the way I approach learning new languages - working through a tutorial, or, indeed, a book. Giving someone the advice, "Hey, just go write some JavaScript," probably isn't great if they don't know any JavaScript.
While I see where you're coming from I think your analogy is flawed and it doesn't quite apply here.
As a martial artist and weight lifter that totally makes sense - practice, sparring, doing the actual activity is what will make you good. The more you do it, the more you train your subconscious to intuitively know what to do.
As an engineer and tutor it only applies in a limited way. I have taught people who want to learn programming but lack all sorts of fundamentals. What they need to do is just go back to basics - read a book - do the exercises. I find that as an adult learner missing the basic background on things just makes everything hard. You will need to ask questions every step of the way. Who will be on hand to answer those questions? People like me, who have sat down and studied the basics and learned from first principles, i.e. worked through the books.
Coding is like math. Both practice and theory are important. If you don't read the chapter first and try to jump right into the exercises, you will not be able to do them properly. If you read the chapter but do not do the exercises, then you will forget everything you've read.
Having a coach is a luxury. For us software developers the closest thing we get to coaching is a code review by a more experienced developer. That is certainly valuable but rather hard to come by consistently if you are past certain level.
So what to do without a coach? Find something that will direct your practice. For this reading quality code is indispensable as it shows you the range of possibilities of what you can do with certain technology.
Considering your example of sports: past certain level it is essential to meticulously study video footage of yourself and your opponents in action as it provides insight into your weaknesses and your opponents' tricks which you can then adopt or learn to counter. Also when someone comes with spectacular advancement in technique (think Fosbury flop) it is quickly analyzed and adopted by others. So watching others is sometimes very useful.
I agree, one must oscillate between theory and practive. Acquire data, follow your intuitions, reflect on it, explore alternatives, communicate with others a little.
What do you think about Platonic teaching ? asking question to direct exploration without giving 'free' (~bad) knowledge.
This is the best comment I've read on HN! I guess you need to become great at something to understand this. For you to keep doing something though, you need to think it's fun! Then it will be much easier.
I kind of read it as the assumption is, if you're wanting to be a great JS programmer, that all these recommendations come on top of programming in JS as much as possible.
The best thing that happened to me as a JavaScript developer was being exposed to other languages. Especially the not-so-fancy Java and C++, really opened my mind about structuring code and planning for a long-term project.
Knowing JavaScript and JavaScript frameworks is surprisingly useless for the type of work JS devs usually handle. The documentation often consists of TodoMVC type of examples and approaches. Hardly anyone explains how patterns like DDD, SOLID, advanced REST, etc. fit into this. The highly appraised Flux is in reality just a pub/sub system like many on backend (and still it's a huge step forward - it admits JS systems are large and complex).
I'm just looking at a system design graph, preparing for a new job. There are about 30 nodes representing multiple services, databases, load balancers and processes on the backend. There are two for frontend - one says "JS" and the other "JSON". This is how most people think about frontend and to be a great JavaScript developer just don't be one of them.
I agree a lot with it. I also think it's useful to work with at least one statically-typed language (like Java for example) because it teaches some good maintainability practices. In JS world, I've seen far too often creating objects in random places, as a map of parameters, passing them around, and injecting new keys to the object in other random places, and when such an object goes around too much and is augmented randomly in a myriad of ways, it's really hard to reason about it.
In Java, you'd typically create a separate class for such an object, create fields, assign types to them and document them, and have a constructor which populates the fields with sensible defaults if not provided. Sometimes it's an overkill to do it this way, but often it pays off with a better understanding of the data model. In JS you have a lot of freedom, but too much freedom leads often to a mess when enough people are working on the code.
I enjoy the freedom to use a map/object/parameter object as named parameters, speaking as somebody who has suffered through much Java ceremony.
That said, JSDoc helps a lot: make a @typedef comment for parameter objects at the top of a file, then use the type in the @param annotations of the relevant functions. Makes understanding the JS code in an IDE much easer, as well as having something worth generating HTML documentation from.
I second this. Sometime back I did Python for a production work. That for the first time gave me a true sense of Object-based inheritance v/s class based inheritance. Prior to that I used take JS way as-is. But wholeheartedly, may be not so much.
I never said it should be more complex. It, however, should be also structured somehow. There is a persistence layer, models, collections, services reasoning about them and pipelines aggregating and rendering things.
Well written JavaScript is reasonably fast and it now makes sense to optimize transported information size. Many calculations can be done front-end side then, which accidentally is also more cost-effective, since data center usage is paid, while user CPUs are more or less free (and not doing much while browsing anyway).
Just adding my two cents. Wanna be a good JS dev? Go play around with a lisp. Like Clojure for a month or two. Get comfortable with functional programming. Then come back to JS. So many people come from a OOP to JS and they have a bad time with it. JS is more like a lisp with C syntax than it is a traditional OO language. Learning Clojure, not only improved my JS abilities, but just my over all programming maturity. IMO. Additionally, I agree with the author about reading books, and libraries. It's always good advice for any language.
Indeed, so the tale goes: Brendan Eich was originally going to make Scheme for the browser, but Netscape said their browser language had to look like Java, and that's how we wound up with this odd vaguely-functional browser language called Javascript.
In light of that, definitely seconded. Using Clojure (and watching Rich Hickey's amazing talks) made me a much better developer, and especially a better JS developer.
Somewhat relatedly, one thing I personally like about CoffeeScript is that it really lets the functional, Lisp-y side of Javascript shine through by melting away all the crufty syntax. That really helped me apply some of the style I picked up from Clojure.
JS brings a lot more to the table than just a scripted version of "C++ for retards" (aka Java), as it also lets you make use of many FP concepts like higher order functions and functional (vs object) composition.
For example, using currying (aka "dependency injection for functions") lets you often do with a single function what would take a silly-long class to do in Java. Use currying to inject leading parameters to a function that would normally be in the constructor (or setters, ugh) in a Java class, then the remaining "short arg list" function acts like the oh-too-common one actual "we're ready, now do something" method in a class.
Downside is that after using a proper functional language (clojure[script]) you end up wanting some really basic things such as immutable core data structures.
I feel like if you start from scratch on a javascript project, it's possible to program in a functional manner. I've found it really tough to introduce functional concepts to an already full stack javascript codebase.
BTW: I'd recommend ramda [1] for those interested in functional javascript programming. The auto-currying makes it way more powerful than underscore/lodash in terms of encouraging pure reusable functions.
If you've only been exposed to OOP, and you don't have the bandwidth for learning an unrelated language, then start using a functional library like Underscore. Just use it everywhere, even if you think it's ridiculous. Don't use for-loops, use _.each. Try to think of every problem in terms of chaining map, reduce, zip, pluck, groupBy, etc. Do whatever you can to avoid side-effects.
Once you're comfortable with it, try reading "Functional JavaScript".
You'll quickly develop a taste for when OOP or functional is appropriate, but I think the best way to get to that point is to immerse yourself in functional programming first, which might mean writing some ridiculous functional stuff, but the long-term payoff will be worth it.
Indeed. Personally I'm used to think in functional ways: map, fold, function composition, immutability... I'd like to be good at Haskell but I'm always having lots of pain dealing with it, because I never see the end of the learning curve.
I've found JS to be a nice middle land where I can get productive functionally without too much hassle. It's like a good friend who understands my way of thinking without being in the way too much. Underscore.js hits the sweet spot for me: _.chain(...).map(...).filter(...).value() is verbose but surprinsingly readable. I'm not a fan of Python map() syntactically, and I absolutely hate C++11's std::transform.
If you want to make that even less verbose, try myArray.map(...).filter(...) (those methods don't have to come from underscore, they exist on the Array prototype as of ES5).
Interesting, thanks for this perspective. As someone who started with C/C++ (and a hint of Python) but has recently started working in Clojure, I'm now very encouraged to re-try JS.
If you're already a decent enough developer and just need to get your grips on JavaScript, I'd say that most books listed aren't that useful. A decent enough online reference will get you going and after that you'll have to consider that JS is a pretty large dung heap by now where you probably won't get a lot of mileage out of inhaling dust from the crusty parts. Unless you're an enterprise developer tasked with maintaining your company's Dojo application.
If you're a new developer coming into JS from a more tabula rasa situation (possibly these days), I'd still say that most of those books are wasted, and you'd probably get a better mileage out ouf SICP or the GoF book than most Ninja/21days/Dummies tomes.
The core of JS is small enough, and the rest is highly dependent on your task, scope and framework. No jQuery book will help you with your intranet extjs app or your state of the art fluxified React SPA. You'll have to wade through code to get there, preferably as much of your own as possible.
And the most important thing: Pick something and stick with it. No mid-project framework/build tool/library changes. Even "obsolete" tech still works better than falling into the Duke Nukem hole. So don't get nervous about still using "grunt" when all the cool kids are using "gapoodle".
For the decent developers picking up Javascript, http://learnxinyminutes.com/docs/javascript/ is hard to beat. All the basic syntax and language features in one page without trying to explain to you what a while loop does.
// Statements can be terminated by ;
doStuff();
// ... but they don't have to be, as semicolons are automatically inserted
// wherever there's a newline, except in certain cases.
doStuff()
// Because those cases can cause unexpected results, we'll keep on using
// semicolons in this guide.
You might be right in that it technically is the best approach, but pedagogically the value of starting with a more specific jQuery, or Rails book is that it's just more fun to build something that immediately does something that you can see and play around with, especially if you can do so right within the browser.
Of course, it's not a good thing to stop there, but in my experience it often acts as a gateway for beginners to start actually learning 'proper' programming.
My brother, for example, has been working through the Rails tutorial, and already he's starting to read more general ruby books, doing javascript tutorials, and thinking about building a game for the browser using Rails as a backend. Plus, he'll be able to make money much sooner this way, which is a great incentive for him to keep at it.
I disagree with the last point. If you can make sure that the change is worth it, that you understand the new technology very well, and if you make a commitment to follow through and do all the necessary work, you wont fall into the "Duke Nukem" hole.
(The problem of course is that often times we don't take the time to make the necessary evaluation and want to make a change just for the sake of learning the new shiny)
I'm talking about the beginning JS programmer. So it's quite likely that they don't understand the technology they're currently working on and thus have bigger problems evaluting the new one, as there's no good point of comparison.
Also, I hope that the first project a JS newbie does isn't a 100'000 line app, but something more bite-sized, and thus you really don't have to wait months to get to use the new stack or tool. Quite often this kind of decision making happens when the project is 80% done and you have to face a few things that aren't that easy or your code has become a bit too complicated. And yes, the new tool could solve that and you might even end up re-implementing bits and pieces of that. This might not be the most effective use of your time, but it's a good learning experience.
Missing advice: learn to program well in a few well designed programming language. JavaScript was designed in 10 days and the main reason it still exists today is incredibly strong path dependence. There's nothing wrong with wanting to become a great JavaScript developer, but one needs to become a great developer first, and JavaScript just isn't conducive to that.
I personally am so over this argument. Sure, that is roughly a fact about the time in which it was designed... but that was 20 years ago. Since then there has been a team of some of the best programmers in the world maintaining and advancing the language.
That's irrelevant; advancing the language isn't an exercise in programming language design, it's an exercise in getting everyone to support the extension and in avoiding breaking legacy code. It has almost nothing to do with the maintainer's talent as programmers or PL experts.
If you doubt this argument, consider the fact that the horrible scoping, the weak typing, the insane casting rules are still here to this day; empirically you're wrong.
Since then there has been a team of some of the best programmers in the world maintaining and advancing the language.
JavaScript engines have seen a lot of effort from some of the best compiler and JIT experts in the industry, including former Self VM architects, yes.
The language itself? I honestly can't say that. Lua is a way better ECMAScript than ECMAScript itself, and the focus should have been on trimming it down to a smaller but easily extensible core, as opposed to the feature piling that's going on.
"Since then there has been a team of some of the best programmers in the world maintaining and advancing the language."
If you build a church from chewing gum and then get Gustaf Eiffel to design a few towers to it from steel with furbishments by Antonio Gaudi the fact still remains there is a heap of melting gum at the bottom.
Stuff that needs to be designed up front cannot be fixed after the fact regardless of the amount of ducktape and personell applied.
This is a good collection of resources that I have found are very educational and useful. That said, for me personally it was extremely important to dig into some problems concretely rather than by reading. "OK I've read about how I should do this in the ideal - now go actually set up an Angular app with a full test suite pointing at a REST API." Or perhaps - "I've got a great idea for some code art - let's try it out."
Without the follow-through I found that I could keep up in a conversation but still had doubts and issues when it came to implementation. Doing it in anger, delivering a product, as many times as possible helps a good deal in moving toward greatness.
I'd like to know how to learn to "accept" JS, coming from other languages.
No really.
How do I become a JS developer that doesn't whine all day long about all the little idiosyncracies of the language, or the tediousness of writing tests for things my compiler should work out? Obviously people enjoy writing JavaScript, and at least some fraction of these have to have been the kind of person that whined about the type systems in Java or C# being too weak.
If you were one of those developers, how did you let that go (did you?) when becoming a javascript developer?
It took me a while. My background was Java, Python, ActionScript and a few other languages sprinkled in. After about a year working JS, its now my preferred dev environment.
The turning points for me:
- modularity - npm has really changed the way I program, for the better
- Node.js tooling (including a Browserify, Babel, Webpack) will greatly improve your experience with the language
- live reloading, zero compile time, instant visual feedback
- the breadth of Browser/Node/npm APIs can make it a ridiculously productive language to work in
- IDE plugins and linters can catch a lot of errors as you type
- above all else; it has an amazing community of enthusiastic developers, tinkerers, scientists, artists, etc.
Books are a waste of time. Most of them are garbage to begin with, and most of them are practically obsolete by the time they are published. Few have any lasting staying power.
Besides, nobody ordained the author to be an authority on the subject. He was just a guy who wrote a book. It's zero indication of the quality of the content.
Writing code without guidance is probably the slowest way you can learn something. A good book or class will save you countless hours living with the consequences of your naive mistakes. Good writers and trainers forewarn people about pitfalls by providing fair warning about common mistakes. Better writers and trainers instill good mental models that timeless help the reader solve problems.
I'll agree that there are plenty of bad books that give bad advice. The solution isn't to say books are a waste of time. The solution is to recommend better books.
If one has knowledge others can benefit from, one doesn't need to be "ordained ... an authority" to write about it.
If one cannot find a mentor to tell you this is good Javascript and this is bad Javascript, then books can fill that void.
Writing code without any guidance can only get a developer so far. He needs examples of good solid idiomatic code to progress. A good book, often by "just a guy", can provide that.
Because there is no objective way to evaluate the quality of a book before reading it, and because any useful information in most of the few good technical books is of limited lifespan, books are a waste of time. It's not just that books can be bad. It's that most books are bad, and having to wade through them is what makes them a waste of time.
No, books are way better than reading blogs and forums. They keep a context and enforces the same style through the whole book which I find very useful
Totally agree. Best way to learn is to write, and if you want good examples to model after, check out the popular projects on Github. People are actually using those libraries and frameworks in production, unlike the toy examples in books.
One exception is more abstract thinking -- algorithms, general design principles, etc. I think a book can be handy there sometimes.
If a book on software is truly obsolete anytime shortly after publication, then the tech itself isn't truly stable.
Read "The C Programming Language", by Kernighan and and Ritchie. Written decades ago, still accurate and relevant today. "The Mythical Man-Month", "The Pragmatic Programmer", "Design Patterns"... books like this will always be relevant.
Maybe a good rule is to stick to CS books that have been in continuous print for at least ten years.
How to become great at Sports: - Read books about sports. - Watch other people play sports. - Read in-depth analysis of past sports games.
How to become great at Playing Violin: - Read books about playing violin. - Real sheet music by the great masters. - Listen to many concerts.
It's inherently obvious that the above approaches are totally and completely wrong. How do you become good at anything? You practice it. You do it. You have a coach or teacher or mentor who can give you pointers, but lets you make mistakes. You have someone who lets you get things wrong the first time, so that you can see the consequences.
There is a time and place for theory, for reading, for analysis, and this is too part of the learning process, but this is not at all the most important tool for becoming great at something.
Theory, analysis, critique, history, and context all matter when learning any skill, but first, you must build the fundamentals. First, you must do the thing and once you reach a level where you really understand the thing, then and only then can you begin the more introspective task of theory and analysis. Even without these steps, the best way of becoming great is to DO.
How to become great at Chess: - Read books about chess. - Watch other people play chess. - Read in-depth analysis of past chess games.
How to become great at Math: - Read books about math. - Watch other people perform math. - Read in-depth analysis of math.
You also skipped a key assertion from the author: "Do exercises and try to explain common JavaScript concepts such as inheritance in your own words."
But you're right, nothing beats digging in and creating something.
On chess, from a GM: "The key to their success is that they kept playing a lot, and learning from stronger opponents. Don't get me wrong: I am not suggesting stone age technologies in studying. Of course, you should take advantage of the best modern learning methods. However, the most important component of success (at least at weak GM and below level) is practice."
http://www.chess.com/article/view/getting-better-in-chess-cr...
Math is similar. You really have to do math. Reading books and watching other people do math is not the critical part.
They play thousands and thousands of hours and, yes, also spend quite a bit of time reading, thinking, analyzing (both their own and others') games and learning from mentors/teachers. However, practice is king and all the reading/analysis would be worthless in its absence. They would have no anchors to grab onto in your brain - no way to really become operational.
A chess "player" that mostly reads, studies and analyzes with a little bit of practice sprinkled in between would indeed be hilariously weak.
The biggest part is the ability to move a large part of the necessary skillset to your unconscious mind. As a joke Capablanca said "I only see one move ahead, but it is always the best one", this is how every strong chess player thinks, they can instantly evaluate the position. It is just like once you have learned to drive well, you would recognize a potentially dangerous situation(a child playing with a ball on a sidewalk) without actually thinking about it consciously.
I believe this is how the best programmers work too, they have an immediate grasp of possible techniques they can apply without necessarily thinking about them or looking them up in google.
You become great at your craft when you internalize/obtain unconscious mastery of a large number of techniques in your craft. You become truly great when you can combine these techniques in novel ways.
I will mostly speak about chess, because I am an average programmer and average mathematician but am a pretty good chess player near IM strength FM (2350) and have spoken to various strong chess players (up to 2700) on this subject.
There have been players who have become very strong with very little reading (GM Flohr is a famous example from 1930s) but with a lot of playing, however I am not aware of anyone who become good without practice.
So let's start with a simple example. You must absolutely learn how the pieces move, this would be equivalent to what loops and conditionals are in a programming language. If you have to think how the horsie jumps when playing, you are not going to get very far.
A more complicated example, it is very useful to be aware of the standard h7/h2 sacrifice. As you get stronger, you develop a better sense on when this sacrifice will be strong and when it will be likely fail, even before starting to calculate consciously.
How do you obtain this knowledge, the best way is iterative by playing and applying in practice what you learned.
You must work and do to become great at something.
What that means is that the point of practice is to reset habits to the best possible technique, so that when the athlete is under duress, they are habitually as efficient/effective as possible. Any practice done with poor technique is basically wasted time, and potentially counterproductive. This is true at any point in the athlete's development, from day one to just before the title game (or match or whatever).
So, just writing a lot of javascript will not make someone a great javascript developer. If they write a lot of crappy code, they will become an experienced, crappy developer.
The best way to achieve greatness is to have a great coach (or teacher, or mentor). That person can help one shortcut to the best technique, and they can catch and correct one when one strays from that.
But if one does not have that, then disciplined self-study of known great performers is an ok substitute.
And, when it comes to "how to become great" articles, I think the writer usually assumes that the reader is already somewhat engaged--that their target audience is already writing javascript but wants to get better at it.
Much better to just jump in and start figuring things out. Google your questions, find Stack Overflow questions. Fiddle with CodePen (etc) examples to see what variables and functions do what. Once you're well versed, read the occasional blog post about emerging techniques and patterns.
I work in JS day in, day out, and this approach hasn't seen me wrong. But we're all different.
It only takes being bitten a few times by rushing into a new tech and doing everything completely wrong from the start. The smart learn from their own mistakes, but the truly wise learn from others'.
This still holds true in JavaScript.
Obviously, practice is also critical, but my point is most people who love to program love the act of programming, so they obviously already do a lot of that.
I hope this situation seems familiar to programmers because we see it every day -- programmers who write code that "works", but is tortured in its design. We can see people who can not express themselves in code because they are not fluent enough to do so. We can see people who can not understand common idioms because they never have read other people's code (in quantity). They ivent their own idioms, just like baby talk, and often decide that their baby talk is superior to the living language around them.
The biggest difference between a human language and a computer language is that most people aren't exposed to incredibly fluent users of the language in great quantity. It is really easy to fool yourself into thinking that you are a great programmer, when actually you can just barely make the code work. The same happens very frequently to learners of a foreign language that are rarely exposed to native speakers. You have no yardstick to measure your progress other than your textbooks.
Although I agree with your assesment that you must DO, but even more so you need to seek out communities of fluent users of the language and interact with them. That means reading their code, writing code, having them correct it, etc, etc.
One example from my own experience is Estimating.
It's something we all do, week in, week out. Yet there are still plenty of developers with years of experiences who delivery poor estimates week in, week out. I was one of these poor souls when I started developing. I would spend countless nights up late trying to finish a feature I promised someone else would be delivered yesterday.
So I did what my grandpa always recommended and I picked up a book, Steve McConnell's Software Estimation : The Black Art. And it taught me all types of tricks like making sure to break tasks into the smallest possible pieces.(Along with many other things. Seriously by this book, and every book Steve McConnell has written)
Maybe I would have eventually figured out tips like these on my own. But instead of having to wait to practice breaking up tasks into smaller more estimatable chunks, I got a 5 year head start and quickly was able to surpass many coworkers who had more years of experience but had spent less time in a book.
And now I can spend those late night posting on hacker news and not writing code trying to catch up for work :P.
TL;DR : Books are awesome. I read one once and I am a better estimator for it. And being a better estimator lets me spend more time on Hacker News. So if you wanna spend more time on hacker news, read a book.
Deleted Comment
Also, the kinds of things I tried out on my own while reading were unique and new. Not the kind of things I would necessarily run into in my job.
Doing is one thing, but if I just keep doing with my current knowledge then it's easy to fall into a situation where improvement is minuscule.
All of these are emergent problems that only occur when you work with large, long-lived software systems. You won't get them out of a book.
As a martial artist and weight lifter that totally makes sense - practice, sparring, doing the actual activity is what will make you good. The more you do it, the more you train your subconscious to intuitively know what to do.
As an engineer and tutor it only applies in a limited way. I have taught people who want to learn programming but lack all sorts of fundamentals. What they need to do is just go back to basics - read a book - do the exercises. I find that as an adult learner missing the basic background on things just makes everything hard. You will need to ask questions every step of the way. Who will be on hand to answer those questions? People like me, who have sat down and studied the basics and learned from first principles, i.e. worked through the books.
Coding is like math. Both practice and theory are important. If you don't read the chapter first and try to jump right into the exercises, you will not be able to do them properly. If you read the chapter but do not do the exercises, then you will forget everything you've read.
So what to do without a coach? Find something that will direct your practice. For this reading quality code is indispensable as it shows you the range of possibilities of what you can do with certain technology.
Considering your example of sports: past certain level it is essential to meticulously study video footage of yourself and your opponents in action as it provides insight into your weaknesses and your opponents' tricks which you can then adopt or learn to counter. Also when someone comes with spectacular advancement in technique (think Fosbury flop) it is quickly analyzed and adopted by others. So watching others is sometimes very useful.
What do you think about Platonic teaching ? asking question to direct exploration without giving 'free' (~bad) knowledge.
Deleted Comment
Deleted Comment
Knowing JavaScript and JavaScript frameworks is surprisingly useless for the type of work JS devs usually handle. The documentation often consists of TodoMVC type of examples and approaches. Hardly anyone explains how patterns like DDD, SOLID, advanced REST, etc. fit into this. The highly appraised Flux is in reality just a pub/sub system like many on backend (and still it's a huge step forward - it admits JS systems are large and complex).
I'm just looking at a system design graph, preparing for a new job. There are about 30 nodes representing multiple services, databases, load balancers and processes on the backend. There are two for frontend - one says "JS" and the other "JSON". This is how most people think about frontend and to be a great JavaScript developer just don't be one of them.
In Java, you'd typically create a separate class for such an object, create fields, assign types to them and document them, and have a constructor which populates the fields with sensible defaults if not provided. Sometimes it's an overkill to do it this way, but often it pays off with a better understanding of the data model. In JS you have a lot of freedom, but too much freedom leads often to a mess when enough people are working on the code.
That said, JSDoc helps a lot: make a @typedef comment for parameter objects at the top of a file, then use the type in the @param annotations of the relevant functions. Makes understanding the JS code in an IDE much easer, as well as having something worth generating HTML documentation from.
It just doesn't make any sense.
Well written JavaScript is reasonably fast and it now makes sense to optimize transported information size. Many calculations can be done front-end side then, which accidentally is also more cost-effective, since data center usage is paid, while user CPUs are more or less free (and not doing much while browsing anyway).
Indeed, so the tale goes: Brendan Eich was originally going to make Scheme for the browser, but Netscape said their browser language had to look like Java, and that's how we wound up with this odd vaguely-functional browser language called Javascript.
In light of that, definitely seconded. Using Clojure (and watching Rich Hickey's amazing talks) made me a much better developer, and especially a better JS developer.
Somewhat relatedly, one thing I personally like about CoffeeScript is that it really lets the functional, Lisp-y side of Javascript shine through by melting away all the crufty syntax. That really helped me apply some of the style I picked up from Clojure.
JSON starts to look like funny s-expressions.
JS brings a lot more to the table than just a scripted version of "C++ for retards" (aka Java), as it also lets you make use of many FP concepts like higher order functions and functional (vs object) composition.
For example, using currying (aka "dependency injection for functions") lets you often do with a single function what would take a silly-long class to do in Java. Use currying to inject leading parameters to a function that would normally be in the constructor (or setters, ugh) in a Java class, then the remaining "short arg list" function acts like the oh-too-common one actual "we're ready, now do something" method in a class.
Downside is that after using a proper functional language (clojure[script]) you end up wanting some really basic things such as immutable core data structures.
I feel like if you start from scratch on a javascript project, it's possible to program in a functional manner. I've found it really tough to introduce functional concepts to an already full stack javascript codebase.
BTW: I'd recommend ramda [1] for those interested in functional javascript programming. The auto-currying makes it way more powerful than underscore/lodash in terms of encouraging pure reusable functions.
[1]: https://github.com/ramda/ramda
If you've only been exposed to OOP, and you don't have the bandwidth for learning an unrelated language, then start using a functional library like Underscore. Just use it everywhere, even if you think it's ridiculous. Don't use for-loops, use _.each. Try to think of every problem in terms of chaining map, reduce, zip, pluck, groupBy, etc. Do whatever you can to avoid side-effects.
Once you're comfortable with it, try reading "Functional JavaScript".
You'll quickly develop a taste for when OOP or functional is appropriate, but I think the best way to get to that point is to immerse yourself in functional programming first, which might mean writing some ridiculous functional stuff, but the long-term payoff will be worth it.
I've found JS to be a nice middle land where I can get productive functionally without too much hassle. It's like a good friend who understands my way of thinking without being in the way too much. Underscore.js hits the sweet spot for me: _.chain(...).map(...).filter(...).value() is verbose but surprinsingly readable. I'm not a fan of Python map() syntactically, and I absolutely hate C++11's std::transform.
I cringe when I see Java/C++ style code in JavaScript. Unfortunately it's how most JS coders write code.
If you're a new developer coming into JS from a more tabula rasa situation (possibly these days), I'd still say that most of those books are wasted, and you'd probably get a better mileage out ouf SICP or the GoF book than most Ninja/21days/Dummies tomes.
The core of JS is small enough, and the rest is highly dependent on your task, scope and framework. No jQuery book will help you with your intranet extjs app or your state of the art fluxified React SPA. You'll have to wade through code to get there, preferably as much of your own as possible.
And the most important thing: Pick something and stick with it. No mid-project framework/build tool/library changes. Even "obsolete" tech still works better than falling into the Duke Nukem hole. So don't get nervous about still using "grunt" when all the cool kids are using "gapoodle".
Of course, it's not a good thing to stop there, but in my experience it often acts as a gateway for beginners to start actually learning 'proper' programming.
My brother, for example, has been working through the Rails tutorial, and already he's starting to read more general ruby books, doing javascript tutorials, and thinking about building a game for the browser using Rails as a backend. Plus, he'll be able to make money much sooner this way, which is a great incentive for him to keep at it.
(The problem of course is that often times we don't take the time to make the necessary evaluation and want to make a change just for the sake of learning the new shiny)
Also, I hope that the first project a JS newbie does isn't a 100'000 line app, but something more bite-sized, and thus you really don't have to wait months to get to use the new stack or tool. Quite often this kind of decision making happens when the project is 80% done and you have to face a few things that aren't that easy or your code has become a bit too complicated. And yes, the new tool could solve that and you might even end up re-implementing bits and pieces of that. This might not be the most effective use of your time, but it's a good learning experience.
If you doubt this argument, consider the fact that the horrible scoping, the weak typing, the insane casting rules are still here to this day; empirically you're wrong.
JavaScript engines have seen a lot of effort from some of the best compiler and JIT experts in the industry, including former Self VM architects, yes.
The language itself? I honestly can't say that. Lua is a way better ECMAScript than ECMAScript itself, and the focus should have been on trimming it down to a smaller but easily extensible core, as opposed to the feature piling that's going on.
If you build a church from chewing gum and then get Gustaf Eiffel to design a few towers to it from steel with furbishments by Antonio Gaudi the fact still remains there is a heap of melting gum at the bottom.
Stuff that needs to be designed up front cannot be fixed after the fact regardless of the amount of ducktape and personell applied.
Without the follow-through I found that I could keep up in a conversation but still had doubts and issues when it came to implementation. Doing it in anger, delivering a product, as many times as possible helps a good deal in moving toward greatness.
No really.
How do I become a JS developer that doesn't whine all day long about all the little idiosyncracies of the language, or the tediousness of writing tests for things my compiler should work out? Obviously people enjoy writing JavaScript, and at least some fraction of these have to have been the kind of person that whined about the type systems in Java or C# being too weak.
If you were one of those developers, how did you let that go (did you?) when becoming a javascript developer?
The turning points for me:
- modularity - npm has really changed the way I program, for the better
- Node.js tooling (including a Browserify, Babel, Webpack) will greatly improve your experience with the language
- live reloading, zero compile time, instant visual feedback
- the breadth of Browser/Node/npm APIs can make it a ridiculously productive language to work in
- IDE plugins and linters can catch a lot of errors as you type
- above all else; it has an amazing community of enthusiastic developers, tinkerers, scientists, artists, etc.
Besides, nobody ordained the author to be an authority on the subject. He was just a guy who wrote a book. It's zero indication of the quality of the content.
Just write code. Practice, practice, practice.
Writing code without guidance is probably the slowest way you can learn something. A good book or class will save you countless hours living with the consequences of your naive mistakes. Good writers and trainers forewarn people about pitfalls by providing fair warning about common mistakes. Better writers and trainers instill good mental models that timeless help the reader solve problems.
I'll agree that there are plenty of bad books that give bad advice. The solution isn't to say books are a waste of time. The solution is to recommend better books.
If one cannot find a mentor to tell you this is good Javascript and this is bad Javascript, then books can fill that void.
Writing code without any guidance can only get a developer so far. He needs examples of good solid idiomatic code to progress. A good book, often by "just a guy", can provide that.
Because there is no objective way to evaluate the quality of a book before reading it, and because any useful information in most of the few good technical books is of limited lifespan, books are a waste of time. It's not just that books can be bad. It's that most books are bad, and having to wade through them is what makes them a waste of time.
One exception is more abstract thinking -- algorithms, general design principles, etc. I think a book can be handy there sometimes.
Read "The C Programming Language", by Kernighan and and Ritchie. Written decades ago, still accurate and relevant today. "The Mythical Man-Month", "The Pragmatic Programmer", "Design Patterns"... books like this will always be relevant.
Maybe a good rule is to stick to CS books that have been in continuous print for at least ten years.