shaurz
Posts: 49
Joined: Thu Nov 03, 2011 12:09 pm

Re: Best first language choice

Mon Jan 09, 2012 2:20 pm

I don't think there is really one good language to start with. If pushed I would say Python, because it's generally straightforward and requires indentation. It has plenty of flaws though. I've been designing a new programming language myself over the years, which I'd like to bring to R-Pi, but easier said than done because I've had the project on the back burner for a long time and I'm pretty lazy.

roelfrenkema
Posts: 105
Joined: Sat Jan 07, 2012 5:17 pm

Re: Best first language choice

Mon Jan 09, 2012 2:40 pm

zag said:


Python and PHP for my classes I think.

Opensource and popular



Simply the best that is

scottscreations
Posts: 10
Joined: Mon Jan 09, 2012 2:34 pm
Contact: Website

Re: Best first language choice

Mon Jan 09, 2012 2:48 pm

My first was Java, easy enough. Took me many hours, nights, days and months to learn how to program and do objects correctly. I then went into Perl, PHP, JQuery and the web development scene.

I am now teaching myself C++ with Qt. I have taught PHP Classes to high school kids. Its an easy language but if your doing it for web development then you need to know html, css, and maybe javascript. It looks like Qt is going to run on this device. I would honestly pick up a Qt book and start with that. It makes C++ a bit easier while making some great GUI applications or even try QML if it works. If this doesnt float, then i recommend Perl. Great community, and CPAN modules are awesome.

JohnoFon
Posts: 22
Joined: Tue Nov 15, 2011 4:22 pm

Re: Best first language choice

Mon Jan 09, 2012 2:52 pm

The main requirements for a first programming language are:

1. It must be easy to access (like my old BBC B that booted to BASIC in a matter of seconds). I'm picking up Java and Cocoa at present, and interacting with a command line is a pain in the fundament, like remembering when you need file types on the line.

Don't forget that when the enthusiasts on this forum started computing it was shiny, exciting and the best thing there was. Kids today have so much computing round them that we need to engage their enthusiasm before they get as far as running a program.

2. The teacher must be happy with it. The worst thing that could happen is that someone imposes a curriculum, and says 'You will teach Neliac on the TOPS-10 OS.' Because everyone who doesn't know Neliac, along with those who know and despise it, will communicate their rejection to the kids. I'd refer you to Ben Goldacre's discussion of the placebo effect in his book 'Bad Science'.

(I've chosen names to avoid taking sides in any ongoing dispute. My first programming job was coding Neliac on a DECSystem10. I loved them both but, as far as I know, the language, architecture and OS are all long gone.

3. What are we going to teach? My first code was written in a very cut-down assembler, that had a small number of instructions; you couldn't do very much with it, but you learned the principles involved and I went on to teach myself FORTRAN IV from a book.

The analogy here is, perhaps, a child's first bike. It may not have a chain, it probably has only one fairly feeble brake, but it's got stabilisers. No-one has any illusion of doing the Tour De France on one, but you learn how to balance, and steer and (hopefully) stop, and you move onto a real bike when you're ready.

If I were running a class, I'd like to start off dead simple like this, then move on to something that makes it easy to get results, and I confess I'd think favourably about Java. My reasons:


It's fairly easy to get up a screen with a button that says 'Hello World', and then changes to 'Goodbye World' when you click on it. Thus you've taught the essentials of visual programming.
There are lots of books for interested people to buy/read.
The SDK is free.
There's a fairly solid standard, and once you can write web apps you can run them on any browser on any OS (for some definition of 'any'). It strikes me that when people discuss languages on this forum it's often modified by 'the <x> implementation of <myFavouriteLanguage>', but again we should be striving for portability.

I realise that lots of people will disagree with this, but from my point of view we're not trying to turn out programmers at this stage, just to give interested people the confidence to explore further.

I'm also avoiding - perhaps I shouldn't even mention it - the question of style/structure/objects. That, I think, is Advanced Computing, though I hope that the subject can be taught in a manner that leads on to discussion of good practices. We would, I hope, also be explaining that different tasks require different techniques; the discipline of writing modules in a large database application spread across multinational concern is not the same as that required for writing time-critical control code for (say) an aircraft's fly-by-wire.

For what it's worth.

shaurz
Posts: 49
Joined: Thu Nov 03, 2011 12:09 pm

Re: Best first language choice

Mon Jan 09, 2012 3:08 pm

My main complaint with Java (and similar languages - C#, C++, etc.) is that it requires a lot of "ceremony" to get a basic program working. Class and method declarations, types declarations, System.out.println, etc. Then there's the extra complication of the compile/run cycle vs interpreted and lack of interactive prompt.

BKsMassive
Posts: 12
Joined: Thu Jan 05, 2012 4:06 pm

Re: Best first language choice

Mon Jan 09, 2012 3:50 pm

It"s happened again, no one has agreed on anything. lol

Python and Java has came up a lot so i will most likely pick them two. I have already done about 10-12 hours of work with python and have learn quite a bit.

I was thinking

Python —> C —> C++ —> C#

Would this actually work or is there to much of a jump between some of them? Also is there anything else i should build into it for example Java? PHP?

I want to mainly be able to develop Android apps and things to do with that platform.

Thanks for all the feedback! <3

User avatar
piglet
Posts: 915
Joined: Sat Aug 27, 2011 1:16 pm

Re: Best first language choice

Mon Jan 09, 2012 3:58 pm

There's rarely a question where PERL isn't the answer for file and data manipulation....

imho

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4214
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Best first language choice

Mon Jan 09, 2012 6:00 pm

OK. enough debating which is the best first language here is esr's mixal (http://www.catb.org/~esr/mixal/) for the raspi.

http://russelldavis.org/Raspbe.....ryPi/mixal

debate ended



[mixal is an assembler and interpreter for Donald Knuth's mythical MIX computer,defined in:

Donald Knuth, _The Art of Computer Programming, Vol. 1: Fundamental
Algorithms_. Addison-Wesley, 1973 (2nd ed.)]

User avatar
Chromatix
Posts: 430
Joined: Mon Jan 02, 2012 7:00 pm
Location: Helsinki

Re: Best first language choice

Mon Jan 09, 2012 7:37 pm

Assuming that a competent teacher is available, any of Pascal, Python or even MIX would be good choices for teaching (the choice depending on context, of course).  Their learning curves are sufficiently shallow to be easy to teach (or in the case of MIX, be used *for* teaching).

In the absence of a competent teacher, absolute beginners are likely to struggle a lot with any of those three, although Python is likely to be the least intimidating since it requires a minimum of boilerplate and has an immediate-mode interpreter.

Something more akin to BASIC would be better for self-teaching, because it requires *no* boilerplate and isn't so picky about indentation.  Conveying indentation accurately - and emphasising it's importance - in print is pretty difficult, I think.  And I do mean in print - typing a ready-made program in and then tweaking it is that much more instructive than simply running it from disk or a download.

However, BASIC has limitations which are unacceptable today, not least the level of fragmentation which guarantees that an interesting program written for one dialect is unlikely to run in any other dialect - especially if graphics or sound are involved.  That makes it more difficult to learn from scratch using BASIC than it was thirty years ago, when a tailored tutorial tended to come with your computer.
The key to knowledge is not to rely on people to teach you it.

Dazzler
Posts: 14
Joined: Mon Jan 09, 2012 6:26 pm

Re: Best first language choice

Tue Jan 10, 2012 11:00 am

No trying to provoke an argument (I am not well armed in programming knowledge ) but there seems very little Darwinism in coding.

A Bit of Wiki"ing:

Java 1995

Javascript 1995

PERL 1987

Python 1991

C 1972 C++ 1983 C#2001

PHP 1995

Surely some of these must die out through obsolesence, most are 20+ years old.  Is there no new languages about to replace/improve them?  Or is the key to it a "language" - i.e. it adapts and evolves.  Or is it most languages have a niche and that"s that?

Not trying to troll (post may seem like that) but I"m new to this like the OP and it"s like a comedy thread with 20 solutions and not even one being close to a winner, the best advice seem to be to pick one that reads well.  I've just started project Euler as a time-filler and some codes in the solutions thread read better to me as a novice, JavaScript for it's criticisms reads reasonably well to me (who has a very very distant Pascal knowledge).  Pytthon looks sensible for a beginner too.

Retro from memory - VIC 20 (-25 years ago?) .  Poke 36978,XXX to change screen colour

SherHowley
Posts: 1
Joined: Tue Jan 10, 2012 11:13 am

Re: Best first language choice

Tue Jan 10, 2012 11:21 am

As a very bad programmer and having worked with teens I'd say Basic and Python are easier to understand and for them to get thier heads around than C.

They may not be perfect, but I'm trying to get across the ideas and concepts and yes defo do pseudo code, really helps visualise where you're going and helps give you a less bugy program

JohnoFon
Posts: 22
Joined: Tue Nov 15, 2011 4:22 pm

Re: Best first language choice

Tue Jan 10, 2012 11:33 am

My main complaint with Java (and similar languages - C#, C++, etc.) is that it requires a lot of "ceremony" to get a basic program working. Class and method declarations, types declarations, System.out.println, etc. Then there"s the extra complication of the compile/run cycle vs interpreted and lack of interactive prompt.

That"s why I"d start off with something much simpler. Though to be fair you can write Java code with just a class definition ("this is the program title, and affects the fie name") and a public static void main — along with some curly brackets — ("this is where the program starts. I"ll show you later how useful this can be, but just copy it now.").

system.out.print is a bit messy: "it"s untidy. Learn it parrot-fashion and live with it for now"

I agree about the complications of the compile/run, though; time to learn about uatomating it with shell scripts, perhaps.

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

Re: Best first language choice

Tue Jan 10, 2012 11:34 am

Dazzler said:


No trying to provoke an argument (I am not well armed in programming knowledge ) but there seems very little Darwinism in coding.

A Bit of Wiki"ing:

Java 1995

Javascript 1995

PERL 1987

Python 1991

C 1972 C++ 1983 C#2001

PHP 1995

Surely some of these must die out through obsolesence, most are 20+ years old.  Is there no new languages about to replace/improve them?  Or is the key to it a "language" - i.e. it adapts and evolves.  Or is it most languages have a niche and that"s that?


Both.  For example there have been more recent standards for C and C++.  All the other languages have equally evolved.   Ruby, which is a good modern language worthy of attention, goes back to 95.  All of these languages have a niche.

Some languages do die and wither on the vine - Simula, Self, Modula-2, Algol, PL/M and many more. Others are just about hanging in there fighting for survival.  What you are seeing above are those languages that have made it through the struggles of attracting a critical mass and keeping it.

BTW Lisp goes back to 1958, Fortran to 1957.  They are still in use, although Fortran may be fighting a losing battle.

JohnoFon
Posts: 22
Joined: Tue Nov 15, 2011 4:22 pm

Re: Best first language choice

Tue Jan 10, 2012 11:44 am

My posting above was meant to be a quote and comment of what shaurz said, but the quote looks like My Original Work.
My comments were:

That"s why I"d start off with something much simpler. Though to be fair you can write Java code with just a class definition ("this is the program title, and affects the file name") and a public static void main — along with some curly brackets — ("this is where the program starts. I"ll show you later how useful this can be, but just copy it now.").

system.out.print is a bit messy: "it"s untidy. Learn it parrot-fashion and live with it for now"

I agree about the complications of the compile/run, though; time to learn about automating it with shell scripts, perhaps.

PaulBuxton
Posts: 57
Joined: Tue Jan 10, 2012 11:38 am

Re: Best first language choice

Tue Jan 10, 2012 11:52 am

I think it is clear that there is no single best language to use.

My approach for programming is to try and pick the language that suits the specific job I am trying to do. Sometimes I need to work at a low level so use C, other times I need a cross platform script so would use python or perl.

In the case of teaching kids, I would look at trying to do something where they are interested in the end result. A program that takes an unsorted list of numbers and prints them out sorted isn't going to interest them. So I would be looking at something that has a strong visual element to it. Something like Processing http://processing.org/ would be my recommendation. It is basically Java, with a good set of easy to use libraries for doing things like capturing images from web cams etc. Combine this with the OpenCV libraries (also availble for Processing) and you could have them doing things like swapping peoples heads.

Paul.

JohnoFon
Posts: 22
Joined: Tue Nov 15, 2011 4:22 pm

Re: Best first language choice

Tue Jan 10, 2012 12:09 pm

Ollie Barbor said:


It"s happened again, no one has agreed on anything. lol

Python and Java has came up a lot so i will most likely pick them two. I have already done about 10-12 hours of work with python and have learn quite a bit.

I was thinking

Python —> C —> C++ —> C#

Would this actually work or is there to much of a jump between some of them? Also is there anything else i should build into it for example Java? PHP?

I want to mainly be able to develop Android apps and things to do with that platform.

Thanks for all the feedback! <3


We're not going to agree, because it's a non-trivial issue. Hell, I can't even agree with myself on the subject!

I may be wrong, but I believe that Android is pretty heavily dependent on Java.

Personally, I'd put it before C on your list. I think of it as 'C with some nice new stuff added, and some of the bad old stuff taken out'. When you've got Java sorted you can go back to look at C and marvel at how we old folks used to manage in the old days.

By the way, folks, I've just learned a lesson: don't use the browser on your tablet to quote-and-reply to this forum.You can see the mess I made above before switching to a proper computer.

User avatar
zag
Posts: 68
Joined: Tue Jan 03, 2012 12:10 am
Contact: Website

Re: Best first language choice

Tue Jan 10, 2012 12:12 pm

Ollie Barbor said:


It"s happened again, no one has agreed on anything. lol

Python and Java has came up a lot so i will most likely pick them two. I have already done about 10-12 hours of work with python and have learn quite a bit.


Yes having attempted to teach a java programming class, it was virtually impossible for kids to get who were starting out with programming.

We need something quick and accessible (like python)
Unofficial Raspberry Pi Forums - www.raspberrypiforums.com

l8night
Posts: 8
Joined: Fri Dec 30, 2011 4:39 pm

Re: Best first language choice

Tue Jan 10, 2012 2:04 pm

I've had a rethink and its not language that's initially important, its debugger/IDE

it was only when I got access to Borland turbo C that I started learn for real.

after that I found languages that I had previously considered difficult made sense.

that is why IMHO python/lua/perl are not the best starting point as you have poor debugger support. and dynamic languages in general do not give a clear picture of what you are doing.

I believe that some web browsers allow you to debug you javascript but like other scripting languages (and there's always Bash shell) the lack of restriction the language provides can lead to confusion or misunderstanding.

Java is not too bad if you want to install eclipse.

if your on windows all visual studio express languages are great. and there is mono on linux (and sharpdevelop ide).

but I still think that codelite (which is has build in debugging with gdb) is a great place to start.

which every language you pick, pick one with an integrated debugger and debug you programs and look at what they are actually doing, this will teach you more than you would get by just writing more code without the proper understanding.

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

Re: Best first language choice

Tue Jan 10, 2012 2:52 pm

l8night said:


I've had a rethink and its not language that's initially important, its debugger/IDE

it was only when I got access to Borland turbo C that I started learn for real.

after that I found languages that I had previously considered difficult made sense.

that is why IMHO python/lua/perl are not the best starting point as you have poor debugger support. and dynamic languages in general do not give a clear picture of what you are doing.


[snip]
which every language you pick, pick one with an integrated debugger and debug you programs and look at what they are actually doing, this will teach you more than you would get by just writing more code without the proper understanding.
I disagree with this quite a bit.  If you are learning a language by poking about in an interactive debugger you aren't learning it efficiently.  I've seen people who write programs like that (professionally) always stepping through their code, making a change, rinse, repeat, until it runs.  They show very little real understanding of good programming IMO.

However there are perfectly reasonable IDEs / graphical debuggers for Python.  IDLE, eric3, eclipse and more.

I'm not sure what you mean by "dynamic languages do not give you a clear picture of what you are doing".

elchan
Posts: 1
Joined: Tue Jan 10, 2012 4:21 pm

Re: Best first language choice

Tue Jan 10, 2012 5:12 pm

Come on guys, enough of all this dogma.  The guy's just asking what's the best language to start learning.  He doesn't need a religious conversion.

Basically, start with C.  It is the root to 80-90% of all commercially viable languages.

Once you know C syntax, learn Object Oriented programming concepts, and you will understand C++ and Java variants, and C#.  With this you will now be able to work in the UNIX and LINUX environment, Windows Environment.  Android is Java based too.

Then once, you think you've mastered the computer universe, you will look at the Mac, and have to learn the orphan child called XCode.

If you plan to work on web programming, you need to learn html, php, and perl.  You will also hear about xml, in the websphere.  Don't worry.  It's the same syntax as html, with more tags.  Html on steroids.

But, back to my original point.  Learn basic C syntax, and it will be a good start.  Don't start learning all the esoterica of C, like all the pointer manipulations, they are not used in any other language that counts.

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

Re: Best first language choice

Tue Jan 10, 2012 5:38 pm

elchan said:


Come on guys, enough of all this dogma.  The guy's just asking what's the best language to start learning.  He doesn't need a religious conversion.

Basically, start with C.  It is the root to 80-90% of all commercially viable languages.

Once you know C syntax, learn Object Oriented programming concepts, and you will understand C++ and Java variants, and C#.  With this you will now be able to work in the UNIX and LINUX environment, Windows Environment.  Android is Java based too.

Then once, you think you've mastered the computer universe, you will look at the Mac, and have to learn the orphan child called XCode.

If you plan to work on web programming, you need to learn html, php, and perl.  You will also hear about xml, in the websphere.  Don't worry.  It's the same syntax as html, with more tags.  Html on steroids.

But, back to my original point.  Learn basic C syntax, and it will be a good start.  Don't start learning all the esoterica of C, like all the pointer manipulations, they are not used in any other language that counts.


Well up to a point.  The problem with starting with C is that it exposes the student to too much over-complication (unless you've got some good high-level libraries).  Also it isn't as widely used as much as it once was - and if you are going to drop pointers and other stuff then frankly it isn't worth learning at all.  I would want something interactive and with more high-level goodies for beginners.

I'm not sure what 80-90% of the commercially viable languages means.  OK so most work will be in the curly bracket languages.l However that isn't quite the same thing.

You are of course right, that object orientation is basically a design issue.  You can do OO programming quite readily in C if you try.  It is more difficult because more (in fact nearly all) of the burden falls on the programmer than the language unlike C++ or Java.

As for web programming I would say learn html, css, javascript and one of (python, php, ruby, perl, java).  For example I write web apps using Java as the backend.

JohnoFon
Posts: 22
Joined: Tue Nov 15, 2011 4:22 pm

Re: Best first language choice

Tue Jan 10, 2012 5:57 pm

elchan said:


Come on guys, enough of all this dogma.  The guy's just asking what's the best language to start learning.  He doesn't need a religious conversion.


Elchan's right, of course. I would add that if you're learning on your own you really need a good book/course.

Without attempting to endorse them, I've had good experiences with books from Apress and O'Reilly. If you're really starting out Dummies books can help - as long as you can take the humour.

Of course, I'd still recommend Java BEFORE C, but I won't go on about it any more (for now).

tracker1
Posts: 2
Joined: Tue Jan 10, 2012 6:35 pm
Contact: Website

Re: Best first language choice

Tue Jan 10, 2012 6:43 pm

I would personally recommend starting with either JavaScript or Python.  I would say JavaScript as there are a very diverse selection of tools, and pretty much everyone on the planet has it already available.  Eloquent JavaScript even provides a good (and free) system to learn with.

I think Python is a decent beginning language.  It really isn't to my liking, but I can definitely see its usefulness as a learning language.  If you want to get into more low-level details, then one of the Pascal derivatives might be a better starting point.

Personally I would lean towards JavaScript simply because of its' broad Ubiquity, and that it is becoming more prevalent outside the browser as well as in.  There are a few gotchas that are more difficult to get into people's heads if you start with a scripted language however.  That would be dealing with static type variables.

thesynapseuk
Posts: 55
Joined: Thu Jul 28, 2011 11:21 am

Re: Best first language choice

Tue Jan 10, 2012 6:51 pm

There's a lot of discussion here about learning a language for the future, what works best in (x) environment, which one's going to 'get you in good habits' etc.

But the real issue that many of you are missing is motivation. The above post gets it much closer in looking at the resources available - you need a good book/course that is inspiring/interesting. To be honest, at the moment the Code Year/Codecademy project looks pretty key - who cares if it's in Javascript? Its a START.

Me - I can't program yet. I'm hoping I will learn this year for my own edification and so that I can teach others one day (I'm a teacher).

But what is most important is - what language is going to get results first? No-one, and I mean NO-ONE (normal, anyway!) cares how good/worthwhile that language is if they have to spend several weeks/hours etc. plugging away before they see something.

I honestly think that many people here have forgotten what it's like to start at the beginning of the journey. Heck, I'm using Multimedia Fusion 2 and that's difficult enough trying to get my games/apps to work how I want them to, and there's no 'coding' per se in that whatsoever (the thinking behind it still is though...)!

So, really, you want a language that:


Can achieve interesting results quickly
Has good/inspiring resources available

My understanding is that once you've learnt one language, you've 'broken the back' of the problem and it's much easier to move to another language after that.
In my mind, Python seems to be a good way to go on this. I could be wrong. But bottom line is you should just pick a language and get on with it.
To the OP - maybe you should go do the courses on Codeacademy first and then take it from there? I think there're some courses you can get on 3dbuzz.com as well for some languages, particularly the games orientated ones.

l8night
Posts: 8
Joined: Fri Dec 30, 2011 4:39 pm

Re: Best first language choice

Tue Jan 10, 2012 6:51 pm

andyl said:


l8night said:


[snip]



which every language you pick, pick one with an integrated debugger and debug you programs and look at what they are actually doing, this will teach you more than you would get by just writing more code without the proper understanding.


I disagree with this quite a bit.  If you are learning a language by poking about in an interactive debugger you aren't learning it efficiently.  I've seen people who write programs like that (professionally) always stepping through their code, making a change, rinse, repeat, until it runs.  They show very little real understanding of good programming IMO.


I think you misunderstand, I'm not saying you can program like that, I'm saying that its a good way to learn how a program works and how to program by looking at the effects you code is having by stepping through it and watch the locals change etc. (god forbid ever doing that as a way to program commercially)

this is after all a question about HOW TO LEARN to program.

My comment about dynamic languages are more about prototype based langs than class based where you may know the value of the properties of an object but little else (by design) both ruby and python have duck typing (but as I recall do have class like inheritance as well).

I too feel that this has gone off topic and become about which language ppl.

all I will say is I stick by my reasoning that a good debugger is as important when it comes to ease of learning as the language which you chose be that any of the 1000 algo based langs or lisp, ocaml etc.

Return to “General programming discussion”