tufty
Posts: 1454
Joined: Sun Sep 11, 2011 2:32 pm

Re: Best first language

Fri Dec 30, 2011 4:04 pm

riFFraFF said:


Remember that you ultimate goal is not to create a C programmer, or a Java programmer or Python, BASIC or Perl - you are trying to create a problem solver. It's more important to give them a development environment that helps build that "theater of the mind" where all programming scenarios will be played out in their future. The richer the tools you provide them to do that with, the more productive they will be in adulthood.


This.  <applause>

raspberro
Posts: 5
Joined: Wed Dec 28, 2011 12:44 pm

Re: Best first language

Fri Dec 30, 2011 9:41 pm

I think the best programming language to learn is Ruby

tonycollinet
Posts: 38
Joined: Sat Dec 10, 2011 4:12 pm

Re: Best first language

Sun Jan 01, 2012 12:51 pm

Well I've just spent a day or so, teaching myself the  basics of python. (Bacground, embedded C many years back, and VBA more recently to automate some spreadsheet applications)

While I am not familiar with many of the alternatives, I am certain that python will be an excellent first language. As easy as

print "hello world"

for the first program - interactive like basic (just type and run), but can lead up to OOP, using e.g. pygame (which itself has the potential for motivating kids to code).

libreuniverse
Posts: 15
Joined: Mon Jan 23, 2012 7:30 am

Re: Best first language

Tue Jan 24, 2012 6:21 am

I don't believe educators are prepared to install a love of programming in anyone under University level, which is unfortunate because computers are even more magical in youth. But knowing that a "best" first language won't be used, here are my favorites:

In an ideal world where it worked more consistently across browsers I'd recommend JavaScript. There's nothing like implementing a sprite with a single line of code, then figuring out you can animate it with CSS and simple loops. It's not ideal for Pi, since it still requires a browser if we're being realistic, and which one, and plus if you want people to enjoy programming, don't start them with anything that touches CSS.

Scratch is easy and it's not a mere toy, but it feels like one and I can't imagine doing something useful with it, though it's capable. For absolute beginners of any age, you still can't beat Logo as a true beginners' intro to coding.

TurtleArt (Logo) is revolutionary (though not more than scratch is) in that it's visual but still blatantly code-oriented. PythonTurtle is a real Python IDE plus Python-like logo, relatively lightweight and not to be missed.

Python itself is the closest thing to BASIC in the 21st century, closer to the full list of advantages of BASIC than any modern version of BASIC is: it's friendly and easy to learn, it's interactive, it has integrated documentation, it's almost as ubiquitous as JavaScript, you can teach it to a 10-year-old who can still make good use of it when she's 25. You can use it for making games, Hello World's, automating tasks, writing interactive installers, website backends, everything but writing an operating system. Importing the component libraries to roll your own internet browser is more basic than BASIC was.

Pygame's need for "small" amounts of boilerplate to do simple graphics is unfortunate, which is one thing that makes PythonTurtle shine, but Pygame is still ideal for teaching. Sugar Labs uses Python and Pygame as the basis for its teaching environment, shell, source and applications. If you are considering programming classes for youth, and have not tried Sugar, you are missing your best possible inspiration. That's not to say you should use Sugar, only that you shouldn't be unfamiliar with it. It's not to say you have to use Python, but you should have a good list of reasons not to before you abandon the idea.

"Bloat" is a reason. Bash is not so unfriendly, but it looks like is, and if you won't be using Bash on a regular basis, you can do better for a first language. If you want to revive a flexible Ancient, forget COBOL, try tcl instead. It's easier to write gui apps in so-called "HTML5" or tcl/tk than any other language, although Bash (like DOS batch,) can always be made friendlier with the right set of utilities. Just for completeness, tcl/tk (especially the latter) is probably not what you recall. It's not as ugly as a pack of hyena's backsides, for example. But to each their own, and anyone that says otherwise is a hyena's backside.

Remember RPi is a DIY-friendly project, so any curriculum that doesn't encourage DIY (and DIYW) is missing something. Programming shouldn't even have courses, IMO, it should only have labs. Less like math courses and more like home economics. "Here's a goal, here are some ways to get there, go to it." Any course where that kind of environment isn't possible, has chosen tasks and languages too complex for an introduction.

One way to judge a really great programming intro is that even the other teachers can grasp it. Too many courses rely on the students to be more capable of learning than the teachers; you can choose "first" languages accordingly. Sit a handful of average instructors down and see which language they do the best with at first blush. (I don't like Ruby as much as Python but of course it's very good as well.)

miker1
Posts: 1
Joined: Tue Jan 24, 2012 8:10 am

Re: Best first language

Tue Jan 24, 2012 8:40 am

I think BASIC [ which is considered non-U these days] would be the best to start programming with for kids at Junior or Secondary education.

From the fun of producing their own programs they could then go onto something more complex.

All this stuff about structured code etc is ok once you have the person "hooked". When that happens, you can then start to introduce the finer details of coding.

My son is 14 and is so frustrated with "ICT" at school as it only teaches him how to use packages not how to create them.

BASIC would probably help the teachers too :>}.

[I started playing with stuff in '74 with a 6800 and toggles that my dad had got from USA, then real world COBOL in '79 and then the piece de resistance, the wonderful BeeB model B in '82]

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Best first language

Tue Jan 24, 2012 10:28 am

We do need to pick a default language for the educational resources which will accompany the Raspi. A lot of people have mentioned Python.

Just as an experiment, I tried Python for the first time yesterday, and I was impressed.

It can be used in interactive or file mode, so it is useful to get a quick response or for trying complex things.

It is fundamentally object-oriented, but you don't notice this in the beginning. You can use it just like BASIC if you just want to mess around with variables.

I like the dynamic typing. There is no need for kids to know in advance the difference between integers and strings. But when they try to add a string to an integer, they will learn something new.

The lack of braces for structure is strange for me, but a learner would not be worried by this. Indentation makes logical mistakes more obvious.

By the way, I know very little of modern languages. My background is assembler and scripting. I still think C is modern.

Somebody mentioned awk as a possible first language. This is one of my favourite scripting languages, but is not suitable for beginners. awk will seriously twist your mind.

libreuniverse
Posts: 15
Joined: Mon Jan 23, 2012 7:30 am

Re: Best first language

Tue Jan 24, 2012 2:09 pm

Processor languages like awk are probably better once a more multi-purpose language is learned. When I want to test an awk snippet, I have to pipe echo to it, even if the snippet is a single line to check a command syntax.

I could use BEGIN instead, but the final use won't, and I rarely use it that way, so I'd have to stop and think about something unrelated to the task at had. If people are going to start with a compact, weird language, they'd get more out of tcl or Bash, which would lead into awk very nicely, and either one would let them do more. Of course any Turing-complete language can be used to teach programming, the question is whether you want students to have to stand on their heads while they learn. I love awk, but they insist the name comes from an acronym of author's names, when the real etymology is so much more obvious.

ofrxnz
Posts: 5
Joined: Sat Jan 21, 2012 2:59 am

Re: Best first language

Wed Jan 25, 2012 4:44 am

I personally would introduce Python first.  For a first taste, its clean, quick and useful.  It exposes you to data structures and program structures (OO, procedural, etc) without bogging you down in theory or waisting your time (like VB does).  To be honest, it is the only language I have been able to really hammer out something useful without cracking the manual, plucking hairs or ever getting lost in someone else"s code (i hate creative programmers that make opaque code and forget others will have to maintain their code)

Soon after students become useful in python, I would quickly expose them to C++.  It may not be a full course, but it is necessary to understand what is under the hood of the fancy languages like Python or Java.  Also, Python easily latches on to C++ libraries when ever it needs heavy lifting.  A robust C++ module would also help students learn about pre-compiled languages.

After they get the basics down in Python and C++ it should be student choice.  Some will go for the web languages, some will choose heavy graphic work, some will choose desktop applications and some will choose kernel modules and what not.  (yes, i know those are not languages but those are how the peeps i graduated grouped up)

My first language was VB (waist of time) my next language was Java.  I would actually consider JAva a middle road between Python and C++.  Java was useful but I have reservations about making it a primary education language.  On an ARM platform (or any other platform) its a big fat bloated pig.  IMHO, Java is bogged down in politics,  has an identity crisis and has been forced do into applications it should have never touched (think blue ray players) and oracle is making it worse…..java doesn"t know what it wants to be and it shows.

bobba_dwj
Posts: 14
Joined: Sat Jan 21, 2012 6:06 pm

Re: Best first language

Wed Jan 25, 2012 1:21 pm

I would very much agree with ofrxnz.

Although I am more experienced with C and C++, I would recommend Python as an introduction to programming.  It is a clear and concise language, free of much of the unnecessary syntax that plagues other languages.  It is also a serious language that is used throughout the computer industry (and its creator works for Google).  It can be used for scripting, testing, web programming, data processing, text processing or creating GUI's with ease (GUI toolkits include tkinter, which is built-in, wxPython, PyQt and PyGtk).  It is also known as being "supplied with batteries", as there is a huge amount of functionality and modules that you can use from the off.  It is supplied as default on Linux and Mac operating systems, and can be installed easily under MS Windows.

It also has the advantage of being able to work in an interactive mode, so that you can experiment very easily without having to worry about the edit&save-compile-link-run cycle, that would otherwise slow you down with more traditional compiled code.

Tutorials, whether available on-line or in paper form, or as videos, can be found from many sources.  There are a few more difficult topics, of course, but they are generally not necessary.  http://stackoverflow.com/ is a great resource for these more tricky questions.

Jaseman
Posts: 302
Joined: Tue Jan 10, 2012 12:59 pm
Contact: Website

Re: Best first language

Wed Jan 25, 2012 1:35 pm

I quite fancy having a look at OO-COBOL - just as a curiosity.

brian_reiter
Posts: 35
Joined: Fri Jan 06, 2012 7:49 am
Contact: Website

Re: Best first language

Wed Jan 25, 2012 3:44 pm

COBOL to teach typing skills I suppose, OO-COBOL is certainly curious. Seriously I'd go for Python, Lua or even BASIC initially. Pull in C etc. later. In any event go for a mix of pardigms, it can't hurt and not everything is coded in OO.

Even BLISS might be interesting for the adventurous (although I don't know if it exists on linux, although you could use simh to emulate a VAX and then run it.).

TheEponymousBob
Posts: 205
Joined: Mon Jan 02, 2012 5:05 am
Contact: Website

Re: Best first language

Wed Jan 25, 2012 7:38 pm

riFFraFF said:


Remember that you ultimate goal is not to create a C programmer, or a Java programmer or Python, BASIC or Perl - you are trying to create a problem solver. It"s more important to give them a development environment that helps build that "theater of the mind" where all programming scenarios will be played out in their future. The richer the tools you provide them to do that with, the more productive they will be in adulthood.



Absolutely. The language our development team uses most is English. Well, English plus HTML, which we use to write analysis/design documents, test plans, project plans, code review packs, release prep and all the other important stuff. Somewhere in the middle of all that we turn bits of it into various programming languages, but that"s the easy bit.

Of course it"s got to be learned, and RPi will be a great tool for doing so, but learning languages shouldn"t be done at the expense of learning to program.

libreuniverse
Posts: 15
Joined: Mon Jan 23, 2012 7:30 am

Re: Best first language

Thu Jan 26, 2012 6:50 am

wizbit said:



- Turtle Art in sugar (with note that sugar may be a pig to get working under RPi)


I think you can run it standalone now.

Doogle
Posts: 16
Joined: Sun Jan 29, 2012 5:55 am

Re: Best first language

Sun Jan 29, 2012 12:34 pm

I would agree with the earlier suggestion of Assembler. Of course it doesn't have to be ARM Assembler as it's quite possible to create a cross compiler for, eg the 6502 instruction set, which IMHO, was / is fairly straightforward.

As has also been suggested, I'd leave OOP until the students have got a good grasp of bits, bytes, structure of code, and most importantly, the ability to anaylse a problem and express the solution in a logical manner. Perhaps the first 'language' should be pseudo-code. I don't know what analytical techniques are taught today, if any, but Flowcharting was a good technique to start with (certainly for the under 10s), moving on to something like the Jackson Method for a structured approach - ah those were the days.

Like others here, I contribute to Programming Forums and see a disproportionate number of requests for help such as; "I need to write a Program to do "X" but I don't know where to start" and others having coded themselves into a 'dead end' because they started to write code before analysing the problem.

andyl
Posts: 265
Joined: Tue Jan 10, 2012 11:05 am

Re: Best first language

Sun Jan 29, 2012 2:46 pm

Doogle said:


I would agree with the earlier suggestion of Assembler. Of course it doesn't have to be ARM Assembler as it's quite possible to create a cross compiler for, eg the 6502 instruction set, which IMHO, was / is fairly straightforward.


A quick note - the language is assembly language and the tool to convert it into something that runs is an assembler.  So you need a cross-assembler rather than a cross-compiler.  Actually it might be better to just have a 6502 emulator and use a standard 6502 assembler.  I think as an approach to learning assembly language it can be alright - but you just ain't going to be productive with assembly language.  You aren't going to be producing wonderful little programs that you will be proud to use (at least not in the normal confines of time at school).

Doogle said:


As has also been suggested, I'd leave OOP until the students have got a good grasp of bits, bytes, structure of code, and most importantly, the ability to anaylse a problem and express the solution in a logical manner. Perhaps the first 'language' should be pseudo-code. I don't know what analytical techniques are taught today, if any, but Flowcharting was a good technique to start with (certainly for the under 10s), moving on to something like the Jackson Method for a structured approach - ah those were the days.


Oh dear. Pseudo-code and flowcharts are not really used anymore, or at least I have never found them to be IME. Which Jackson method - Jackson Structured Programming or Jackson Structured Development? Again not used much.

Teaching people how to think about a programmatic solution to a problem is good, but I don't see the need for pseudo-code / flowcharts. A good turtle program (either logo or something else) can teach that. Also part of it is just knowledge gained from use, and a big part is just being lazy (in the way Larry Wall defines it).

A good first step would be for people to explore inquisitively - for example I've seen people layout stuff in Word using tabs and then drawing lines on afterwards with a pencil to do a table - even though Tables exists right there on the menu bar. No one had ever taught him about that submenu so they had never experimented to see what it would do.

My advice to any new programmers would be


Everything is a puzzle / game.
Don't just do the exercises you are given / read. Make up your own.
As you write more programs look for patterns.
Read some good code from time to time. Don't copy it. But learn from it.
It is easier if you have a friend learn at the same time.
Keep going - you aren't going to become a programmer in a week. If you get stuck ask - there are plenty of people who will give advice.

Doogle
Posts: 16
Joined: Sun Jan 29, 2012 5:55 am

Re: Best first language

Sun Jan 29, 2012 6:00 pm

'Cross Assembler' or 'Cross Compiler' really doesn't matter, it's just the difference whether the code creates the Op codes (Cross Assemebly) or the Mnemomics (Cross Compiler). You'll have to excuse me, as I started Computing in 1974, so some definitons have changed their meaning since then.

I think I'd take issue with the 'productivity' comments though; in a learning environment, productivity is not the goal. Understanding what's going on is (IMHO).

Productivity vs Language is a never ending debate mainly because there are too many ways to define 'Productivity' in the Real World. I could say that I was very 'productive' in creating soultions using VB, others will argue that they are equally 'productive' using Pearl or C or C++ or Java or .Net or ... well you name it. I can create a multi-user Client / Server Application in VB in about 5 minutes and I suspect a 'C' programmer could do it in 4 or 6 minutes. So what ?

I would suggest that a 'good' Assembler programmer is as 'productive' as a 'good' Pearl Programmer in terms of time to market, quality and ease of maintenance (which IMHO are the Critical Success Factors)

The reference to Jackson was an example; (I meant Structured Programming) the point I was trying to make was the importance of analysis of the problem prior to starting to code.

I totally agree with your advice to new programmers, but there is a built in assumption that they can already write programs. I'd like to see problems like; 'write down the  steps required to make a cup of Tea'. On the face of it, it looks quite simple, but I would suggest that, for a 10 year old, it's not as easy as it looks.

The fact that Flowcharts and Pseudo-code are no longer 'in vogue' doesn't make them useless, shapes like circles, squares and diamonds have been around for a long time.

To draw a parallel; is Differentiation from First Principles still taught at School or is that left for University?

OK I'm old...........

ceti331
Posts: 13
Joined: Sun Jan 29, 2012 10:45 pm

Re: Best first language

Sun Jan 29, 2012 11:04 pm

My vote would be python* , has to have an old style REPL !

Asside from that what sort of libraries would it access by default ? a lot of the learning curve in modern programming is the libraries.

The joy of basic in the old days was you could get lines onscreen straight away and start thinking about geometry, without having to figure out how your program's window will respond to operating system events...

andyl
Posts: 265
Joined: Tue Jan 10, 2012 11:05 am

Re: Best first language

Sun Jan 29, 2012 11:24 pm

Doogle said:

I think I'd take issue with the 'productivity' comments though; in a learning environment, productivity is not the goal. Understanding what's going on is (IMHO).
I wasn't really talking about productivity in the real world sense.  But if you are to capture the enthusiasm of the young you need to get them producing something they can be proud of.  Having many hours of 'theory' and flowcharting and pseudo-code before they are allowed to touch a real programming language is going to turn off more kids  then it will turn on.  The best way to learn programming is by doing.

I would suggest that a 'good' Assembler programmer is as 'productive' as a 'good' Pearl Programmer in terms of time to market, quality and ease of maintenance (which IMHO are the Critical Success Factors)
I doubt that very much. The truth is, apart from embedded work, very little is done in assembly language these days. Why? Because companies have found that using high-level languages reduce the number of bugs, reduce the development time, and increase maintainability.


To draw a parallel; is Differentiation from First Principles still taught at School or is that left for University?


Been a long time since I was at school, but I would guess that is A level these days.

dicktonyboy
Posts: 6
Joined: Wed Jul 27, 2011 10:40 pm

Re: Best first language

Sun Jan 29, 2012 11:53 pm

Why not start with SQL?  High level instantly testable?

Richard Wenner

Benedict White
Posts: 224
Joined: Sat Dec 24, 2011 12:24 am

Re: Best first language

Mon Jan 30, 2012 12:08 am

dicktonyboy said:


Why not start with SQL?  High level instantly testable?

Richard Wenner


How many games can you write in SQL?

ceti331
Posts: 13
Joined: Sun Jan 29, 2012 10:45 pm

Re: Best first language

Mon Jan 30, 2012 4:47 am

agree assembly mostly a waste of time these days; part of the point of RISC ISA's like the ARM was synergy with advancing compilers.

raw C is low level enough, and would contrast immensely with Python for a style of programming.

Its' better to put man hours into improving compilers than it is to write code in assembly.

Intrinsics in C (e.g. as used for SIMD programming) are a good enough for the cases where assembler would be used.

User avatar
johnbeetem
Posts: 944
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Coast
Contact: Website

Re: Best first language

Mon Jan 30, 2012 5:12 am

ceti331 said:

It's better to put man hours into improving compilers than it is to write code in assembly.
Intrinsics in C (e.g. as used for SIMD programming) are a good enough for the cases where assembler would be used.


IMO it's very hard to improve a compiler unless you've been a compiler long enough to master assembly language.  I don't recommend ASM for everyone.  But I do think that all computer scientists should master assembly language as a basic scientific principle and that all embedded developers should likewise master it so they know what the memory and processing resources of an embedded system are really doing.  While C does use high-level language notations, its run-time model is machine language and when bugs occur they may require machine-language thinking to resolve.
I also think it's a real thrill to be programming (on occasion) down at the bare metal and be one with the computer.  YMMV

ceti331
Posts: 13
Joined: Sun Jan 29, 2012 10:45 pm

Re: Best first language

Mon Jan 30, 2012 1:45 pm

ok even if you aren't going to code in assembly, what IS very useful though is being able to see the assembly compiled by a C program.

knowing when local variables cache in registers & what the compiler can assume is absolutely needed.

Of course these days a lot of the performance issues now come from memory caching (both data & code) which can't even be seen in the assembly output.

Thing with assembly is the performance rules can change so much between chips even in the same series.

curious, does this arm chip have SIMD (neon?)

User avatar
johnbeetem
Posts: 944
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Coast
Contact: Website

Re: Best first language

Mon Jan 30, 2012 2:28 pm

ceti331 said:


curious, does this arm chip have SIMD (neon?)


RasPi ARM1176JZF-S core does not have NEON SIMD.  According to the RasPi wiki, it does have VFP.  NEON is only available with ARM Cortex-A5(optional)/A7/A8/A9(optional)/A15.

dicktonyboy
Posts: 6
Joined: Wed Jul 27, 2011 10:40 pm

Re: Best first language

Tue Jan 31, 2012 11:23 am

Benedict White said:


dicktonyboy said:


Why not start with SQL?  High level instantly testable?

Richard Wenner


How many games can you write in SQL?



Few agreed but for grabbing the attention of new students the command line interface to SQL can almost be discursive.  Make the semicolon stand for "Please" - otherwise nothing happens and it could be the Turin test all over again (well close).   Once the 'newbie' is delighted by the instant feedback you can then throw all these commands into PHP and you are away down the slide of coding.

Yum (group) install  PHP, MySQL and http - and there is a playpen for life.

Return to “The Staffroom”

Who is online

Users browsing this forum: No registered users and 3 guests