How to Learn JavaScript
sivers.org
sivers.org
I know how to do an AJAX request, delegate an event listener, and update the DOM, all with vanilla JS. I guess it’s useful knowledge if you’re going to build a library/framework or hand-tune a critical part of your app, but honestly I have no desire to get too comfortable with low-level JavaScript. There’s too much weird syntax and too many gotchas, although ES6+ has improved things a little.
Personal preferences aside, I have some experience as a programming tutor and think pushing people to learn plain JavaScript from the start is setting them up for frustration to the point that many will quit before ever becoming proficient.
Also, I learned Python before I learned JavaScript, but actually started toying with Django before I understood even a decent chunk of Python syntax. Being able to build something less trivial than “Hello World” almost right away gives positive reinforcement and encourages people to keep learning.
My advice for people starting out with any language is to ask around and see if there is a framework that is 1) popular and well-supported; 2) easy to learn; 3) will get you a lot of mileage and grow with you. In the case of JavaScript, that’s React. In the case of Python, that’s Django. I’m still fairly new to Swift, but SwiftUI seems like a great way to start out with the language.
Before people can become programmers, you have to get them interested in programming.
Personally, I feel starting out with jQuery as a perfect introduction. There are no build tools, just a simple refresh and you see all your changes.
If someone understands HTML they should be fine using JSX after a tutorial or two. The build system adds some friction, but with create-react-app you can get pretty far without having to understand much about build systems (and you even get auto-refresh).
I haven't looked into any of the resources the author has posted, but I've been compiling a list of free web books[1] for myself and friends. I highly recommend checking out either Eloquent JavaScript if you're new to programming, or MDN's Reintroduction to JavaScript or the Modern JavaScript Tutorial if you already have programming experience.
Who are these completely clueless developers? How do they get hired?
A good heuristic for how good a web developer is is getting them to list every HTML element they know, including the deprecated ones like <marquee>. You would be surprised just how little elements they know, and more importantly, the semantic value of the elements. For example, knowing when to use <span> instead of <div>
IMO in frontend world there are two important things: knowing how to search, and knowing how to determine which search results are useful as opposed to some Medium/blogpost fluff piece that is varying degrees of misinformed.
I was recently at an interview where they just asked me to name a list of CloudFormation functions I’ve used and what did I use them for. If I listed that on my resume as something I knew, it was fair game.
It is not a good heuristic if the person has two days to prepare in that it is very gameable.
It is important to be able to develop things _quickly_ in order to keep a job. For that, knowing how to search is indeed useful. But there are certain things that it is worth keeping in L1 cache.
I doubt that the laundry list of things that have gotten tossed out of W3C's HTML standards is one of them, as the grandfather comment implied.
Frankly I get more joy out of writing bookmarklets, Tampermonkey/Greasemonkey scripts and customizing websites with various CSS 'userstyles'.
I also prefer SFTP and still enjoy uploading PHP scripts with SFTP and then building out some barebones CRUD app in my free time. Again, I shy away from the new shiny like GraphQL and things like Docker or Kubernetes etc.
For instance, yesterday a PHP tool made the HN frontpage [1] that seemed rather interesting. Problem is, it needs PHP 7.2+ and my app runs on 5.6.* What to do? (Bear in mind, 3 weeks ago I moved from Virtual Box to Docker for local dev, and my files are now in a regular folder in my machine).
In this case, I just need to tell Docker to fetch the image and run it pointing to the same folder where my app is. Just a 1 line command.
After that, I just need to remove the Docker image and my system is as pristine as before.
I think I have itches very similar to yours (Like, I'm learning Python and all things Data Science and Machine learning related, instead of virtualenv or even *conda, I'm separating my projects using Docker), and nowadays I'm using Docker for all of'em.
But now I am seeing more of this. Do you have any good links to read more about why using venv/non-root makes sense for Docker?
I do know setting up a proper user in Docker is just a couple lines away in a Dockerfile (As a matter of fact, I did that for the main app I develop).
For my other use cases, I just don't care. I'm using Docker to quickly bootstrap a Jupyter Labs environment, and I do that by sharing some confs (Like the Pip cache folder).
The caveat to this is that files I create are owned by root, but that again is just a command away for fixing (If I need it, that haven't yet).
[1] https://stackoverflow.com/questions/27017715/does-virtualenv...
- exploits for breaking out of the container are easier to pull off if you have root access
- if the image has a system python, installing with sudo will install things in the system site-packages directory, which can cause a lot of troubles
The only item in your list I'm not sure fits is Docker. It's not a framework or a language, it's a complex-but-not-complicated tool that makes a lot of life fairly convenient, especially at small scale. Things like Kubernetes (and Terraform and so on) only should come into the conversation when you start having bigger questions about the scale of your project and your infrastructure, and even then aren't a given. But at a single-user local scale, Docker can be incredibly convenient to do local dev, have reliable behaviour, and avoid a lot of pitfalls of your own machine's configuration. Often in just a handful of lines (a few for the dockerfile and a one-liner to start or stop the whole thing). The docs are also fairly well-written as they offer basic options and allow for a lot of granularity when it becomes needed.
Docker isn't the only tool in the world to do what it does, but it's a very user-friendly tool that offers a lot of convenience with little overhead (at least at a non-"devops team" scale).
This is overkill for moving files.
I have leaned both towards rfc-1867 transfers when I have a web server available, and stunnel configured to launch tar xf when I don't.
I'm also about to go to production with a tftp server as a bridge to smb3. The tftp client is so elderly that it is constrained to 512-byte UDP packets - a true museum piece (running VMS).
For example, my path for learning Typescript was:
- read the Typescript documentation
- read up on relatively new JS features (let, const, modules, spread operator, etc.)
- recall C-style syntax and historical baggage (return, things that are statements not expressions)
This took maybe a day or two, spread over some evenings.
This works for me because I'm a bit of a programming language nerd, so I have a very good framework on which to hang knowledge of a new language. I also teach programming and I would never use this approach with a student who is relatively new to the field. I also wouldn't use this approach for myself if I was learning a field I'm relatively new to.
I agree it's only a book you'd want to learn from if you already know another language - it's a terse, conceptual ground-up description.
EDIT: Also if you know any resources for writing high performance JS, that would be appreciate too. Not necessarily just number crunching optimizations, but also working with (potentially large) strings/Unicode. I’ve worked on something that might need to parse tens of megabytes of a simple plain text format including dates and likely (complex) Unicode characters, so making that as fast as possible is important to me. (I got it down to like 500ms for 30-40MB I’d text but I think I managed faster with a version on the JVM, with both being single threaded)
JavaScript is not the language for that objective anyway. So, No!
It's all about I/O.
Regarding games, it uses subset of OpenGL API. You can use that to crunch numbers actually.
Anyways you'll have to use some external API/FFI for your job.
1. All courses by Will Sentance on Frontend Masters
2. Eloquent JavaScript
I would also suggest having an actual project in mind while learning. It can be something very simple to start, such as creating the game Tic Tac Toe. But that will force you to apply what you are learning. In other words, try writing and maybe even rewriting the project based on what you learn.
It is non answer we give when we have no idea how to answer.
I realize it's probably not the best way to learn, there's the chance of not learning a simpler or better method. But I personally just don't have the attention span to read through books or take online courses.
One big issue with "just do something" is that people are unable to come up with suitable "something". So they don't even start. Building "something" is motivating for some people, but definitely not for all or majority.
Also, people who never coded are pretty much guaranteed to drown in own mess if they attempt to do "something". They will end up with tangled spaghetti they will be unable to make work and they will not know what their issue is.
Building something is a part of how you reinforce what you've learned from actual material like books, documentation and others research. You still need to know some of the basic building blocks to get started.
If it is the first, a lot of hand-holding makes sense; reviews of good code, exercises to solve a simple problem three different ways, etc. This also helps avoid learning really bad patterns that take years to unlearn. In fact, if JS is the first language I would recommend stopping and doing something else first. Python, C, Go or Kotlin are all better in my view as a standard tools to learn the basics of statements, flow control and data types.
Those already comfortable with programming will pick the basics of JS in a couple of sittings. What they need is a set of problems, both simple and more complex, that highlight the language strengths: wowing the reader with what the language makes possible with a few pages of code. Add some hints and let experienced developer explore.
Everyone is different, but this works best for me. My 2c.
This. That is why I'm a big fan of Zed Shaw's 'learn X the hard way' method of learning
> Don’t depend on a library of shortcuts. JavaScript will be around for many years, while libraries and frameworks come and go every year.
I agree with the last part but this is not necessarily a sufficent reason to not learn via a framework or library. I'd say it depends on the circumstances, what you want to achieve by learning JS and also what type of a learner you are.
Please don't. 6yo book doesn't worth it. Even one year is a lot for modern tech.
> Do Free Code Camp.
Agree. Crazy good chunk of exercises, also useful for React & Node.
I always recommend to get any basic video course if you learning something from zero, it helps to start fast. Avoid crazy 60+ hours all-in-one courses. Then do exercises and grab advanced books & blogs & manuals.
> Please don't. 6yo book doesn't worth it. Even one year is a lot for modern tech.
I'm sorry, I know you're parroting conventional wisdom here, but have you read a book? Did you look at the table-of-contents? It looks like a great introduction to me, covering the basics that I think would be a prerequisite to learning any of the more recent language features. "Don't judge a book by its cover", as they say!