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

Re: Which Language to Learn?

Fri Apr 19, 2013 3:18 pm

Linux/Gnu comes with gcc (Gnu Compiler Collection) as standard. That provides C/C++ and lots of others.

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:25 pm

joan wrote:Linux/Gnu comes with gcc (Gnu Compiler Collection) as standard. That provides C/C++ and lots of others.
Thank you, I didn't know that, as you can guess I'm new to Linux!

I'm just finishing installing the Virtual Box with Debian on it, how 'graphical' is gcc? If not, is there anything that has an intuitive GUI that will help me in my transition?

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

Godmil
Posts: 13
Joined: Sun Jan 06, 2013 8:10 pm

Re: Which Language to Learn?

Fri Apr 19, 2013 8:47 pm

omega1 wrote:how 'graphical' is gcc? If not, is there anything that has an intuitive GUI that will help me in my transition?

Thanks
Gcc isn't graphical at all (to the best of my knowledge). You may be wanting an IDE like codeblocks, it's available for everything, though I only do compiling in it on the Pi version as its a bit too laggy to type in.

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Which Language to Learn?

Sat Apr 20, 2013 7:35 pm

@omega1

gcc is not graphical but you can invoke it with an IDE by setting up the IDE to pass it certain parameters/switches when gcc is called to compile your pgm.
A nice light weight IDE/text editor is Geany.
Not only can it invoke the required compiler but also does syntax highlighting and colouring based on the language you use.

VB in Windows uses a similar approach, you have the IDE (which is graphical) that calls the compiler (not graphical) , just that in Windows you are pretty much stuck with the IDE and compiler M$ supplies.

daru
Posts: 1
Joined: Tue Apr 30, 2013 2:44 pm

Re: Which Language to Learn?

Tue Apr 30, 2013 3:05 pm

Well, if you want to really learn programming on the Raspberry Pi then these links looks perfect:

http://learnpythonthehardway.org/book/
http://c.learncodethehardway.org/book/

I'd start with Python and then go for C. If you run into performance issues with Python one can write that piece of code in C and call it from Python! Stay away from IDEs and graphical tools when learning.
Wanna be hardcore? Learn Vim (or Emacs).

Now, if you for some reason want to learn C++ (not recommended because it's hard to get productive and get stuff done) and have a interest for graphics programming then check out Qt.

If you just want to get something together fast.. choose whatever runs on the Pi and install an IDE.

Sag73
Posts: 11
Joined: Tue Jan 01, 2013 6:12 pm

Re: Which Language to Learn?

Fri May 03, 2013 7:38 am

I would say that you should learn all three in the following order:
- Python
- C++
- C

milkybar_ton
Posts: 26
Joined: Fri Nov 30, 2012 8:25 pm

Re: Which Language to Learn?

Thu May 16, 2013 1:50 pm

Can anyone help me with a text editor problem?
I'm trying to learn LISP and yes Emacs is very good but a bit of a mountain to climb when starting out. Anyone have any simpler suggestions? i've installed Geany as there is a LISP plug-in (geanylispedit) but for me anyway it's not straight forward how to get it working/installed. Doesn't have to be Geany, any solutions would be great
cheers
milky

Running PiBang, i like it

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Which Language to Learn?

Thu May 16, 2013 2:12 pm

JEdit has lisp syntax highlighting, (and about a million other languages,) and it indicates matching parentheses too. It is written in Java, so it might be a bit laggy on the Pi, although I've not tried it with the new JIT JRE.

The answer to the OP is simple: learn as many languages as you can. Every one will show you new ways of thinking about a problem, and every one will make learning the next one easier.


RoyLongbottom
Posts: 304
Joined: Fri Apr 12, 2013 9:27 am
Location: Essex, UK
Contact: Website

Re: Which Language to Learn?

Thu May 23, 2013 3:06 pm

> What is a good C++ compiler to get started with <

gcc on Raspberry Pi - You can also install Linux Ubuntu on a USB stick and also install a compatible gcc there. See my:

http://www.roylongbottom.org.uk/Raspber ... hmarks.htm

I am compiling the same benchmarks on the Pi and Ubuntu. You can download the benchmarks and source code from:

http://www.roylongbottom.org.uk/Raspber ... hmarks.zip

These are compiled using the gcc command via Terminal. For short programs such as these, the time to compile on the Pi can be 9 seconds.

Roy

JxPond
Posts: 29
Joined: Wed May 22, 2013 9:32 pm

Re: Which Language to Learn?

Wed May 29, 2013 3:09 pm

I'm going to switch things up a bit with this post. I know the original question was which language, but I think most people are really interested in "How do I Learn Programming". I think the language is really secondary to the principles. There again you have to start somewhere.

I really found http://www.wibit.net/ to be extremely helpful. They start with C and then they progress from there. C isn't as scary as people make it out to be. It was taught in University 15 years ago. If you dip your toe in the deep end with these guys it makes understanding everything else easier because all the languages for the most part were progressively built upon one another. Having a solid foundation of understanding helps.

There again it depends what you're trying to do.
If you're just trying to play with the GPIO pins, Python probably is a good start.
Last edited by JxPond on Wed May 29, 2013 11:59 pm, edited 1 time in total.

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

Re: Which Language to Learn?

Wed May 29, 2013 3:11 pm

If you're just trying to play with the GPIO pins, Python probably is a good start.
No - Scratch is a good start, Python second :)

Remember - the question should be what is the 2nd language to learn after Scratch :)

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

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?

Wed May 29, 2013 3:16 pm

simplesi wrote:
If you're just trying to play with the GPIO pins, Python probably is a good start.
No - Scratch is a good start, Python second :)

Remember - the question should be what is the 2nd language to learn after Scratch :)

Simon
(Return to) BASIC of-course. Full GPIO support, structured programming, (optional line numbers) nice easy to use graphics, simple text entry editor - full screen coming soon.

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

-Gordon
--
Gordons projects: https://projects.drogon.net/

brs
Posts: 70
Joined: Fri Aug 17, 2012 9:27 pm
Location: Zurich

Re: Which Language to Learn?

Wed May 29, 2013 8:11 pm

If you are interested in low-level system programming, C is not a bad place to start. It's a very small/simple language close to the machine - portable assembly meets late 60ies structured programming. I would stay away from C++ until you really understand the fundamentals of pointers, memory layout, stack-frames etc. C++ will seem to abstract some of that away and then stab you in the back at the first opportunity.

The classic book on C is K&R "The C Programming Language", but some consider it a bit terse and dry. There are a million books and tutorials out there to learn C, but I can't really recommend any particular one since it's been 20 odd years since I learned C. If there is a tutorial which combines C with an intro to computer architecture, that might be a good choice.

talm
Posts: 22
Joined: Thu Jan 17, 2013 10:14 pm

Re: Which Language to Learn?

Wed May 29, 2013 9:12 pm

I have been programming for the last 50 years and used everything from pure machine code to high level languages like Fortan, COBOL, Delphi and its predessors etc. When I read about RPi, I become curious, and I bought one. I have looked at Java and found it too tedius, I have written a few programs i C and C++. So I decided to try Python on my PC. As usual I started by rewriting some old programs where I know the output. In the beginning the compiler halts over and over again pointing to syntax errors. Once I mastered the syntax, it was a very nice language. I then moved the source over to RPi, and it was fairly fast. Some of these programs were written in Fortran in the sixties for BIG systems, and the RPi was considerable faster. Besides normally 90% of the time is spent in 10% of the code, so it us seldom worth the trouble to convert all of it to say C. Besides, debugging Python is much easier than debugging C. So, start with Python, later on if you need optimizing the code, learn C and fix the bottlenecks.

JxPond
Posts: 29
Joined: Wed May 22, 2013 9:32 pm

Re: Which Language to Learn?

Thu May 30, 2013 12:22 am

gordon@drogon.net wrote:
simplesi wrote:
If you're just trying to play with the GPIO pins, Python probably is a good start.
No - Scratch is a good start, Python second :)

Remember - the question should be what is the 2nd language to learn after Scratch :)

Simon
(Return to) BASIC of-course. Full GPIO support, structured programming, (optional line numbers) nice easy to use graphics, simple text entry editor - full screen coming soon.

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

-Gordon
Gordon, I just received my Pi today. Seems as though BASIC really is a "bigger on the inside", time defying programming language. I'll have to take it for a spin at some point. RISC OS I imagine?

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?

Thu May 30, 2013 6:43 am

JxPond wrote:
Gordon, I just received my Pi today. Seems as though BASIC really is a "bigger on the inside", time defying programming language. I'll have to take it for a spin at some point. RISC OS I imagine?
My BASIC runs under Linux.

If you want to run riscos then ye olde bbc basic is still inside it, lurking somewhere...

-Gordon
--
Gordons projects: https://projects.drogon.net/

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: Which Language to Learn?

Thu May 30, 2013 11:47 am

Learning languages is all well and good, but the real art is in learning concepts.
Think of it as learning (human) languages vs. learning poetry.
You can be a great poet in any language, learning the vocabulary and syntax is only the first step.

bkboggy
Posts: 10
Joined: Wed Jun 05, 2013 9:08 pm

Re: Which Language to Learn?

Wed Jun 05, 2013 9:28 pm

As someone who got into programming through learning Python and then started learning C++ and Java... I say go with C++. If you've got the patience, I'd even go with C. But as someone new, C may appear a bit more cryptic than C++. They're very close though. However, as some of the guys have mentioned, learning a specific language is not that hard once you learn one. Once you get the concepts of pointers, garbage collection, inheritance, polymorphism, etc.... switching over is not that hard. However, that's where the first language you learn comes in. There are two ways of doing this: you can learn something that's easier to learn and faster to work with... such as Java, or learn a lower level "procedural" language such as C or C++. Java automatically performs garbage collection at certain intervals, so you don't have to worry about it. You don't use pointers per se with Java either. However, having learnt both of the languages, I'm glad that I learnt C++ first. Otherwise, I'd have a lot of unanswered questions. I like to know how things work from the inside; not just accept them as is and because they do what they do. Don't get me wrong, I think Java is a fantastic language that allows me to put together an pretty decent GUI app, even without a visual editor (I can't stand those), in just a day or two. swing and awt libraries are fantastic. It is nice not worrying about garbage collection. But not having of experience of dealing with it in a language such as C++, you can't really appreciate what you get with Java. On top of that, if you have to learn C++ one of these days, it'll be like a shock to you having to deal with that stuff... and pointers... mm pointers, I'll let you stumble over those on your own -- they're fun.

Ultimately, it's whatever it is that you're trying to do. If you're going into web development... C# or Java would be good choices (I'd do Java because it's more portable and C# is almost like an identical twins, so if you need to switch over it's a few days of going over keywords/syntax).

I use two IDEs for my C++ needs:

NetBeans - Setting it up is a bit more complicated for C++, since it's mainly used for Java, but once you got it up and running, it's a fantastic IDE. There are a ton of videos online that guide you through the setup and have you up and running within approximately 10-15 minutes.

Visual Studio - Express is free from Microsoft and has has all the tools you'll ever need until you go corporate. I use this one when I want to import school projects and not have to move files around. I'm actually like, I can get any version for free through school (lifetime license... same with OSs heh...) Anyways, VS is just as good as NetBeans, and I don't notice any difference between the two.. really.

My main reason for using NetBeans over Visual Studio is the fact that I write my Java projects on its as well. So, I don't have to switch from IDE to IDE.

Both are free, so I'd try them both and see which one suits you better.

Just to add to my sugar-high rumbling... learn as many languages as you can. If you switch scenes or platforms and you need a specific language... no problem, you already know it. To each is own, of course... but I like to broaden my spectrum.

Good luck!

milkybar_ton
Posts: 26
Joined: Fri Nov 30, 2012 8:25 pm

Re: Which Language to Learn?

Sun Nov 17, 2013 2:47 pm

Anyone had luck with Racket?
I sudo apt-get install racket and it seems to install, i see it on my Pi, i can even get a shortcut for it on the desktop but it won't launch?
ta :?

User avatar
alrdye
Posts: 5
Joined: Thu Nov 14, 2013 4:07 pm

Re: Which Language to Learn?

Sun Nov 17, 2013 4:14 pm

In my opinion start with either Python or C. Python is a great starter language. Its code is very clean and readable, its got most of what you'd want out of any modern language and you'll find lots of books and websites to assist your learning process. C is also a solid language,also with lots of learning resources available, and the previous commenters are correct in pointing out that once you are familiar with it, you'll be able to move fairly easily to the plethora of other languages which closely share it's syntax. If you are brand new to programming I'd start with Python, if you already have some familiarity, at least with the concepts of variables, objects, conditionals, loops, etc, I'd start with C.

Frankly though, unless you have a specific purpose in mind, you really can't go wrong with either. C++ will be a natural evolution from C. For what it's worth, Google uses 3 primary languages, C++, Python and Java. Java was not a 1st choice but because they had so many developers come to them who wanted to use it they allowed it. That should tell you something about the robust and functional nature of those 3.

/my2cents

P.S. And for the all holy love of Poseidon, please stay the hell away from BASIC. I learned to program as a kid with it on the C64. It was an okay language. Those days are gone. Also, unless you are going to be building apps exclusively for Windows (I'd recommend against this) don't start with any Microsoft IDE/platform. Find yourself an excellent text editor, Vim, Emacs, or something equivalent and learn to work in the command line or in a cross platform development environment like Eclipse. I'm personally partial to Vim but that's a whole nother subject/holy war. :)

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

Re: Which Language to Learn?

Sun Nov 17, 2013 4:25 pm

milkybar_ton wrote:Anyone had luck with Racket?
I sudo apt-get install racket and it seems to install, i see it on my Pi, i can even get a shortcut for it on the desktop but it won't launch?
ta :?
Just for you I installed racket.

Code: Select all

soft ~ $ racket
Welcome to Racket v5.3.4.
> 
?
?: undefined;
 cannot reference undefined identifier
> quit
quit: undefined;
 cannot reference undefined identifier
> 
soft ~ $
I've never heard of Racket before but it seems to function.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Which Language to Learn?

Sun Nov 17, 2013 4:31 pm

Just for you I installed Racket too!

And found that if I tried to run 'drracket' (which is the recommended IDE, and is started from the link newly-installed on the Start menu) that it generated a Segmentation Fault and exited.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

milkybar_ton
Posts: 26
Joined: Fri Nov 30, 2012 8:25 pm

Re: Which Language to Learn?

Sun Nov 17, 2013 10:26 pm

Thanks Joan,
I was trying to launch the DrRacket IDE but as someone else says it doesn't seem to work.
I'm ok with using it in terminal, didn't know i could do that, ooops
Got the book Realm of Racket (no starch press) and decided to give it a go

User avatar
duberry
Posts: 379
Joined: Mon Jan 28, 2013 10:44 pm
Location: standing on a planet that's evolving. And revolving at nine hundred miles an hour

Re: Which Language to Learn?

Mon Nov 18, 2013 11:35 am

what is displayed
when starting "drracket"
with in terminal ?
DeeJay wrote: if I tried to run 'drracket' (which is the recommended IDE, and is started from the link newly-installed on the Start menu) that it generated a Segmentation Fault and exited.
lend me your arms, fast as thunderbolts, for a pillow on my journey.
If the environment was a bank, would it be too big to fail
so long; and thanks for all the pi

Return to “General programming discussion”