User avatar
bltsandwich1
Posts: 60
Joined: Fri Feb 08, 2013 3:22 pm
Location: Chicago
Contact: Website

Which Language to Learn?

Sun Mar 31, 2013 3:08 am

I am going to have a hefty (3 hours round trip) commute every day to Chicago this summer, and I know that I want to spend my time working on learning a language, and while I know some basic python, I know that it has some limitations, so I wanted opinions on the best/most useful language to learn.

I was thinking C or C++ or maybe really learning Python, but I'm not set on anything.

I want biased opinions!
John
facebook.com/chicagoraspberryjam - join in the fun
Majoring in ChemE at the University of Houston.

Lumpynose
Posts: 37
Joined: Thu Feb 28, 2013 6:07 am

Re: Which Language to Learn?

Sun Mar 31, 2013 5:03 am

Python is quite powerful from what I've heard and read. I'm a java guy but that's a steep mountain to climb. The nice thing about programming languages is that there are a lot concepts that you learn when you learn any one language; the following languages come fairly easily after the first one. As an example, MIT and Cal use python for their artificial intelligence classes; I don't think they'd use some dinky language for that.

HappyPiUser
Posts: 16
Joined: Thu Mar 28, 2013 7:47 pm

Re: Which Language to Learn?

Mon Apr 01, 2013 5:08 am

Depends on what you ultimately want to do with your programming skills.

If you want to do systems-level programs, it never hurts to learn C. You will have to eventually, so why not start there? Some people have jumped right into C++, which is OK, too. But I see it as an add-on to C, more than a stand-alone language (adjusting my armor a bit, to protect against the inevitable zealots who will flame me).

Anyway, there is still plenty of Linux/Unix code out there that is simply C..and having an understanding of it will be helpful if you ever want to play around with that code.

For creating "raw" web apps, Perl has always done me well. Again, just reveals the era that I "grew up" in. But that's another story. I don't always use C...if Perl can do the job...or even Shell scripting.....which can do a lot for you once you master it.

You will hear a lot about how great Java and C# are. Yes, they are great "learning languages", just like Pascal used to be many years ago. And if you are doing "business apps", they have their advantages. You can do GUI and glue things more quickly and with cleaner code (generally speaking).

But it is in C and C++ that a lot of the "heavy lifting" gets done in the real world of Linux (and most "systems programming" in general). If you can learn that, you have a real advantage.

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Which Language to Learn?

Mon Apr 01, 2013 7:45 am

I want biased opinions!
Here is my biased opinion:
it never hurts to learn C
It hurts. It will hurt A LOT.

My recommendation is that you start with C# on Windows with the Visual Studio IDE. Its very easy to get started and the Express editions are free. The reason for the choice of language is that there is a great deal of educational material readily available and the object oriented concepts apply to other languages. You can get things up and running fast which is important for keeping the attention of someone just starting out. Finally, once you are done you have a real world skill and can move on to C/C++ with a better understanding of their obtuse syntax.

User avatar
joan
Posts: 14566
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Which Language to Learn?

Mon Apr 01, 2013 8:13 am

I'd start with C. Most of the "useful" languages have C in their ancestry.

C would give you a good grounding in programming constructs and algorithm design.

C programmers also learn more self reliance. They would use a library if it was a good fit. They would not burst into tears* if they couldn't find a library for a particular job, they'd write their own.

*. This may be subjective and/or personal opinion.

User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Which Language to Learn?

Mon Apr 01, 2013 8:39 am

bltsandwich1 wrote:I am going to have a hefty (3 hours round trip) commute every day to Chicago this summer, and I know that I want to spend my time working on learning a language, and while I know some basic python, I know that it has some limitations, so I wanted opinions on the best/most useful language to learn.

I was thinking C or C++ or maybe really learning Python, but I'm not set on anything.

I want biased opinions!
John
Lean BASIC. It's a fantastic language to learn. Easy to write, easy to debug. Pretty graphics and some dialects even have sounds.

Start here: https://projects.drogon.net/return-to-basic/

-Gordon
(with a biased opinion :)
--
Gordons projects: https://projects.drogon.net/

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Which Language to Learn?

Mon Apr 01, 2013 8:50 am

Lean BASIC. It's a fantastic language to learn. Easy to write, easy to debug. Pretty graphics and some dialects even have sounds.
Go wash your mouth out you dinosaur :)

AFAICT Python IS the new BASIC (e.g a good/easy language to learn first to get you going) but not quite up scratch if you want to quickly write a little graphical game for instance.

Its HUGE advantages as a learning language (just like BASIC was (that's WAS Gordon! :) ) is its interpreted so its very easy to play with and debug.

Once you've used Python to learn about the big boys and girls stuff like classes/threading etc., then its time to move onto a real world language.

C is good for this for systems level stuff on things like the RPi and of course knowing a bit of Java lets you write nice apps on your Android phone

Once you learnt 2 languages, you start to realise the common ground between them all and then its just a case of working out each of their little foibles

BUT NO BASIC!!!! - that's just for us old men nowadays :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: Which Language to Learn?

Mon Apr 01, 2013 8:52 am

I've spent the last year doing online python courses and now I'm wishing I'd spent my time doing C/C++ instead. Maybe the grass is just greener, but I'm looking at it thinking 'this doesn't look *too* much harder - and it's supposed to be *loads* faster, dammit!'

I'm having to look at C nowadays because I'm doing stuff with Arduino, you see... Also, pygame performance on the Raspi was less than stellar.
note: I may or may not know what I'm talking about...

User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Which Language to Learn?

Mon Apr 01, 2013 8:59 am

toxibunny wrote:I've spent the last year doing online python courses and now I'm wishing I'd spent my time doing C/C++ instead. Maybe the grass is just greener, but I'm looking at it thinking 'this doesn't look *too* much harder - and it's supposed to be *loads* faster, dammit!'

I'm having to look at C nowadays because I'm doing stuff with Arduino, you see... Also, pygame performance on the Raspi was less than stellar.
You might find that using SDL from C is not much faster on the Pi, unless you know some tricks. My BASIC (there's that word again ;-) uses SDL for everything and it's reasonably fast, but I've also done some native SDL stuff from C - the main issue on the Pi with SDL is lack of a hardware 'blit' engine for updating the physical screen from the memoty image.

And do make sure (if it doesn't do it for you), when using PyGame (or any other SDL package) on the Pi that you initialise the display in 16 bit per pixel mode. Anything else will be as slow as the custard flowing out of the custard fields of Devon on a cold winters day...

-Gordon
(who knows where the custard fields are, but is sworn to secrecy)
--
Gordons projects: https://projects.drogon.net/

gordon77
Posts: 4370
Joined: Sun Aug 05, 2012 3:12 pm

Re: Which Language to Learn?

Mon Apr 01, 2013 10:11 am

"And do make sure (if it doesn't do it for you), when using PyGame (or any other SDL package) on the Pi that you initialise the display in 16 bit per pixel mode. Anything else will be as slow as the custard flowing out of the custard fields of Devon on a cold winters day..."

Thanks for this tip :), I've been wading through custard.

Gordon77

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Which Language to Learn?

Mon Apr 01, 2013 12:20 pm

Pi is simply slow when it comes to graphics, even using full asm its still slow.
I am surprised how fast python is, when knowing how slow the basic graphics are.
I know the pi has much more to offer, as far as graphics goes, if we could only get to it.

I do not know if its just me, but python is one of those languages that you need to lookup every new thing, basic, asm, C etc, once you know the basics you can be locked in a room and code news stuff, it may not be the most optimized, but it will work, with python you would need the Internet as well.
Thats what makes it good for none programmers, its easy to get snips working without knowing anything about the language, but thats its down side too.
Its a cut and paste language.
Batteries not included, Some assembly required.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Which Language to Learn?

Mon Apr 01, 2013 2:29 pm

I do not know if its just me,..., with python you would need the Internet as well.
mm - I would say that its just you :)

I think all programming language learning is helped by the having Stack Overflow and mates on-line :)

[quoteIts a cut and paste language.[/quote]
Agreed but so are many others I've used - I cut and paste a lot when programming 'droid Java apps and have done exactly the same with PHP websites.

(The whole of my Scratch GPIO handler was copied from an existing project - I've cut and pasted in the PWM code library as well - I love it :) )

Cut and Paste languages are the way of open-source programming - the C guys aren't normally anywhere near as open with their stuff and the assembler crew have armed guards on theirs :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

guylavoie
Posts: 2
Joined: Sun Mar 31, 2013 2:11 am

Re: Which Language to Learn?

Mon Apr 01, 2013 3:28 pm

If you will be doing any in-depth stuff that involves a lot of data handling and requires speed, then C remains king of the hill. It is the lowest common denominator against which most other languages were built. You will always end up recognizing some things that are "C-like" in other languages. Try to learn at least a basic understanding of C, such as reading and writing to files, string handling (strcpy, printf, etc). This will prove invaluable later on as you learn other languages.

The higher level languages do have many uses where they are more suited for the task, when it comes to data presentation, graphics, etc. I personally need to learn Phython at this point, being new to the Raspberry Pi. But I know I can get started right away because I can do things in C.

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: Which Language to Learn?

Mon Apr 01, 2013 4:31 pm

How's DexBASIC coming along, by the way? It looks cool, but last time I checked, it didn't have loops, variables or maths functions...
note: I may or may not know what I'm talking about...

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Which Language to Learn?

Mon Apr 01, 2013 5:28 pm

toxibunny wrote:How's DexBASIC coming along, by the way? It looks cool, but last time I checked, it didn't have loops, variables or maths functions...
Thanks, I am working on adding more functions, theres also a pi linux ver and riscos ver that will be released, i am also working on a interpreter so you can down load file to the pi though uart and run them like a arduino.
Both assembled and like a .bas file.
Theres may help:
some of what you want added have been add to by a DexOS forum member called "timfv", i have not had chance to fully test them yet, but your welcome to try, they are available here:
http://www.dexbasic.tf-v.com/DexBasic.zip
Batteries not included, Some assembly required.

User avatar
bltsandwich1
Posts: 60
Joined: Fri Feb 08, 2013 3:22 pm
Location: Chicago
Contact: Website

Re: Which Language to Learn?

Tue Apr 02, 2013 12:33 am

Thanks for all the help, I definitely am going to aim the way of C/C++ now, my next question is what are the best resources to pick up for learning C/C++. I'm sure that there are a plethora of online sources, but I am looking for something more tactile (I'm of course assuming that 'C for Dummies' isn't the best way to go).

Thanks for any help,
John
facebook.com/chicagoraspberryjam - join in the fun
Majoring in ChemE at the University of Houston.

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Which Language to Learn?

Tue Apr 02, 2013 5:03 pm

This is where I'm learning C++ from at the moment...
http://www.cplusplus.com/doc/tutorial/

Dave.
Apple say... Monkey do !!

oldsalt
Posts: 4
Joined: Sat Apr 06, 2013 2:44 pm

Re: Which Language to Learn?

Mon Apr 08, 2013 3:36 am

Hi,

My two cents (penneth) worth, I agree with your decision to go with C and perhaps C++ later, I have dabbled for many years, hacked a bit in this and that language, they all have there benefits, but now like you I have the time to really learn a programming language, C is my choice. It is just so versatile and as others have pointed out many modern languages have taken the good points of C and then encapsulated the hard parts, so if you know C you are well on your way to understanding them all. Perhaps a bit of Latin would be good also :D though perhaps, only in the western world.

Also and speaking from experience, with no disrespect to the community here, good advice can be found at http://stackoverflow.com, when you search for an issue in C they tend to come up first in google(though they are language agnostic), as yet, I have never had to ask a question. The answer to my problem has always been there already, like the Raspberry Pi forums they have a good tolerance policy to new learners. Big issue with me, people that, rather than take the time to point a person to an answer, reply, with try google or google is your friend.

Bit of a rant last paragraph :-)

All the best

oldsalt

yottskry
Posts: 73
Joined: Wed Mar 06, 2013 10:11 pm

Re: Which Language to Learn?

Thu Apr 11, 2013 6:31 pm

Don't learn C. It will confuse you and it will put you off programming.

If you're learning a first language I think python is a good shout. It will teach you the fundamental principles of programming and will enable you to produce something useful quite quickly. There is less of a learning curve than with C.

I am a competent C++ programmer. I'm a good Java programmer. I'm a very good Delphi programmer. I am a *crap* C programmer. Don't get me wrong - C is a very useful language, but it's very low-level compared to more modern languages and quite difficult for a beginner to pick up.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Which Language to Learn?

Fri Apr 12, 2013 12:03 am

@yottskry

Great Advice :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
brox
Posts: 19
Joined: Sat Mar 02, 2013 11:24 pm
Location: Betelgeuse

Re: Which Language to Learn?

Mon Apr 15, 2013 8:54 am

Don't listen to anyone.
Start learning pure C (not C++). It will take about 4 hours to learn. All you need is in wikipedia.
And next, you decide what to do with your future programming skills. If you want to be able to write 300K code per day and get a decent job with high salary - Java is for you.
If you learn C++ some day (well, if anyone on Earth is able to learn this bloated heavy language completely), you probably ready for anything, from desktop apps to smartphones/tablets
So long, and thanks for all the fish!

gordon77
Posts: 4370
Joined: Sun Aug 05, 2012 3:12 pm

Re: Which Language to Learn?

Mon Apr 15, 2013 9:03 am

oldsalt wrote:Hi,
Big issue with me, people that, rather than take the time to point a person to an answer, reply, with try google or google is your friend.

Bit of a rant last paragraph :-)

All the best

oldsalt
I tend to agree with that, I always try to help with some details, and if I don't know I don't answer :D

Magic Knight
Posts: 33
Joined: Sat Jan 12, 2013 5:14 pm

Re: Which Language to Learn?

Mon Apr 15, 2013 9:47 pm

I've just started the following online course.

An Introduction to Interactive Programming in Python

at www.coursera.org

Looks good so far.

raspem
Posts: 26
Joined: Mon Apr 15, 2013 7:14 am

Re: Which Language to Learn?

Wed Apr 17, 2013 7:56 am

There's no one language which will solve all problems (contrary to what some people think, esp. in middle management ;) )

But if it's for fun, and performance is not an issue:

ruby. It's beautiful (well, for a script-style language anyway), it's powerful, it's FUN.

I've programmed for 30 years in more languages than most people have heard of, and starting using ruby for all scripting brought the fun back into it. Reminds me of Common Lisp when it comes to expressive power and general awesomeness. (At work it's server programming in C mostly, but we have started to replace most of the old bourne shell and perl %#¤& with ruby now.)
My other computer is a MacBook Pro

omega1
Posts: 113
Joined: Mon Jul 02, 2012 3:10 pm
Location: UK
Contact: Website

Re: Which Language to Learn?

Fri Apr 19, 2013 3:13 pm

What is a good C++ compiler to get started with? I have mainly used VB running under Windows and have installed a Linux Virtual Box and need to install a C++ compiler to have a dabble at writing bits and pieces to run on the Pi.

Any suggestions on what to go with, something that will be as compatible as possible with the Pi.

Thanks.
Get your Pi from here! http://bit.ly/18blVup

Return to “General programming discussion”