Best first language

Drop in for a chat and a cup of tea

158 posts   Page 2 of 7   1, 2, 3, 4, 5 ... 7
by bradburts » Sun Nov 20, 2011 12:18 am
As has been said, depends on the teacher, the individual and application, there is no right way.
If I was starting with one of my kids then I would switch LEDs on & off using a script or make a 'C' program from the command line.
The problem these days is that its so easy to download, how then do you find something which is new and interesting to engage without a long development?
LOL PDP-11, toogle switches and punch cards, you were lucky! I had to hand build my Atom with a blunt soldering iron, if you told the kids today they would not believe you.
Posts: 341
Joined: Sun Oct 02, 2011 7:07 am
by tufty » Sun Nov 20, 2011 7:48 am
Quote from bradburts on November 19, 2011, 22:47
Imagine sitting in Eclipse, integrated to Subversion, hooked up with Mylyn to your feature requests and problem reports stored in Redmine.

Do I have to? I mean, really. Eclipse. Yuck.

Yeah, I know, that's flamebait, but one man's perfect tool is another man's hell. See the eternal vi / emacs "debate".

I really don't like eclipse. In fact, most of what I have to say about it is not suitable for publication. However, I do have an install, mainly for doing Android development. After all, use a tool you hate for a job you despise.

So. I just fired it up, absolutely clean, to see how heavy it is. This on a dual core, 2.6GHz machine with 8GB of ram. Over a minute to come up to a usable state, and with no files or projects open is using 324MB of memory. Makes emacs (eight megs and constantly swapping) seem a veritable lightweight, and emacs can do /far/ more than eclipse...

Quote from bradburts on November 19, 2011, 22:47
Open your task reminder, edit the Wiki, make the code changes and commit to repository all with clicks. You can learn a lot on the command line if you type it often enough but if, like me, you cannot remember half the commands without a search then go with an IDE!

If you can't remember 'commands', you might find programming in something like scratch more to your liking. Again, that's a bit snide. Sorry. But there's a reason for it. Let me explain.

Let's take, for example, use of gdb. it's terse to the point of impregnability, but amazingly powerful. Even starting it up can be a pain : indeed, I use a script to start it for debugging what I'm working on:
#!/bin/bash
make || exit
# Start up qemu in the background
qemu-system-arm -nographic -M versatilepb -cpu arm1136-r2 -m 256 -kernel ./bin/kernel.elf -s -S &
# And fire up the debugger
arm-none-eabi-gdb -nx -x "./gdbinit" --tui ./bin/kernel.elf

That saves some typing, after all (and I have no idea if I could even do that under eclipse). Here's the project gdbinit file, which sets up a split assembly/source view with an 8-line high command window, and connects to qemu (more typing saved):
layout split
fs cmd
wh cmd 8
target remote:1234

Once you're into the debugger, I have a more consistent environment than you do (after all, the IDE only opens up some of the debugger's functionality to "clickable" actions, the rest is deferred to a console interface just like mine), and, I would argue, in the common case, I'm probably faster, as I don't have to go mousing around for where the IDE has hidden the 'step over' / 'step into' buttons (let alone working out how to step over an assembler instruction), especially when the IDE moves the buttons around depending on how / what you're looking at alongside the debugger, and, in the common case of "step over / in" repeatedly, the terrible commands I have to remember are - erm - "hit enter" (and maybe "hit the 'up' key a few times, then enter")

A GUI may aim at being equivalent to a command line, but there are, inevitably, compromises made. Which is fine as long as you don't hit those compromises on a regular basis, but infuriating if you do. I use Macs, and have done for years (my "PC" has been a Mac since '87 or so), but Finder still enrages me enough that I considered it worthwhile paying for a replacement.

Oh, and for me, there's also the little issue that "mousing" makes my hands hurt.
Posts: 1372
Joined: Sun Sep 11, 2011 2:32 pm
by antiloquax » Sun Nov 20, 2011 11:58 am
I'm betting on Python 3!
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
by steveroush » Tue Nov 22, 2011 5:34 am
I believe in learning to swim in the shallow end of the pool, but not the kiddy pool.
If I was going to try to teach kids (multiple), I'd want a language that that was simple, yet reasonably powerful. I'd teach awk. The entire book is <210 pages, and you can learn the language in <100 pages.
It would be easy to give assignments that would tie to other classes.
Posts: 2
Joined: Mon Oct 03, 2011 1:34 am
by zog » Tue Nov 22, 2011 6:27 am
I think pascal or basic is a good choice. Basic is good because it is very forgiving.

Lazarus is a free pascal assembler for linux and emulates Delphi 7 pretty well.

I have studied a lot of computer languages and here is how I would rate any potential candidate.

The most important aspect of a computer language is speed of execution.
The second and equally most important thing is speed of development, or implementation.

Assembler - has the fastest execution time but is too time consuming to code, it is very unforgiving and hard to debug. Assembler should only be used for hardware drivers and blocks of code that need to execute very quickly.

C++ - Has a very fast execution time and a nice syntax, but for the beginner it is too complicated and unforgiving, it has a slow development cycle. It can also be hard to debug, care must be taken with pointers.

C - Same as C++, but without support for objects.

Pascal - A fairly easy language for beginners to learn, with a fast execution time and with an easy yet slightly quirky syntax. Pascal has most of the features of C++, it is possible to write device drivers in pascal as well as GUI programs.

Basic - This is a very easy language to learn, but the programmer is often limited by language constraints that lead to less than optimal programming solutions. The basic language is great unless you want to do some serious programming - this language is a bad choice for graphical games for example.

Java - This language has a similar syntax to c++, I don't like Java as I think its slow. However Java is very portable.

Java Script A browser language that has the same syntax as java.

Python I have looked at this and tried to think of a reason why I would like to use this language over something else and I couldn't think of one

Ruby - I have no experience of ruby so I can't comment.

.net languages can be cumbersome and clunky I am not a fan.

In my opinion best language choices for learning would be Pascal and Object Pascal, and then moving on to learn C and C++ and then finally assembler.

For primary school children a basic language might be more appropriate.
Posts: 96
Joined: Sun Nov 20, 2011 5:43 pm
by hamster » Tue Nov 22, 2011 7:30 am
I don't really think that speed of execution matters - after all, PHP seems to be ruling the web :-).

A beginner is going to write slow code even before they start using any large quantity of data. Remember things like simple bubble sorts, searching arrays without hashing, accessing data without indexing.

I would suggest that quick and easy access to graphics, mouse and sound resources would be the thing. Under Windows / WIN32 these are quite impenetrable to a new programmer. HBRUSH, HWND, DCs, canvases, .... Under Linux they are a little bit better, but OpenGL is still has quite advanced concepts just to get started. Oh, and something that supports garbage collection is a must (goodbye C/C++).

I think something like a media-rich Logo, or a "simple code to drive a virtual robot" sort of thing would be far more attractive way to introduce new coders to the concepts of serial execution, loops, conditional execution, variables, and so on.

If speed is what they are after, then the RaspPi is the wrong device :-)
Posts: 23
Joined: Fri Sep 23, 2011 10:20 pm
by Reg Whitton » Tue Nov 22, 2011 11:04 am
Ok, I concede that booting into an IDE is not going to be a good thing. I hadn't thought that one through. Perhaps, I was remembering how as a teenager I started in BASIC and after reading magazines broke out into Z80 byte code.

However, I would still like to see one simple-to-use programming option that is "just there" when this thing comes out of the box. So I guess I'm looking for an icon on the desktop of the default installation, which would start a simple environment for an appropriate language, and includes a staged tutorial. Hopefully, this language would ultimately allow GUI, graphic, external device, or even multi-threading programming without impacting someone in the early stages.

I think R-Pi will be most successful if kids can get it off-the-ground by themselves, get some easy pay-offs, and can gradually get into more complex stuff. Think of it as a trail of bread crumbs, where the rewards aren't spaced too far apart.

I guess having a "default" language would be contentious, but it would allow kids to get started, have a shared experience and inspire each other. And it wouldn't be the only way - I assume that any teacher will replace it with the best environment and tools to support their course.
Posts: 4
Joined: Fri Nov 18, 2011 11:16 pm
by winkleink » Tue Nov 22, 2011 11:37 am
I'm another one for Python. With PyGame to make the the graphics work easier.

I do think it is more about what is programmed then what you program in though.
Twitter:Winkleink
Google+: Winkleink
User avatar
Posts: 220
Joined: Mon Nov 07, 2011 9:12 am
Location: UK
by akauppi » Tue Nov 22, 2011 3:31 pm
Somehow I feel (hope) that the language kids will learn programming today is none of these. I'm currently going through some utterly clumsy-made Lua code at work, where the person has adopted the C++ thinking into Lua, and ... lost the whole point.
Whatever language one uses, it should be preferably used in the intended, natural way of the language.
What I do think matters for learning is instant graphics. That's what I got as a kid out of BASIC. That's really, really, really hard these days, in a portable way. Lua does not have that. Only JavaScript has (and some not-so-common Basic- or Logo-derivatives).
So how about Qt?
It's got the Qt Script - and QML - and one can drill down to C++ if one so wants. I'd throw that at kids.
Posts: 7
Joined: Tue Nov 22, 2011 3:04 pm
by Reg Whitton » Tue Nov 22, 2011 3:52 pm
Quote from akauppi on November 22, 2011, 15:31
... Only JavaScript has (and some not-so-common Basic- or Logo-derivatives).
So how about Qt?
It's got the Qt Script...


Looking around I see quite a number of languages have bindings to use Qt cough Python, and some nice game engines...
Posts: 4
Joined: Fri Nov 18, 2011 11:16 pm
by hlt32 » Tue Nov 22, 2011 4:40 pm
I would personally choose Python or Java.

http://code.google.com/edu/lan.....index.html is an excellent course for Python beginners.
Posts: 9
Joined: Sun Nov 13, 2011 4:13 pm
by jamesh » Tue Nov 22, 2011 5:07 pm
Quote from hamster on November 22, 2011, 07:30
I don't really think that speed of execution matters - after all, PHP seems to be ruling the web :-).

Oh, and something that supports garbage collection is a must (goodbye C/C++).
...clip...
If speed is what they are after, then the RaspPi is the wrong device :-)


I disagree. If you don't understand about memory allocation AND deallocation, and just assume the language does it for you, you are in for a very nasty shock when you need to start doing it. Of course, if you never intend to start doing it you would be OK, but you are limiting you employment prospects!

As for speed, the Raspi can be pretty quick when programmed correctly. And programming correctly (and efficiently) is part of the concept! After all, we have Elite on the BBC - 3D wireframe graphics with backface removal in 1MHz. Not bad!
Volunteer at the Raspberry Pi Foundation, helper at Picademy September and October 2014.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 12130
Joined: Sat Jul 30, 2011 7:41 pm
by abishur » Tue Nov 22, 2011 6:45 pm
Quote from jamesh on November 22, 2011, 17:07
Quote from hamster on November 22, 2011, 07:30
I don't really think that speed of execution matters - after all, PHP seems to be ruling the web :-).

Oh, and something that supports garbage collection is a must (goodbye C/C++).
...clip...
If speed is what they are after, then the RaspPi is the wrong device :-)


I disagree. If you don't understand about memory allocation AND deallocation, and just assume the language does it for you, you are in for a very nasty shock when you need to start doing it. Of course, if you never intend to start doing it you would be OK, but you are limiting you employment prospects!

As for speed, the Raspi can be pretty quick when programmed correctly. And programming correctly (and efficiently) is part of the concept! After all, we have Elite on the BBC - 3D wireframe graphics with backface removal in 1MHz. Not bad!



That point at which I ask, "Okay first language for a little kid, or first language for an adult?"

Now the OP is asking directly about first language for a kid, as such there gets to be a point where we're worrying too much about advanced capabilities :P

For a kid the big necessities are ease of learning and fun applications that can be done with the language and not necessarily "how does garbage collection work?"

Once they get hooked on programming and learn good programming fundamentals, then move them off of milk and onto steak ;)

For that matter, a good first programming language for a child is one that involves lots of parental interaction. Talk with them about, ask them why they did something one way, why did they choose it over another method, you know really get them thinking about what they're doing and praise their work.
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4313
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by johnbeetem » Tue Nov 22, 2011 6:54 pm
Quote from hamster on November 22, 2011, 07:30
Oh, and something that supports garbage collection is a must (goodbye C/C++).


I think teaching children to clean up after themselves is a good idea. Garbage collection can be a useful tool, but it gets in the way of understanding how computers really work.
User avatar
Posts: 942
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Coast
by hamster » Tue Nov 22, 2011 8:05 pm
I disagree. If you don't understand about memory allocation AND deallocation, and just assume the language does it for you, you are in for a very nasty shock when you need to start doing it


Real programmers don't use malloc() and free(), just sbrk(), :-)

I think dynamic memory allocation it is a nasty shock for everybody - doing linked lists in PL/1 stumped most of my class at Polytech.

With large address spaces and relatively large memory sizes I have had a bit of a paradigm shift when hacking code for fun. More allocating large chunks of memory that only a little bit may never use, and having multiple heaps that get tossed out all once, especially where the maximum size of data is known in advance.

For example, if you need to load a file into memory for processing random lines in small files at random times (e.g. a scripting language) do you:
    read in and build a linked list of lines
    read in and build a list of lines, and a table to index the start of lines
    memmap the file into memory, and then create a table to index the start of lines
    read in and store each line in an array with elements where each can store the maximum line length (e.g. 256 chars).


In some use cases the last is the most appropriate (esp if you need to paint a screen - you can just index it with "file[line][column]"). And to make things really easy, allocate the array with the number lines equal to the number bytes in the file - although the majority of entries won't be used they are only consist of untouched and unallocated virtual memory pages (unless of course you are silly enough to memset(array,0,sizeof(array)).

It won't actually cost that much memory, and will be far less buggy and will be much quicker to code.
Posts: 23
Joined: Fri Sep 23, 2011 10:20 pm
by Asgo » Tue Nov 22, 2011 8:28 pm

That point at which I ask, "Okay first language for a little kid, or first language for an adult?"

Even in the age classification of "for kids" there is still a wide range for the targeted goal with choosing a first language.
That could still differ from "creating an interest and giving first insights playfully" to "teaching the basic fundamentals without loosing oneself too much in the details"
For first something light, easy and flashy might be useful.
For the later almost any structured language can be used, since with each you can choose the level of detail for teaching and getting an instant graphic response isn't the only measure. ;)
Posts: 20
Joined: Sun Oct 30, 2011 6:10 pm
by Galaak » Tue Nov 22, 2011 8:33 pm
The best language is the one you have the willing and the energy to teach. Ok, there some tricky ones like C++ and almost everybody won't think about it for a kid. But if you like Python, BASIC, scratch, ... I would suggest go for it.

It may also depend on what you want to teach. How to program ? How the computer works inside ? both ?

For instance for my nephew I'll go for scratch to motivate him easily because he's in France and I'm in UK so I want something quickly rewarding because I can't help him a lot. But for my son I'll start with BASIC for him to understand how the computer works inside. And after I'll jump with Python.

When I was student, I learned several dances : rock, lindy hop, salsa, tap dance. I even taught lindy hop at one point. And there was huge debates among confirmed dancers about the best method to teach. About what to learn and what not to learn at the beginning to be a good dancer. During a dance camp, I asked one of the best lindy hop dancer in the world about what and how to teach to beginners (for those who may know lindy hop it is Virginie the partner of Steven Mitchell). And she kindly answered : "Teach something simple you like to get them excited and keep them excited. Don't worry too much about details at the beginning, the main thing is to not lose them".

So as a copycat I suggest to go with a language you consider good for kids and you're happy to teach or at least to help to understand.
Posts: 14
Joined: Sat Nov 12, 2011 4:44 pm
by hawkwolf » Thu Nov 24, 2011 11:23 am
Posts: 3
Joined: Thu Nov 24, 2011 11:20 am
by newludd » Fri Nov 25, 2011 4:27 pm
Quote from dyashkir on November 15, 2011, 20:48
I was considering this question for a while, what is the best first language to introduce to kids?

I am partial to lua, small clean powerful. Python probably is good as well. What does everyone think?


I would make the suggestion of considering the EUPHORIA programming language as a good first language. Euphoria seems quite compact and easy to play and study. One interpreter file, no installation. Programs work in DOS , Linux and Windblows. Very fast execution.

It uses libraries written also in Euphoria. These libraries and the interpreter file are all inside the home directory, wherever you want them. So kids can back-up the whole system together with their work, just by copying one directory. It is a small system, anti-bloatware (eco-friendly). It also seems a good learning base to jump into C from.
Posts: 1
Joined: Fri Nov 25, 2011 3:03 pm
by birdorf » Wed Nov 30, 2011 11:26 am
I agree with Hamster, quick and easy access to graphics. Getting a few pixels bouncing around and interacting could spark an interest.

I did a tiny bit of Assembler in the mid 90's on a Pentium 60, how far removed from this is the Arm stuff? I was hoping to get back into it.
I remember writing my first Assembler program just to add/subtract/etc. an inputted number, it was a much better way to learn binary calculations than any amount of scribbling on paper. It blew my mind!!

EDIT: Just noticed the TEACHING ARM ASM thread.
Note to self - Read the forum before asking stupid questions.
Posts: 2
Joined: Tue Nov 29, 2011 10:18 am
by Lakes » Wed Nov 30, 2011 5:05 pm
This another one I`d not heard of, here`s a clicky link to save typing into google. :)
http://www.rapideuphoria.com/
Posts: 267
Joined: Wed Aug 24, 2011 2:17 pm
by shiftyphil » Thu Dec 01, 2011 6:43 am
This slashdot article on HyperCard brought back some memories.

There are some modern clones, don't know how good they are.

Maybe not the best to teach modern programming concepts, but a great way to get started and get interested. I started hacking away with it with zero documentation.
Posts: 21
Joined: Thu Nov 17, 2011 12:32 am
by andywe » Thu Dec 01, 2011 9:23 pm
I too am a fan of Lua and Python ...
There are already some very good resources, and complete courses and books for teaching Python as a first programming language, both at school and undergraduate level.
Lua applications could also be run on ARM Cortex M3 and PIC32 ports of Arduino.
Send me an email if you want to pursue some of these topics in greater depth .. awe at ftt dot co dot uk
Also to remind me to post comments in this forum ... should you prefer.
Posts: 44
Joined: Thu Dec 01, 2011 5:09 pm
by Petrakis » Fri Dec 02, 2011 1:01 am
Let me say ADA 95, well it´s not that "For kids" but it´s so strict that you will gain good manners

"Ada is recognized as an excellent vehicle for education in programming and software engineering, including for a first programming course.

Ada is defined by an international standard (the language reference manual, or LRM), which has been revised in 1995. Ada is taught and used all around the world (not just in the USA). Ada is used in a very wide range of applications: banking, medical devices, telecommunications, air traffic control, airplanes, railroad signalling, satellites, rockets, etc. " http://www.adahome.com/FAQ/learning.html

structured, statically typed, imperative, wide-spectrum, and object-oriented originally targeted at embedded and real-time systems.

haha, but... I HATE IT it´s so strict :)

Python is a good language I love it but I wouldn´t recommend it like first language, maybe second, as a first language you have to take a language that won´t let you to do what you like with variables and values :P. For better understanding of programming.

Lua it´s similar to python and it´s so lightweight (check FreeMyIpod project, and Rockbox, they use lua for their apps, I have that os in my ipod nano 2g and that fact that I can load .lua (even games, I mean not just "console" scripts) it´s amazing
Posts: 18
Joined: Thu Dec 01, 2011 11:48 pm
by Moor » Fri Dec 02, 2011 3:49 am
Any first language picked should not need you to make any objects or anything like that.

A kid who just wants to do
10 PRINT "LOOK AROUND YOU"
20 GOTO 10
shouldn't have to think about data encapsulation or initializing the class first.

Additionally, it would probably be best to have a line-interpreter thingee (I've forgotten it's name? Like Python has. Where you don't need to write and save a program to run a bit of code, thing.) I mean, I'm learning Java, and I've already gotten frustrated a bit that there's no way to test little bits of code without going through
Public Static void main( String args[] ) {
...
}
Just to try out some things with Chars.
Posts: 14
Joined: Wed Oct 12, 2011 1:37 am