That was my introduction to JS. From the first time I saw JS I didn’t want to deal with it. That looked too hard. I thought I’d never understand it. I loved HTML and CSS though. It was simple, but you could actually make things on the internet, which at the time, felt magical. With that, I went off to college at MHCC early in what would have been my sophmore year in high school to pursue graphic design.I liked designing the sites and building out the interfaces in HTML and CSS, but I tried to avoid JS like the black plague. Might as well be pure binary at the time.
My 2nd year at MHCC I got an internship at Workshed Interactive. On one of my first days they had me put a lightbox–which was actually Cody Lindley’s ThickBox–on a site with a photo gallery and told me to use jQuery. It was the first time I had heard of jQuery. Googled ThickBox, went to the site, followed the pretty simple instructions and like nothing there were lightboxes on this site that I had only been working on for a few hours. The only JS I had to write was, well, none. To me, it was the first time I felt like something was magical since I started coding. All of a sudden I got a surge of confidence and started coding all the time. Sure, the JS I was “coding” was just setting up plugins for awhile, but it was baby steps.
I was totally “that guy” who just threw a plugin at everything. This was only a temporary thing. As I was doing that I was also learning how those plugins actually worked. The code of those plugins was actually readable because it used jQuery methods rather than vanilla JS. No cross browser checking, no nasty hacks, they were pretty straightforward and you could read the code like a book. After I felt comfortable I started writing my own plugins instead of using other people’s.
Think of this outside the context of programming and see if it makes any sense. How about building a computer. You go on Amazon–or wherever–and you buy all the pieces you need to build a computer. You get the computer and you start building it and someone comes in and goes:
No you can’t build a computer with pieces someone else made. You need to build all those pieces from scratch or you’ll never understand a computer and your computer will never run correctly! Here, let’s start with making a processor…
That doesn’t seem to make a whole lot of sense to me. Now, think of that in all other contexts such as cooking, painting, or IKEA furniture. Can you imagine that? I can’t think of any other places where this idea of thinking makes sense.
Reading dense or terse programming books is how a lot of people learn, but not me. For me personally, it discouraged me from programming because reading a book like The Definitive Guide–dense–or The Good Parts–terse–just wasn’t sticking in my brain and probably most of all, it wasn’t fun.
jQuery makes programming for new people fun, especially for people who know CSS. The first time you run $(’.foo’).fadeOut() you feel like a god damn wizard. You know what you start with in most programming books? “Lets do math! Here, type 1+1 into your console. It says 2! WOW! Wasn’t that fun!?”. No, it really isn’t fun at all and that’s the things those books cover. I learned concepts like, closures, inheritance, and more from breaking down jQuery, writing jQuery plugins, and asking people stupid question and having them explain and show it to me.
Everyone learns differently. There are absolutely people who use jQuery who don’t want to learn to program and just throw plugins at their problems. However, those are the same people who would be terrible programmers because they don’t want to solve programming problems, they want to solve design or client problems. So, instead of telling a new programmer playing with jQuery to stop and learn “real” JS first, offer them some book suggestions on vanilla JS or be there when they have those stupid questions. Even better, give them some project ideas with jQuery like making a plugin that involves those boring things like math such as a slideshow.
Let people learn their own way. Be careful. You could very well be discouraging a new programmer from ever even starting. It doesn’t matter what path new programmers takes as long as they end up at the right place in the end.