Page 1 of 1

Re: Using Node.js as an educational language?

Posted: Sun Jan 22, 2012 3:31 pm
by wr1472
What do people think of using Node.js on R-Pi to teach kids how to build software?


It's easy to install and get running
No fancy editor required
Has a REPL
Javascript is easy to learn (little syntactic sugar) and can be quite powerful
Node's event-based callback model is a refreshing change to a lot of other paradigms, and I suspect would run nicely on R-Pi resources.
Can write networking programs in a few lines of code; as kids these days are all into this new fangled t'interweb it would be a great way of grabbing there attention by building stuff thats easy to get out there. 
Also think it's important to make coding as social as possible, for example you could carve up an application into lots of discrete modules that smaller groups in class implement separately, but they all have to ensure works correctly together - team working skills.

Thoughts welcome.

Re: Using Node.js as an educational language?

Posted: Sun Jan 22, 2012 9:58 pm
by hilltop
I'll definitely be running Node.js on my RPi, along with JavaScript syntax highlighter for nano

I think that JavaScript has really leapt to the fore with recent JIT compiler developments - one reason for choosing Node.js/V8 not mentioned above is pure speed.

Web development is a great introduction to programming as it can be interactive, teamwork-based and easily shared.  The 'old' Win PC's on the school network would still have their use as 'client-side' machines

Once the basics of some HTML boilerplate code have been mastered, I think it is easy to underestimate the advantage of having the same language in the web browser and the server.  I know that many of the members of this forum describe learning several languages but it's easy to forget the effort involved of 'unlearning' techniques discovered.  Concentrate on one, I'd say, and for web that means JS.

The only point I'd make against Node.js is its rapid state of development, as it's comparatively new, so some aspects may become out-of-date soon.  Having said that the V8 engine it's based on is pretty stable technology.

Re: Using Node.js as an educational language?

Posted: Mon Jan 23, 2012 8:16 am
by tufty
hilltop said:


I know that many of the members of this forum describe learning several languages but it's easy to forget the effort involved of 'unlearning' techniques discovered.  Concentrate on one, I'd say, and for web that means JS.


Not arguing against Node.js, or Javascript either, for that matter, but there's very good reasons for using multiple languages as opposed to sticking to just one.

It's only when you start learning how and why languages differ that you start to get a full understanding of what the languages themselves actually *mean*.

As a more concrete example, consider the differences between Javascript's prototype-based OO compared to a implementations based on inheritance, composition or delegation.  If (like most C++ programmers) you're unaware that the other options even exist, it's really hard to see the failings of the paradigm you're chained to - "if all you have is a hammer" and all that.

I'd certainly argue against teaching programming "for the web".

Simon

Re: Using Node.js as an educational language?

Posted: Mon Jan 23, 2012 5:24 pm
by hilltop
tufty said:


It's only when you start learning how and why languages differ that you start to get a full understanding of what the languages themselves actually *mean*.


Not disagreeing, but how many programming languages would you consider reasonable for a normal person of compulsory-education age to be expected to encounter and be productive in?

(My answer: 4, Logo/Turtle because it's simple enough for a 5-year-old to conceptualize, Scratch (7-12) because of instant results and visual appeal, Python (11-14) because mediocre programmers can write good programs easily in it, and JavaScript (14+) because it's the only in-the-browser language, and now, because of Node.js, can be server side too.)

I think the 'full understanding' you describe is more degree level, not even A/A2.


I'd certainly argue against teaching programming "for the web".


May I ask why?  Just because ICT lessons may have consisted of "okay this term you're going to learn how to write a simple static webpage" doesn't mean that this is all programming for the web can be.  My arguments for include: discussion of data security and privacy, experience with non-deterministic program flow (event-based programming), use of streaming protocols, the fact Windows 8 will have HTML-scripted apps, increasing shift to IaaS and the Cloud etc.  Downloadable/purchasable desktop applications are pretty old hat these days, TBH.

As an example, a LAN-wide peer-to-peer instant messaging console app (the best of the group's efforts tested to destruction...competitive programming!) is probably less than 50 lines in Node.js.  Getting graphics on the screen is what arcade games did in the 80s.  Things have moved on, stay relevant I say.

Re: Using Node.js as an educational language?

Posted: Mon Jan 23, 2012 7:30 pm
by tufty
hilltop said:


tufty said:


It's only when you start learning how and why languages differ that you start to get a full understanding of what the languages themselves actually *mean*.


Not disagreeing, but how many programming languages would you consider reasonable for a normal person of compulsory-education age to be expected to encounter and be productive in?


In the course of learning programming, I'd suggest that exposure to a well-selected 4 or 5 (i.e. enough to be able to "read" the code) would be more than sufficient, with proficiency in 1, maybe 2.  Which languages to choose, of course, is a whole other festering heap of lutefisk.

Yes, a full understanding is certainly degree level stuff, but exposure to more than one language can help a certain level of that understanding, the actual science bit of computer science, to seep in.  In the same way that O levelGCSE physics paves the way to a fuller understanding at A level and likewise for degree and onwards.

Without at least some of that understanding, you end up simply producing code monkeys; they might be very proficient at doing one particular task, and even employable for that task, but they won't ever be true programmers.



I'd certainly argue against teaching programming "for the web".


May I ask why?  Just because ICT lessons may have consisted of "okay this term you're going to learn how to write a simple static webpage" doesn't mean that this is all programming for the web can be.


Oh, of course not.  Indeed, the umbrella of "web programming" can cover a great number of very advanced topics.  It's just that I'd argue against teaching programming for any one "task" and argue for teaching programming (or rather, computer science) overall.  If you aim for teaching "for the web", all you produce is web programmers.  And we only have to look at the quality of certain forums *coff*simple:press*coff* to know what that's worth

Simon

Re: Using Node.js as an educational language?

Posted: Mon Jan 23, 2012 9:19 pm
by wr1472

As an example, a LAN-wide peer-to-peer instant messaging console app (the best of the group's efforts tested to destruction…competitive programming!) is probably less than 50 lines in Node.js.


Think more like 10-15 lines. This I think is the beauty of using this, very quickly you can produce something that has a practical use. It's function is collaborative, the code you write will minimal boilerplate code.

I'm not saying it's the best language out there (or even the only language you should use to teach), but it would be a great way to try and capture kids imaginations without using a toy language.

Also I think you can't not teach children about the web and how it works - it's such a big part of computers nowadays.

Re: Using Node.js as an educational language?

Posted: Mon Jan 23, 2012 9:23 pm
by igordsm
I am strongly against using Javascript for education. It's a tricky language with MANY dark concepts that even seasoned programmers find hard to understand. If you don't believe me, tell me you haven't spent a lot of time in a situation like this

for (int i = 0; i < n; i++) {

btn.addEventListenet(function() {

alert(i);

});

}

and wondered why the hell it always showed "n" in the alert box. Believe me, Javascript is NOT a learning language. I would recommend Python or maybe Lua for teaching, mostly because these two languages have the basic syntax very clean and without

Also, to be a good programmer you need to master the basics, and that is problem solving and algorithm creation and understanding. Things like sorting, matrix manipulation and string searching are fertile fields for teaching simple and complex algorithms. To make it more appealing you could use some motivation, like the ones used in the ICPC problems. Maybe mix these subjects with graphics and you can get something very interesting.

Re: Using Node.js as an educational language?

Posted: Tue Jan 24, 2012 8:21 am
by tomo
JavaScript is as complicated and as tricky as you want it to be (apart from simply being tricky because it's a typeless scripting language). On the other hand, it can be as simple as you want it to be. Don't want classes? Don't use them. You can easily live with functions alone or even without them. Want class inheritance? Use some library framework and you'll be o.k. Etc. Because of that, it's really easy to start programming with it. It's easy to do something and see it work. As much as I tend to swear and curse JavaScript while I work (mostly when working under deadlines and rising pressure), I actually think it's a little sugar to play with. Of course, a good IDE with syntax highlighting, real-time error checking etc. helps (would help) a lot. JS is perhaps still a bit short here, but that's changing.

Re: Using Node.js as an educational language?

Posted: Tue Jan 24, 2012 10:55 am
by SeanD
It might have been nice to take an RPi along to NodeSummit tomorrow to show it off.

Re: Using Node.js as an educational language?

Posted: Tue Jan 24, 2012 11:17 am
by piglet
igordsm said:


wondered why the hell it always showed "n" in the alert box.


I've done a lot of Javascript - and you confused me until I realised you meant the number n, not the letter "n".

Re: Using Node.js as an educational language?

Posted: Tue Jan 24, 2012 12:03 pm
by hnsr
One thing that webdevelopment as a learning method has going for it is that (if properly taught) it forces one to properly seperate data/content (HTML), presentation (CSS) and behaviour (JavaScript). I feel that If there's anything that sets a good developer apart from a bad one (other than knowing your algorithms/data structures) is keeping those things seperated (MVC and all that).

It's also relatively easy to get started with it and it produces instant results; all you need is a text-editor, a browser, and you're golden

A programming course should probably not solely be based on this but it may be a good starting point and serve to pique students' interests before moving on to whatever might be a good educational/general-purpose programming language.

Re: Using Node.js as an educational language?

Posted: Tue Jan 24, 2012 7:10 pm
by hilltop
tufty said:


Without at least some of that understanding, you end up simply producing code monkeys; they might be very proficient at doing one particular task, and even employable for that task, but they won"t ever be true programmers.


I think the insight would come to the more able students after experience with a few languages over the course of their schooling.  I'd caution against worrying about preparing someone for a CS degree though, since the vast majority will not do one.  Bad (programming) habits that are difficult to unlearn should be avoided, though.


It"s just that I"d argue against teaching programming for any one "task" and argue for teaching programming (or rather, computer science) overall.  If you aim for teaching "for the web", all you produce is web programmers.


Related to my reply above, it's clear that the time allocated to (new-)CS teaching will be limited, so thinking in terms of one or at most two hours per week I think that two-three years would be needed learning to program in one language to be truly beneficial.  Such teaching would need to be highly targeted at a specific Key Stage to become part of the National Curriculum (unless it's a Free School).

Back to the point of web programming, I'm not advocating JS(/HTML/CSS) as a first language, but as an application of programming skills learnt earlier.  Obviously some will drop out and still be doing Scratch/Python at 16 under the scheme I propose above, but I'm hesitant to describe web programming as somehow inferior (in terms of underpinned learning) to 'real' non-quiche-eating programming, what ever that is.

Re: Using Node.js as an educational language?

Posted: Tue Jan 24, 2012 7:19 pm
by hilltop
wr1472 said:



Think more like 10-15 lines.



You don't know all the features I had planned

Seriously though, the point we're agreeing on is there is a lot less legwork done learning how to use external libraries and writing boilerplate/interfacing code than in an environment not designed from the ground up for network/sockets programming.

Flame bait: how many lines should a Level 10 GCSE coursework project be...

Re: Using Node.js as an educational language?

Posted: Wed Jan 25, 2012 5:03 pm
by raspberro
Nodejs is not a language.