Additional Resources - Learning JavaScript (2016)

Learning JavaScript (2016)

Chapter 22. Additional Resources

While my epiphany that JavaScript is an expressive, powerful language came some time ago, the journey of writing this book has driven that lesson home. JavaScript is not a “toy language” to be taken lightly or dismissed as a “beginner’s language.” You’ve made it through this book; you know that all too well!

My goal in this book was not to exhaustively explain every feature of the JavaScript language, much less explain every important programming technique. If JavaScript is your primary language, this is just the beginning of your journey. I hope I have given you a solid foundation that you can build on to become an expert.

Much of the material in this chapter is taken from my first book, Web Development with Node and Express (O’Reilly).

Online Documentation

For JavaScript, CSS, and HTML documentation, the Mozilla Developer Network (MDN) is without equal. If I need JavaScript documentation, I either search directly on MDN or append “mdn” to my search query. Otherwise, inevitably, w3schools appears in the search. Whoever is managing SEO for w3schools is a genius, but I recommend avoiding this site; I find the documentation is often severely lacking.

Where MDN is a great HTML reference, if you’re new to HTML5 (or even if you’re not), you should read Mark Pilgrim’s Dive Into HTML5. WHATWG maintains an excellent “living standard” HTML5 specification; it is usually where I turn first for really hard-to-answer HTML questions. Finally, the official specifications for HTML and CSS are located on the W3C website; they are dry, difficult-to-read documents, but sometimes it’s your only recourse for the very hardest problems.

ES6 adheres to the ECMA-262 ECMAScript 2015 Language Specification. To track the availability of ES6 features in Node (and various browsers), see the excellent guide maintained by @kangax.

Both jQuery and Bootstrap have extremely good online documentation.

The Node documentation is very high-quality and comprehensive, and it should be your first choice for authoritative documentation about Node modules (such as http, https, and fs). The npm documentation is comprehensive and useful, particularly the page on the package.json file.

Periodicals

There are three free periodicals you should absolutely subscribe to and read dutifully every week:

§ JavaScript Weekly

§ Node Weekly

§ HTML5 Weekly

These three periodicals will keep you informed of the latest news, services, blogs, and tutorials as they become available.

Blogs and Tutorials

Blogs are a great way to stay abreast of developments in JavaScript. I’ve often had those critical “ah ha” moments when reading some of these blogs:

§ Axel Rauschmayer’s blog has great articles on ES6 and related technologies. Dr. Rauschmayer approaches JavaScript from an academic computer science viewpoint, but his articles start out very accessible and easy to read—those with a computer science background will appreciate the additional detail he provides.

§ Nolan Lawson’s blog has lots of great detailed posts about real-world JavaScript development. His article “We Have a Problem with Promises” is required reading.

§ David Walsh’s blog has fantastic articles about JavaScript development and related technologies. If you struggled with the material in Chapter 14, his article “The Basics of ES6 Generators” is a must-read.

§ @kangax’s blog, Perfection Kills, is full of fantastic tutorials, exercises, and quizzes. It’s highly recommended for beginners and experts alike.

Now that you’ve read this book, the available online courses and tutorials should be very easy for you. If you still feel that you’re missing some basic pieces, or just want to practice the fundamentals, I recommend the following:

§ Lynda.com JavaScript tutorials

§ Treehouse JavaScript track

§ Codecademy’s JavaScript course

§ Microsoft Virtual Academy’s intro course on JavaScript; if you are writing JavaScript on Windows, I recommend this for the material on using Visual Studio for JavaScript development

Stack Overflow

Chances are good that you’ve already used Stack Overflow (SO); since its inception in 2008, it has become the dominant online Q&A site for programmers, and it is your best resource to get your JavaScript questions answered (and any other technology covered in this book). Stack Overflow is a community-maintained, reputation-based Q&A site. The reputation model is what’s responsible for the quality of the site and its continued success. Users can gain reputation by having their questions or answers “upvoted” or having an accepted answer. You don’t have to have any reputation to ask a question, and registration is free. However, there are things you can do to increase the chances of getting your question answered in a useful manner, which we’ll discuss in this section.

Reputation is the currency of Stack Overflow, and while there are people out there who genuinely want to help you, it’s the chance to gain reputation that’s the icing on the cake that motivates good answers. There are a lot of really smart people on SO, and they’re all competing to provide the first and/or best correct answer to your question (there’s a strong disincentive to provide a quick but bad answer, thankfully). Here are things you can do to increase the chances of getting a good answer for your question:

Be an informed SO user

Take the SO tour, then read “How do I ask a good question?” If you’re so inclined, you can go on to read all of the help documentation—you’ll earn a badge if you read it all!

Don’t ask questions that have already been answered

Do your due diligence, and try to find out if someone has already asked your question. If you ask a question that has an easily found answer already on SO, your question will quickly be closed as a duplicate, and people will often downvote you for this, negatively affecting your reputation.

Don’t ask people to write your code for you

You will quickly find your question downvoted and closed if you simply ask “How do I do X?” The SO community expects you to make an effort to solve your own problem before resorting to SO. Describe in your question what you’ve tried and why it isn’t working.

Ask one question at a time

Questions that are asking several things—“How do I do this, then that, then the other things, and what’s the best way to do this?”—are difficult to answer, and are discouraged.

Craft a minimal example of your issue

I answer a lot of SO questions, and the ones I almost automatically skip over are those where I see three pages of code (or more!). Just taking your 5,000-line file and pasting into an SO question is not a great way to get your question answered (but people do it all the time). It’s a lazy approach that isn’t often rewarded. Not only are you less likely to get a useful answer, but the very process of eliminating things that aren’t causing the problem can lead you to solving the problem yourself (then you don’t even need to ask a question on SO). Crafting a minimal example is good for your debugging skills and for your critical thinking ability, and makes you a good SO citizen.

Learn Markdown

Stack Overflow uses Markdown for formatting questions and answers. A well-formatted question has a better chance of being answered, so you should invest the time to learn this useful and increasingly ubiquitous markup language.

Accept and upvote answers

If someone answers your question satisfactorily, you should upvote and accept it; it boosts the reputation of the answerer, and reputation is what drives SO. If multiple people provide acceptable answers, you should choose the one you think is best and accept that, and upvote anyone else you feel offered a useful answer.

If you figure out your own problem before someone else does, answer your own question

SO is a community resource; if you have a problem, chances are, someone else has it too. If you’ve figured it out, go ahead and answer your own question for the benefit of others.

If you enjoy helping the community, consider answering questions yourself: it’s fun and rewarding, and it can lead to benefits that are more tangible than an arbitrary reputation score. If you have a question for which you’ve received no useful answers for two days, you can start a bounty on the question, using your own reputation. The reputation is withdrawn from your account immediately, and it is nonrefundable. If someone answers the question to your satisfaction, and you accept their answer, they will receive the bounty. The catch is, of course, you have to have reputation to start a bounty: the minimum bounty is 50 reputation points. While you can get reputation from asking quality questions, it’s usually quicker to get reputation by providing quality answers.

Answering people’s questions also has the benefit of being a great way to learn. I generally feel that I learn more from answering other people’s questions than I do from having my questions answered. If you want to really thoroughly learn a technology, learn the basics and then start trying to tackle people’s questions on SO. At first you might be consistently beat out by people who are already experts, but before long, you’ll find that you are one of the experts.

Lastly, you shouldn’t hesitate to use your reputation to further your career. A good reputation is absolutely worth putting on a résumé. It’s worked for me, and now that I’m in the position of interviewing developers myself, I’m always impressed to see a good SO reputation (I consider a “good” SO reputation anything over 3,000; five-digit reputations are great). A good SO reputation tells me that someone is not just competent in their field, but they are clear communicators and generally helpful.

Contributing to Open Source Projects

A great way to learn is to contribute to open source projects: not only will you face challenges that stretch your abilities, but your code will be peer-reviewed by the community, which will make you a better programmer. It also looks great on a résumé.

If you’re a beginner, a good place to start is by contributing to documentation. Many open source projects suffer in the documentation department, and as a beginner, you’re in an excellent position: you can learn something, then explain it in a way that’s useful to other beginners.

Sometimes the open source community can be intimidating, but if you’re persistent and stay open to constructive criticism, you will find that your contributions are welcome. Start by reading Scot Hanselman’s excellent blog post “Bringing Kindness Back to Open Source”. In that post, he recommends the website Up for Grabs, which helps connect programmers to open source projects. Search for the tag “JavaScript,” and you’ll find many open source projects looking for help.

Conclusion

Congratulations on starting your journey to becoming a JavaScript developer! Some of the material in this book is very challenging, and if you took the time to understand it thoroughly, you will have a strong foundation in this important language. If there were parts you struggled with, don’t be discouraged! JavaScript is a complex, powerful language that can’t be learned overnight (or even in a year). If you’re new to programming, you will probably want to revisit some of the material in this book in the future—you’ll find new insights in material you found difficult the first time.

ES6 brings with it a new generation of programmers—and along with them, many wonderful ideas. I encourage you to read all you can, talk to every JavaScript programmer you can, and learn from every source you can find. There is going to be an explosion of depth and creativity in the JavaScript development community—and I sincerely hope that you will be part of it.