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

Re: Best first language choice

Thu Jan 05, 2012 4:51 pm

Yes I know there is already a thread about this on this forum but every post contradicts it's self and no one actually agrees on an answer.

Please can someone post some of the most popular languages, Their uses, pros and cons. Also what would be the best for a newbie to learn like me. Would like something that isn't extremely unforgiving, Versatile and i can learn by myself.

Thank you for all the input.

Raspberry Pi <3

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

Re: Best first language choice

Thu Jan 05, 2012 5:22 pm

The reason that so many posts contradict themselves is just because there is no SINGLE language that is the best, even in a restricted env.

now add in that each language has its own religious zealots and you will be hard pressed to get an answer (I personally don't get the whole Perl-v-Python wars as I use both and neither is perfect).

MY suggestion is you have a look at some of the main languages there are, the chances are that one will do things in a way you expect, and then learn that in depth and you will find it easier to learn the next as you have a point of reference.

For me I started with C, then C++, Java, Perl, PHP, Lua then Python and finally been looking at Vala/Genie and C#. (in truth the order should start Basic, 6502 asm, Pascal, Modula-2 and Z80 asm are first but I did not write real programs with them)

I think C can be a good place to start, if your interested in low level things. The C manual is small and you can learn the whole lang quite quickly. unlike C++ it is not Object Orientated which can be a good or bad thing depending on what you want to do next.

I also Like Lua for similar reasons, there are some great books on how to do anything you like in Lua, BUT it comes as C source and its more intended as a language that you would embed into your application to give you a scripting capability.

which (IMHO) leaves you with Perl, Ruby or Python as a good starting point of command line biased languages (unless you start with C)

or C# (mono on linux) which allow you to do some GUI programming without needing as much skill as Vala/Genie or C with GTK+ would require.

At the end of the day this is just my opinion and as you see I'm biased towards Algo based languages so have not mentioned Scheme, Lisp, ML, OCaml etc

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

Re: Best first language choice

Thu Jan 05, 2012 7:04 pm

l8night said:

For me I started with C, then C++, Java, Perl, PHP, Lua then Python and finally been looking at Vala/Genie and C#. (in truth the order should start Basic, 6502 asm, Pascal, Modula-2 and Z80 asm are first but I did not write real programs with them)
I personally do not recommend C as a first language.  I think Basic and Pascal are much better introductions to the fundamentals of programming: variables, control structures, arrays, functions.  I learned C easily from K&R, but that was because I had already mastered PDP-11 assembly language and could visualize how "*s++ = *t++" compiled into a single PDP-11 MOV instruction.  I would expect a non-programmer to find many C notations to be unnatural, e.g., "x += 3", while an experienced programmer is impressed by its conciseness.

JMO/YMMV

1aws
Posts: 37
Joined: Fri Dec 30, 2011 8:43 pm

Re: Best first language choice

Thu Jan 05, 2012 10:38 pm

Ollie
For me, programming is about problem solving. The first step is to translate the given problem into a method of solving the puzzle using PSEUDO CODE or some other technique. Only after having established an operational model tested with dry run data should you move on to CODING the PSEUDO CODE. At that stage you choose the language most suited to what you intend to do with the program. If it is in a teaching environment then BASIC, PASCAL or indeed PYTHON are indeed excellent places to start.BBC BASIC for PC is available here: http://www.bbcbasic.co.uk/bbcw.....bcwin.html
It also looks as if RISCOS will be available for the RasPi.
http://www.riscoscode.com/Pages/Item0003.html#Raspberry
Raspberry Pi
Latest : 1st January 2012
Raspberry Pi is scheduled for release in February 2012. Ideally, RISCOS will be amongst the purchase options offered by the Raspberry Pi shop.
Visit piLEARN for information about Raspberry Pi running RISCOS.
On twitter search using #PiRO.http://www.pilearn.com/

Here is an overlaid screenshot from an original BBC program.
 
 

1aws
Posts: 37
Joined: Fri Dec 30, 2011 8:43 pm

Re: Best first language choice

Thu Jan 05, 2012 11:20 pm

Ollie

I forgot to add this. This is the Windows BBC BASIC editor and interpreter with the same program. There is a demo version for free. See site for details.

http://www.bbcbasic.co.uk/bbcw.....bcwin.html


User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Best first language choice

Thu Jan 05, 2012 11:36 pm

There are many languages out there.  If you get baffled by the {{{}}} block start/end symbols it may be good to start with something like Pascal as this will give a good grounding in the block oriented structure of most modern languages, then you can learn C or similar.  Once you have a couple of languages down I would recommend learning assembly before you learn OO, as Assembly seems to baffle most people that are accustomed to OO, though if you are accustomed to procedure oriented languages Assembly is not that hard.   Then I would recommend some OO language for the next step, Oberon, C++, VB are a few suggestions for entry into the world of OO.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

hjongste
Posts: 19
Joined: Sun Jan 01, 2012 5:53 am

Re: Best first language choice

Fri Jan 06, 2012 5:59 am

The similarity with spoken languages is remarkable. Is it better to learn to speak French, English, German or Mandarin? It doesn't matter as in all languages you can have meaningful discussions. Some languages are easy to learn, others are difficult to learn. Some languages are spoken by large numbers (Mandarin, English, Spanish), others by only a few. Dialects are rife. A person with a knack for learning (computer) languages will be able to learn a number of them. With kids, starting with an easy to learn language has advantages as it will kindle their interest rather than turn them off. If a kid grasps the concept that you can make a machine do things by conversing with it in a special language you are on the right track. A simple first language can do that and from than they'll move on naturally to other, more complex languages.

Any language that has a somewhat descriptive syntax is suitable to start off with. BASIC is one of those but there are many others.

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

Re: Best first language choice

Fri Jan 06, 2012 3:05 pm

hjongste said:


The similarity with spoken languages is remarkable. Is it better to learn to speak French, English, German or Mandarin? It doesn't matter as in all languages you can have meaningful discussions. Some languages are easy to learn, others are difficult to learn. Some languages are spoken by large numbers (Mandarin, English, Spanish), others by only a few...


From the International Wing of the Old Jokes Home:

Four translators are arguing about what is the most beautiful language.  The Englishman says: "Oh, it's English -- English is so expressive.  Think of the word butterfly.  It gives you a wonderful image of a tiny creature flitting through the air... "

The Frenchman says: "Ah non, the French word for butterfly it's so light... so airy: papillon."

The Spaniard says: "Oh, but the Spanish word for butterfly is the most beautiful of all.  Listen... mariposa."
The German scowls and mutters to nobody in particular: "Und vat iss wrong mit Schmetterling?"

strebor
Posts: 1
Joined: Sat Jan 07, 2012 2:08 pm
Contact: Website

Re: Best first language choice

Sat Jan 07, 2012 2:39 pm

I believe Pascal was a teaching language and I certainly learned a huge amount from the OU course I did using it. Whenever I have needed to tackle a problem the language has always been a secondary concern. I struggled with DAP16 and C and Pascal and PHP  Always the coding was for an amateur secondary to the analysis of the problem in the first place. It was always tempting to hack away without doing the ground work. It surely is the skills of clear analytical thinking and organization that should be promoted, those are perennial. What C programmer ever wrote anything in B, does Forth get much of an airing these days?

Regards, Martin

spamel
Posts: 196
Joined: Sun Jan 01, 2012 8:43 pm

Re: Best first language choice

Sat Jan 07, 2012 3:06 pm

All of the suggestions mean absolutely nothing to me, it has been that long since I did anything that it was the simple:

10 print "hello world"
20 goto 10
Run!

This may not get me very far these days! Are there any coding for dummies books?!

User avatar
n3tw0rk5
Posts: 216
Joined: Fri Jan 06, 2012 6:04 pm

Re: Best first language choice

Sat Jan 07, 2012 3:16 pm

spamel said:


All of the suggestions mean absolutely nothing to me, it has been that long since I did anything that it was the simple:

10 print "hello world"
20 goto 10
Run!

This may not get me very far these days! Are there any coding for dummies books?!



Thats might sort of level, my problem is there are too many languages to choose from and too few brain cells left to comprehend

rpersaud
Posts: 1
Joined: Sat Jan 07, 2012 3:09 pm

Re: Best first language choice

Sat Jan 07, 2012 3:45 pm

All these suggestions are good one, but the easiest to pickup and learn as an introductory language was PHP. There are so many WAMP, LAMP, XAMP stacks that package all the applications you need to get up and running in a matter of minutes. The reason why I would suggest it over the others is because of the instant and visual feedback you'll get from coding, and the expansive internet community ready to help. http://php.net. Once you learn about namespaces, classes, objects, data structures, and basic patterns like observer - then you can dig digger with c, c++, python, ruby, etc.

RobV
Posts: 2
Joined: Sat Jan 07, 2012 4:10 pm

Re: Best first language choice

Sat Jan 07, 2012 5:04 pm

None of the posts here mentions the programming language Ada. It is a general purpose language that supports all of the modern software engineering principles like strong typing, tasking, OO, generics, distributed systems, exception handling, interfaces to others languages just to name a few. The language was originally developed by the military but now wide spread in aero-space domain because of its features. The language has been defined in 1983, updated in 1995 and 2005. This year, 2012, will be the next release. The language has some of its roots in Pascal. There are no dialects like in others languages. Commercial compilers are certified and validated. Unlike most other languages, Ada has been developed to support very small projects to mega projects with several millions lines of code. The language has been designed to allow the compiler to detect most errors during compilation, thus reducing time for debugging. The following link gives much more  information :

http://www.pegasoft.ca/resourc...../book.html

Learn Ada as your first language to give you a sound introduction to software engineering.  Later when you will be introduced to other languages, you'll notice that they cover aspects of Ada but lack important features. Many universities have recognized this and choose Ada as the first programming language.

bitplane
Posts: 25
Joined: Sun Jan 08, 2012 6:20 am
Contact: Website

Re: Best first language choice

Sun Jan 08, 2012 7:12 am

I started with ZX Basic via First Steps With Your Spectrum and Input Magazine when I was 6-11, moved on to AMOS, Amiga BASIC and C in high school, Visual Basic, Pascal and C++ in college, followed by too many other languages to list as an adult.

I remember C being by far the hardest language to learn, I agree with I agree with John Beetem; pointer arithmetic, preprocessor macros and its rather unintuitive operators aren't very helpful to the beginner programmer. BASICs and Pascal aren't very useful in the modern world, PHP is just downright C-based ugliness and really requires a web stack to run upon.

The language I remember having the most fun with as a young adult was most likely mIRC script, writing programs that ran in chat rooms as a social exercise among friends who were unable to automate things. There's a real joy solving real world problems that are instantly recognised by your peers.

A good language for beginners must IMO be very easy to pick up yet allow progression to advanced concepts in future. It must have real, practical uses that inspire beginners to tinker and make really cool things. It must be cool, used by rockstar programmers who make awesome stuff rather than having the stigma of being an academic or beginner's language. It must be very popular so it has a large support network, because learning is a lot more rewarding when you've got a good mentor and a series of short articles, compared to sitting with a 500-page manual in solitude. It must have been around long enough not be a fad, but not show signs of vanishing into obscurity any time soon.

This leaves two main languages, Python and JavaScript. Python because it is clean, flexible and it's very easy to write a useful "hello world", i.e.

# hello grep.py

for line in open("file.txt"):

    if line contains "something":

        print line

JavaScript because it's used all over the web, making it very easy to publicly show off your ability to solve real world problems. The likes of WebGL, JavaScript 3D engines and web app-wrappers for Android and iOS make JavaScript game programming a hot topic that is likely to explode in the next couple of years.

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

Re: Best first language choice

Sun Jan 08, 2012 11:56 am

I big to differ on PHP needing a webstack. I use it as my main console scripting language. It's beautifull.

westwell
Posts: 2
Joined: Sun Jan 08, 2012 2:06 pm

Re: Best first language choice

Sun Jan 08, 2012 2:30 pm

According to the BBC, the Mayor of New York is taking a programming course (http://www.bbc.co.uk/news/tech.....y-16440126) and the article suggests that the Mayor of London is considering whether to do likewise. The training company the BBC mentions (http://www.codecademy.com) has chosen to provide Javascript as its first course. I can see benefits from Javascript, not least because it provides a solution to cross-platform programming for iPhone/iPad and Android (the alternative is Objective-C+CocoaTouch for Apple and Java+AndroidAPI for Android: two sets of learning). Mobile is a big area for programming activity at the moment so there's an obvious interest from students. In addition there's the further encouragement that mobile applications can be distributed through the Apple and Android Stores.

CodeAcademy is proposing to offer other languages in future, but interesting that they thought Javascript was a good first choice.

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

Re: Best first language choice

Sun Jan 08, 2012 2:38 pm

westwell said:


interesting that they thought Javascript was a good first choice.


Javascript is actually a rather nice language for general-purpose programming. It's pretty nice to use for teaching, too.  It might have a bad rep because it's mainly used to shove cookies, ads and popups onto your computer, but it's one of the better languages out there.

Simon

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

Re: Best first language choice

Mon Jan 09, 2012 8:56 am

Javascript?  The hilariously type-unsafe language where the result of "A+B" depends on whether A and B happen to be numbers or strings - and you can't simply declare them to be one or the other, but must cast them?

Javascript is a horrible beginner's language.  I would be perfectly happy if it disappeared off the face of the planet.
The key to knowledge is not to rely on people to teach you it.

tomo
Posts: 19
Joined: Mon Dec 12, 2011 12:50 pm

Re: Best first language choice

Mon Jan 09, 2012 10:24 am

Chromatix said:

I would be perfectly happy if it disappeared off the face of the planet.
Well, I'm pretty sure that all of us have some memories of past traumas laying somewhere in our subconsciusness. And if we sum all our curses and death wishes and make them real, there'll be no language left to use. Absolutelly none.

I think JavaScript is really fun, easy to start, easy to follow and - most of all - as a language powerful. But, yes, it's a pain to debug. And this alone makes it... rather hard and demanding to do anything more complex in it. And by "complex" I think far beyond a simple alert or web page click handling. I guess, it eventually teaches you discipline and self organization the hard way. But hell, it's fun! It's fun all along untill my bosses want me to do something using some new fancy RIA libraries that don't have any adequate documentation (and, yes, the documentation here can never be adequate enough), and want me to do it by tomorrow. That's the time I usually want to kill somebody.

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

Re: Best first language choice

Mon Jan 09, 2012 11:43 am

Python and PHP for my classes I think.

Opensource and popular
Unofficial Raspberry Pi Forums - www.raspberrypiforums.com

avra
Posts: 8
Joined: Mon Jan 09, 2012 11:48 am
Contact: Website

Re: Best first language choice

Mon Jan 09, 2012 12:18 pm

Lazarus is a user friendly and very actively developed RAD IDE based around object oriented Pascal, and we all know that Pascal is recommended for teaching programming. Therefore I think Lazarus is an ideal combination for a default Pi programming environment. You can make a "hello world" form in seconds, and best of all you can have an IDE on a Pi, or you can cross compile from Windows, Linux or some other host development machine. You can use it for a nice GUI, but also for any other kind of application (Desktop, server, database, TCPIP, Web, OpenGL 2D/3D...).

http://www.lazarus.freepascal.org

http://wiki.lazarus.freepascal.....creenshots

BarryK
Posts: 36
Joined: Thu Dec 08, 2011 12:47 am
Contact: Website

Re: Best first language choice

Mon Jan 09, 2012 12:54 pm

A Hello World GUI standalone executable created with Lazarus is about 9MB with debugging symbols, quoting from http://forum.xda-developers.co.....45396.html:

When i first found Lazarus i got impressed. I cuold recompile the same app i did on windows and make it run on my HTC, just changing 4 options on the compiler, without change any line of application code. The only thing its that the apps get lot of space, i mean "Hello world" takes 9Mb. This is because the exe carries many debuging compiler options inside the exe. People of Lazarus is working on to decrease the size. Or you can take them out

FreePacal has the same problem. Take out the debugging symbols, what can you get down to? -- 1MB? -- whatever, it is big.

In that other thread that discusses which language for RasPi beginners, I recommended BaCon. It will create a Hello World GUI about 50KB. But that of course is using the shared GTK libraries.

Coding for RasPi should be about creating applications that are very small and fast. And a language that is very easy to learn, which Pascal is, but then so is modern structured BASIC.

Some responses to my suggestion of BaCon sneared at it, but as noted earlier in this thread, people just present their own preconceived notions. I chose BaCon for use in Puppy Linux after years of trying other languages. I played with just about everything.

Note though, what I code in every day is Bash/Ash. I love how I can write one line with pipes, a highly readable/understandable line I might add, in Bash/Ash, that takes a dozen lines in BaCon or any other language.

Anyway, I will shut up about BaCon.

1aws
Posts: 37
Joined: Fri Dec 30, 2011 8:43 pm

Re: Best first language choice

Mon Jan 09, 2012 12:59 pm

avra said:


Lazarus is a user friendly and very actively developed RAD IDE based around object oriented Pascal, and we all know that Pascal is recommended for teaching programming.



Thoroughly agree avra. If I were still teaching I believe this would be my first choice.

One problem that existed a decade or so ago just before I retired was that very few teachers were qualified with a Computer Science degree. As a result most were happier teaching General Purpose Packages (ICT). Can I ask, has that all changed over the last decade; do you now have Computer Science interested staff in all of the secondaries?

BarryK
Posts: 36
Joined: Thu Dec 08, 2011 12:47 am
Contact: Website

Re: Best first language choice

Mon Jan 09, 2012 1:11 pm

Bye the way, creating a Hello World GUI with Bash/Ash is a piece of cake:


#!/bin/sh
export WINDLG='
<vbox>
<text><label>Hello World</label></text>
<button ok></button>
</vbox>'
gtkdialog --program=WINDLG


gtkdialog is a standard feature in Puppy Linux. The currently maintained version is here:

http://code.google.com/p/gtkdialog/

it is very easy to knock up sophisticated GUI apps with gtkdialog. Also, any language can use it, compiled or script.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23399
Joined: Sat Jul 30, 2011 7:41 pm

Re: Best first language choice

Mon Jan 09, 2012 1:26 pm

1aws said:


avra said:


Lazarus is a user friendly and very actively developed RAD IDE based around object oriented Pascal, and we all know that Pascal is recommended for teaching programming.


Thoroughly agree avra. If I were still teaching I believe this would be my first choice.

One problem that existed a decade or so ago just before I retired was that very few teachers were qualified with a Computer Science degree. As a result most were happier teaching General Purpose Packages (ICT). Can I ask, has that all changed over the last decade; do you now have Computer Science interested staff in all of the secondaries?


Unlikely that there are too many computer science degree teachers - more money to be made in industry.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “General programming discussion”