7 ms·
One huge mistake I think a lot (but not all of) the bootcamps are making is taking the easy route of simply using JavaScript to teach both frontend and backend.
by sam0x17 5y ago
One huge mistake I think a lot (but not all of) the bootcamps are making is taking the easy route of simply using JavaScript to teach both frontend and backend. JavaScript is a TERRIBLE first programming language. I usually have to spend 2-3 sessions per mentee explaining the idiosyncrasies of JavaScript, where some of the OOP concepts actually come from, and how things work in other languages to put into context the really terrible implementation of these features in js. Main reason being, I tell them, things that run in the browser are different from almost every other runtime environment because on the web it is extraordinarily difficult to deprecate/change things, because if you do then X% of the web breaks. This is why we still to this day have things like "quirks mode" etc. Once a behavior is out there in the wild, you basically have to support it as a browser, and you can drop support for it virtually never. This process has led to the JavaScript we have today -- mountains of functionality dumped on top of a backwards compatible core riddled with idiosyncrasies and poor design decisions that didn't become poor until they were left unchanged for ~20 years.
Anyway, my point is, it's very important to make sure students understand that their confusion surrounding how things are structured in JavaScript is natural, and that they can (and should, on their own preferably) look forward to learning more stable/sensical languages in the near future. It's a shame I have to do this for my students instead of the course just doing it for me, however.
- torben-friis 5y agoWhy not teach them functional concepts (map, filter, reduce, etc are well supported and comfortable) and leave the horrors of Js classes alone?
- sam0x17 5y agoThey run into enough problems with objectness just learning map / filter / reduce. I've seen so many angry / frustrated students trying to use a for each loop to iterate over an Array only to find that although this works in most languages, in js these just loop over the fucking KEYS of the object (which now opens up the discussion about how `obj[1]` is not a key but `obj['hey']` is a key and the differences therein.
- woah 5y agoKind of crazy that nobody taught them to use "for of" instead of "for in". Maybe make a linter that marks "for in" as a syntax error
- skrebbel 5y agoI wonder if there would be a market for a "stricter mode" version of JavaScript that simply does not allow you to use the legacy features that are so quirky. Eg just disallow for...in to be used at all (but allow for...of) No iterating over objects except via eg Object.entries No inheriting objects from other objects (ie no prototypal inheritance) No var No anonymous functions (ie only named function declarations or lambda/fat-arrow expressions, to avoid `this` binding gotchas) Etc I think the only real big blocker to a thing like this is that it'd need tooling (eg a transpiler that injects error throws at appropriate places), and tooling is another big hairy thing that makes JS less approachable for beginners.
- threatofrain 5y agoThat's something which can be done at build time, such as through a linter.
- skrebbel 5y agoSome of it would need to be runtime checks to be fully consistent and unsurprising, I think.
- abecedarius 5y agoI haven't tried it, but somewhere in that neighborhood: https://github.com/endojs/Jessie https://github.com/endojs/Jessie
- enahs-sf 5y agothese should be expert mode only features that have to be unlocked as opposed to default. So easy to shoot yourself in the foot. Kinda fun if you've been doing it for a while though.
- 5y ago
- threatofrain 5y agoJS is a small language when you consider the core of constructs which are in use today. I'd ballpark JS to be around 80-120 "constructs", which will differ based on how you divide semantic and conceptual units of learning. I'd ballpark Go to be around 80-120 as well. A junior developer who is just learning how to code will not deal with all of JS historical baggage; they will deal with historical JS when joining a large historical codebase. A junior developer will also not be dealing with the different quirks arising from different browser runtimes. These are concerns for businesses who already have products. But a Student does not encounter these things while learning and writing greenfield apps. Otherwise we are advocating for a student to learn an additional "learning" language. That sounds ideal for a 4 year university program.
- sam0x17 5y agoExcept they will actually deal with all of it. First question I get is usually "what is var" followed by "when do I use arrow functions and when do I use normal functions" shortly followed by "why does this code work with a normal function but not with an arrow function" or "why does my code using classes and arrow functions not work on [ancient browser some family member has for some reason]?". I'll also get numerous questions about whether it is a good practice to do things like `x++` where `x` is a string because they noticed that it happens to work and legitimately want to know if this is good practice / by design (oof). Don't even get me started on the "equality in js" discussion. The key problem with js is the relationship between objects and functions is extremely confusing. You end up having to explain associative arrays, and spend 30+ minutes doing some hand-waving to even begin to describe what an object actually is in JavaScript. Then they get it. Contrast that with something like Java or even Rust where, despite the other complexities, it's pretty clear what the data is and how it is stored.
- ksml 5y agoThat sounds like a pedagogy problem, not a language problem. From my experience [1], students learn JS just fine as a first language, as long as the learning process is structured well. Every practical language has its quirks, and no one learns a programming language by learning all the quirks at one time. You can be productive in JS without understanding all of the quirks, and then build up to that later. When you're teaching, you should be enabling the student to do one more thing that they couldn't do before. If you're spending 30+ minutes trying to explain what an object is, you're trying to do way too much. You don't need to have a 100% complete and correct understanding of Javascript's object model to use objects. > Contrast that with something like Java or even Rust where, despite the other complexities, it's pretty clear what the data is and how it is stored. That's nonsense. Particularly with Rust, now you're deep in the weeds of pointers, stack vs heap vs other segments, and borrow checking rules. [1] helped design a JS class at Stanford for first-time programmers. Also designed an intro Rust class.
- notJim 5y agoI agree with this. It seems like they should start with python or even java to learn the basics in a relatively straightforward environment, but one that also implements a lot of constructs in a fairly standard way. They also both have well-documented and large standard libraries. I feel like they should spend a bit of time on that, and then switch to JS, which is relevant for so many jobs these days.
- woah 5y agoPython and Java are probably just as bad as Javascript. I started with Javascript (and self taught) and never had many issues. Javascript is very easy to get running and play around. With Java you will spend a huge amount of time on pointless ceremony that can seem important to a beginner but is really pedantic enforcement of programming preferences from the Java designers (everything is a class for example). With Python you have a pretty easy language but the dependency management situation is a disaster. Python in a Google Colab notebook where everything is pre-installed could be good.
- notJim 5y agoI agree that Java has a lot of silly boilerplate, but I don't see that as a huge hurdle. Most people will use an IDE that populates it for you. Keep in mind this is for a complete beginner. Dependency management with either Java or Python is PITA IMO, but my idea would be to avoid dependencies during this initial phase of learning the basics.
- ghaff 5y agoPython seems to be the goto for intro programming courses at a lot of universities today. I assume that bootcamps are more focused on Javascript because front-end wbdev is probably more marketable than Python in isolation.
- legerdemain 5y agoA number of bootcamps, at least in the Bay Area, teach full-stack web dev as JS + Django (General Assembly) or JS + Rails (Coding Dojo). On one hand, it seems like an antiquated curriculum. On the other hand, a surprising number of mid-sized companies still run on Rails or Django. (I don't comment on the usefulness of Rails and Django to small companies and individuals, because they're not the ones hiring bootcamp grads.)
- ciberado 5y agoMy experience is quite different: I used to love to teach introductory courses using JS. Using an omnipresent and familiar tool like the browser as the IDE and the super-powerful debug system integrated on it is a big plus for newbies. Also, the language has clear defects, but they irritate much more the experienced folks than the rookies (that are not so surprised when encountering inconsistencies). Oh, and I have also trained many people using Java, and I initiated my dev career with Java 0.99 (or 0.98?). Most of my courses started with the sentence "let me tell you a joke: public static void main(String[] args)" :)
- acjohnson55 5y agoI tried to teach myself Java 1.1 when I was a preteen and I gave up after not being able to get Hello World to compile. If you actually want to understand the incantation without any programming context, there are so many constructs to unpack in that little program.
- sam0x17 5y agoIt was great in the ES5 days. Times have changed.
- whakim 5y agoYes, javascript has some quirks. But most bootcamps are trying to get their students from "zero to employable developer" in a very short amount of time, and "employable entry-level developer" is almost always synonymous with "employable entry-level web developer". Given that mandate, you basically have to teach people the basics of web applications, which means talking about what happens on the client, which means javascript. And at that point, it's pretty reasonable to not spend your limited time teaching them a whole other language, especially because Node is extremely popular at the kinds of places your students are likely to work. Also, most languages have quirks. What are you going to teach them? Python, which also has almost 30 years of baggage? Java, which requires you to spend significantly more time to produce basic functionality? Haskell, so they can gloat about the power of purity and monads on Hacker News? I understand that javascript might not be the ideal intro language in theory. But I think it probably is the best one in the bootcamp specific use case.
- AlchemistCamp 5y agoBetter yet would be Ruby. It's much more beginner friendly and is a thoroughly consistent OO language—i.e., everything is an object, including numbers and strings. Ruby's also got a much better web dev story, which is good for junior devs (without ML and/or infrastructure backgrounds) who are looking to enter the market. After learning Ruby, either JS or Java could be a great 2nd language.
- whakim 5y agoI certainly don't think Ruby is indefensible. I think it's possible to get a lot done with Ruby, and I think that's very valuable for new developers who need to learn a lot in a very limited amount of time. But I don't think that addresses the elephant in the room: junior web developers have to deal with the frontend, and that means javascript. So why waste (very limited time) teaching them a second language too? > It's much more beginner friendly and is a thoroughly consistent OO language—i.e., everything is an object, including numbers and strings. This sort of thing occurs to you and me and makes sense because we have a broader understanding of software engineering. In practice, I just don't think "everything is an object" means much to someone who's a month into a bootcamp.
- acjohnson55 5y agoJavaScript is a totally reasonable first language, considering it's unavoidable in web dev. As a former teacher, I think you might consider the way your own context might color your messaging to your students, and how their context might be completely different. They don't need to understand JavaScript, in all its layers and quirks. They just need to get simple things done to begin to develop an intuition for the platform.