Chirag23
Posts: 2
Joined: Fri Oct 04, 2013 4:13 am

Which language to use?

Fri Oct 04, 2013 4:31 am

Hi,
I am Chirag.I want to use raspberry pi model B for the live streaming project of our.So,which language is better for raspberry pi model B Python OR C/C++???

Please,answer this as soon as possible.
Thank you.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6195
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Which language to use?

Fri Oct 04, 2013 8:28 am

Entirely up to you. You haven't provided enough information to recommend one over the other two.

Chirag23
Posts: 2
Joined: Fri Oct 04, 2013 4:13 am

Re: Which language to use?

Wed Oct 09, 2013 4:53 pm

Thank you...
I just bought a raspberry pi to learn that's why asked about it.In the practical world which programming language is mostly used???

Between these languages Python or C/C++ ???

User avatar
0xFF
Posts: 202
Joined: Tue Nov 20, 2012 7:52 pm
Location: Poland

Re: Which language to use?

Wed Oct 09, 2013 5:15 pm

both... ;-)

User avatar
BluDragon
Posts: 83
Joined: Thu Sep 05, 2013 7:32 am
Location: 127.0.0.1

Re: Which language to use?

Thu Oct 10, 2013 1:37 am

use C++. i love & use C all of the time, but i recommend C++ or Python.
i would recommend using C, but from what i've found, there aren't very many good libraries to use.
if i was going to learn another scripting/programming language i would learn Python.

i made a poll of favorite languages that people use. C is 1st, Python is 2nd, & Perl is 3rd (except if you count "Other") here's the post.
http://www.raspberrypi.org/phpBB3/viewt ... 31&t=54767
"Whenever a separation is made between liberty and justice, neither, in my opinion, is safe." - Edmund Burke
"Men make counterfeit money; in many more cases, money makes counterfeit men." - Sydney J. Harris

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6195
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Which language to use?

Thu Oct 10, 2013 3:44 am

In the practical world C and C++ are used most often, but that doesn't mean anything. It will depend on your own needs rather than what's popular.

I use C because it's best for the sort of thing that I do. Others use Python because it is best for what they do.

When you start learning a language, you learn a set of concepts which are applicable to many languages. Eventually, in order to jump between languages, all you need to worry about is the syntax and you will know the right way to do things in each languages based on the tools the language gives you. So, it doesn't matter what you start with, chances are that you will jump around different languages until you find the one you like anyway.

VirtualLife
Posts: 13
Joined: Mon Apr 29, 2013 11:38 pm

Re: Which language to use?

Sun Oct 13, 2013 12:00 am

I had the same question starting off.

The one thing that I heard was Python having issues with GPIO (forget the details but something like not always working)

That was half the reason I went with c++. The others being, I found more code examples using c++ and I found VisualGDB which allowed me to do my dev in Visual Studio which I have been using since it came out, plus the intellisense/error checking make dev much easier for me.

I only made that decision 6 months ago, but so far, haven't seen anything to make me second guess my decision.

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

Re: Which language to use?

Sun Oct 13, 2013 12:05 am

Chirag23 wrote:Thank you...
I just bought a raspberry pi to learn that's why asked about it.In the practical world which programming language is mostly used???

Between these languages Python or C/C++ ???

Based only on the number of ARM apps, created for specificaly ARM based computers written in a given language I would say that either BBC BASIC, or ARM Assembly are the most used.

Though out of your options I personaly would recomend C.
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

confuseling
Posts: 144
Joined: Mon Aug 26, 2013 1:41 pm

Re: Which language to use?

Sun Oct 13, 2013 12:24 am

DavidS wrote:...
Based only on the number of ARM apps, created for specificaly ARM based computers written in a given language I would say that either BBC BASIC, or ARM Assembly are the most used.
...
Question: "In the practical world which programming language is mostly used?"

Answer: "BBC BASIC or ARM Assembly."

:shock: :lol: :roll:

You're not even joking are you.
http://forums.debian.net

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

Re: Which language to use?

Sun Oct 13, 2013 3:22 am

confuseling wrote: Question: "In the practical world which programming language is mostly used?"

Answer: "BBC BASIC or ARM Assembly."
:lol: :) :lol:

Now if the question were indeed just: "In the practical world which programming language is mostly used?"

My answer would have been:
Arm Assembly. :)

Though:
DavidS wrote: Though out of your options I personaly would recomend C.
Givin the limit placed by the OP.


And if the question were only:
Chirag23 wrote: ...
I just bought a raspberry pi to learn that's why asked about it.
In the practical world which programming language is mostly used???
...
Then I would have to stick to BBC BASIC and ARM Assembly. This because of the very large number of great applications written in the two that are targetted at the ARM based computers.

As I answer keeping in mind that 99% of Linux applications were written on x86/IA32/AMD64(aka IA64) based computers, thinking about x86/IA32/AMD64 based computers. I do like Linux, just being realistic.

Note that he repeatedly over specifies Raspbery Pi. Thus aparently looking explicitly at ARM based computers. As the Raspberry is very explicitly an ARM based computer above all else.


Though as I stated above in responce to the question at hand:
"Though out of your options I personaly would recomend C".


-----------------------------------------------------------------------------------

Thank you for the slightly off topic chuckle.
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

confuseling
Posts: 144
Joined: Mon Aug 26, 2013 1:41 pm

Re: Which language to use?

Sun Oct 13, 2013 2:08 pm

DavidS wrote:...
Now if the question were indeed just: "In the practical world which programming language is mostly used?"

My answer would have been:
Arm Assembly. :)
...
OK, I'll bite.

By what metric is the preferred practical language of the world ARM Assembly, rather than, say, Java, C, C++ or C#?

I mean I could have accepted SQL, COBOL, or Visual Basic (the first isn't general purpose, and the latter two may make you cringe, but in terms of actual economic use they're up there...), or even Javascript or PHP or something (not really general purpose as such, but massively popular nonetheless)...

I happen to think Haskell is a beautiful language, but I wouldn't call it "practical" in the general sense. Much less recommend it to a beginner.

Chirag23:

For what it's worth, I'm a beginner programmer too. I learned some C a long time ago, and am now trying to learn Python.

I would recommend Python as a beginner language. It has broadly C-like syntax (meaning it's easy to translate your Python reflexes into other, more powerful languages) apart from the indenting, it's "fast enough" for many beginner projects, and it's high-level enough to get things moving quickly - you don't have to muck around with memory management or anything.
http://forums.debian.net

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

Re: Which language to use?

Sun Oct 13, 2013 4:04 pm

confuseling wrote: OK, I'll bite.

By what metric is the preferred practical language of the world ARM Assembly, rather than, say, Java, C, C++ or C#?
C is a good language, C++ with out templates is a good language, Never bothered to look at C#.

Though as a practical language for a computer as being EXPLICITLY ARM based, you have to look at the large of pool of software that was created SPECIFICLY for ARM based computers. Especialy when the question is What programing language for SPECIFICLY ARM based system.

Now if we consider C:
The mass majority of Programms written in C that currently run on ARM based computers were written for other systems, or to be independant of the HW. There is nothing wrong with this if you do not care about the underlying system, though the repeated mention of a very strongly ARM based system shows more interest in the system. The same goes for C++, and C#.

So C and its direvites do not realy fit the request. Since OP specified C++, C, or Python with out any exception I said: C.


-----------------------------------------------------------------------------------


So we look at the two languages that many many of the applications targeted to the ARM were written in:

**** BBC BASIC V: ****
Good modern language. Most programs written in it are distributed as simple tokenized files to be run in the Interpreter. Nothing wrong with this as it is probably with in the three fastest pure interpreters around. Still does not help to understand the ARM.

Though since it does provide things like the ability to directly call SWIs, as well as directly call binary executable code, it is a better option than the C derived languages to get in touch with the ARM Architechure.

Allso remember that BBC BASIC V is a modern structured language with pointers, it can be compiled, and I can not think of any advantage that C has over BBC BASIC V (Other than better currently available compilers).


**** AND THEN THERE IS : ARM ASSEMBLY: ****
Many greate programs have been written in ARM Assembly and many tutorials are available for ARM assembly. So there is plenty of example code, and hand holding available. Furthere Assembly is the core of everything, you can not write a compiler for C if you do not know the architechure to which you are compiling.

Most importantly:
ARM Assembly is fairly easy to learn and understand completely. The instruction set is simple and orthogontal, the standardized calling conventions are easy to understand. And it is easty to do anything you want.


ARM assembly is not complicated like x86/IA32/AMD64, M680x0, PPC, or Sparc assembly. Everything is fairly straight forward in ARM assembly. And you get to learn how to optimize, and make system calls. Something that would require Inline assembly to do in the other languages (Make system calls that is).

As for optimization:
It is not dificult to figure how your code is going to execute, and even take advantage of the superscalar architechure of the ARMv6/7. Not to mention once you understanding the caching model, you can do even better with this.

I mean I could have accepted SQL, COBOL, or Visual Basic (the first isn't general purpose, and the latter two may make you cringe, but in terms of actual economic use they're up there...), or even Javascript or PHP or something (not really general purpose as such, but massively popular nonetheless)...
I personally have a strong disslike for COBOL, though that is a different story.

As to VB, JavaScript, etc:
How far are you attempting to get away from the ARM? These do not seem to address the issue of specificaly learning an ARM based system at all. Just my opinion.
I happen to think Haskell is a beautiful language, but I wouldn't call it "practical" in the general sense. Much less recommend it to a beginner.
Well I would agree with you on that. It is not practical.

I did not relize that OP is a complete beginer. In that case I would amend my recomendation and say to start with BBC BASIC V, and then move to ARM assembler (like the 8 and 9 year olds that I am aware of are doing on there RISC OS equiped RPis).


Though personaly I feel that C is better learned after Assembly.
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

confuseling
Posts: 144
Joined: Mon Aug 26, 2013 1:41 pm

Re: Which language to use?

Sun Oct 13, 2013 5:24 pm

I think you're misreading the question:
Chirag23 wrote:Thank you...
I just bought a raspberry pi to learn that's why asked about it.In the practical world which programming language is mostly used???

Between these languages Python or C/C++ ???
This strongly implies to me that Chirag23 is looking for general purpose programming knowledge, and any form of Assembler is a dubious suggestion for a beginner.
http://forums.debian.net

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6195
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Which language to use?

Mon Oct 14, 2013 7:30 am

To say that you need to look at ARM-specific software to determine the best language is amusing. It's limitation of ASM that anything written in it for ARM will only run on ARM... that's not a point in ASM's favour, yet somehow that's a good benchmark? Forget that most of the code running on ARM is written in C and the same programs work fine on other platforms, no, what really matters is that there is some legacy ARM-specific software written in ASM, therefore it's the most practical language. :roll:

User avatar
DougieLawson
Posts: 37654
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Which language to use?

Mon Oct 14, 2013 7:56 am

The choice of language depends on a number of criteria.
  1. Speed
  2. Ease of programming
  3. Ease of maintenance
  4. Processor and operating system
  5. Interpreted or compiled or compiled to interpreted byte code
  6. Procedural or object oriented
For speed of running but slow development I'd choose assembler every time (I've been writing IBM System/370 assembler for 30 years). But the development time is much longer than using a high level language. With a well optimised compiler you don't lose much in raw speed.

For ease of programming I'd choose C, COBOL, REXX, Perl or Python. For ease of web development choose PHP.

For ease of maintenance I'd avoid PHP, Perl and APL (those become "write only" languages six months after you've written them when you come back to add something new or fix a bug).

For processor and operating system (on the RPi) I'd avoid Java (it's still slow) and look at assembler (only because it's good fun to be that much closer to the hardware you're running on).

For compiled choose PL/I, COBOL, Fortran, C/C++; for interpreted choose REXX and for bytecode choose Java, Perl or Python (that's why it takes so long for those things to start running).

For procedural choose assembler, PL/I, COBOL, Fortran, C or Perl; for object oriented choose Java, Perl, Python, C++

I don't consider SQL to be a general purpose programming language, it's an ugly beast with a single primary purpose of accessing data in your database. The programming features are a bit of an abomination. There's a lot to be said for keeping your SQL simple and doing the heavy programming on the rows that SQL returns in the calling program rather than getting the database engine to run an "SQL program".

C++ is also an ugly abomination which is why Java was developed to make object oriented easier. The fact that Java has become an equally ugly abomination says a lot about the ways programmers will put up with things that are difficult to use and exploit. We can say the same about old (non ANSI74) COBOL which simply invited programmers to write unmaintainable spaghetti code. If you want an ultimate challenge and want to learn completely new symbols along with reverse polish notation then best of luck with APL (I got as far as making APL add two and two to make four before I gave up with it).

For the original poster I'd recommend starting with Python since the RPi was made for that and there's lots of resources out there to help new folks learn a new skill.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

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

Re: Which language to use?

Mon Oct 14, 2013 2:52 pm

DougieLawson wrote:The choice of language depends on a number of criteria.
  1. Speed
  2. Ease of programming
  3. Ease of maintenance
  4. Processor and operating system
  5. Interpreted or compiled or compiled to interpreted byte code
  6. Procedural or object oriented
For speed of running but slow development I'd choose assembler every time (I've been writing IBM System/370 assembler for 30 years). But the development time is much longer than using a high level language. With a well optimised compiler you don't lose much in raw speed.
Wow, you are better than I for sure. I looked at 370 assembler a few times, never had the patience to learn it.

I bet that slows down development alot.

I will stick to ARM assembley for the time beings. ARM assembly is much simpler than most other assembly langs (with the possible exceptions of 6502, and MIPS, though I still feel that all instructions being conditional makes the ARM simpler than those).

For me personaly development time in ARM assembly is about equal if not less than in C. Now that is just me, and only true of ARM assembly.
For ease of programming I'd choose C, COBOL, REXX, Perl or Python. For ease of web development choose PHP.
COBOL: To each his own.

C: Very good language.

REXX: Cool I did not know any one still used REXX (I did on the amiga at one time) it is a good interpreted language.

Perl: To each his own.

Python: Seems to have a good structure, seems to be widely used. I have not formed an opinion one way or another. Another Interpreted language.
For ease of maintenance I'd avoid PHP, Perl and APL (those become "write only" languages six months after you've written them when you come back to add something new or fix a bug).

Could not agree more with that.
For processor and operating system (on the RPi) I'd avoid Java (it's still slow) and look at assembler (only because it's good fun to be that much closer to the hardware you're running on).
Ditto.
For compiled choose PL/I, COBOL, Fortran, C/C++; for interpreted choose REXX and for bytecode choose Java, Perl or Python (that's why it takes so long for those things to start running).
i definitely agree with PL/i, Fortran, and C for compiled languags. Personaly I would add Charm, BCPL (Compiled), Pascal, and Takle.

For interpreted Languages agreed on REXX, and would add BBC BASIC V, and SmallTalk.

For procedural choose assembler, PL/I, COBOL, Fortran, C or Perl; for object oriented choose Java, Perl, Python, C++


Agree with all except for cobol for procedural languages.

C++ is also an ugly abomination which is why Java was developed to make object oriented easier. The fact that Java has become an equally ugly abomination says a lot about the ways programmers will put up with things that are difficult to use and exploit.


Yes. I have wondered for years why programers deal with the unneeded hastle of the C++ derived languages. Unfortunately they are here to stay.

And java is about as bad as it gets.

We can say the same about old (non ANSI74) COBOL which simply invited programmers to write unmaintainable spaghetti code.


Ah someone that agrees with my view of COBOL.

If you want an ultimate challenge and want to learn completely new symbols along with reverse polish notation then best of luck with APL (I got as far as making APL add two and two to make four before I gave up with it).


Wow. That is further than I. I gave APL one look and walked away.

For the original poster I'd recommend starting with Python since the RPi was made for that and there's lots of resources out there to help new folks learn a new skill.



Sounds like a reasonable recomendation to give him. I can not speak for Python yet. I have yet to form a complete opinion of this language.
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

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

Re: Which language to use?

Mon Oct 14, 2013 7:25 pm

Assembly is as easy to learn as any other programming language, it also the most useful.
In that even if you do not use it day to day, the knowledge of it will help you with your chosen language.

I know a lot of beginner programmers that moved from one programming language to another, saying they just did not get it, no matter how much they read and tried to follow the tuts, they still did not get the basics.
Then they give ASM a try and after the shock of the short mnemonic, they started to understand the basics and make progress.
They then found other programming language easier to learn.

This is not the case for everyone, it depend on the person.
And just posting that assembly can in some cases, be a good beginners language, can put peoples backup, because if your not one of those people that find ASM easy and you fine it hard to understand, it can make you feel not very bright.
But finding asm easy or hard has nothing to do with intelligence, it just how your brain is wired.

So in short, give it a try and find out for yourself, if you can not get to grips with the normal beginner language.
Batteries not included, Some assembly required.

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

Re: Which language to use?

Tue Oct 15, 2013 1:09 am

@DexOS:

Thank you.

I have mentioned assembly as a good biginers language so many times in so many ways, always to be greated with very quick retorts saying otherwize.

I had never figured out the why there is so much oposition to Assenbly Language. I think that your description is apt.

THANK YOU MUCH
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

kingBakura
Posts: 3
Joined: Thu Oct 17, 2013 10:47 pm
Location: New Jersey
Contact: Website

Re: Which language to use?

Fri Oct 18, 2013 12:19 am

For me, when I first learned assembly language (it was IA-32), it became a lot easier to understand just how a CPU works. It provides a great amount of control when it comes to optimizing your programs. Makes me remember what the computer is actually doing, in contrast to all of the high and higher level languages that are so often used today. I honestly wouldn't recommend it as a beginner program language to learn though. BASIC seems like a pretty good starting point, easy syntax, easy to remember keywords, and it gives you a great idea of what real programming is like.
---------------------------------------------------------------------------------
Raspberry Pi web server: http://rpihomeserver.no-ip.org/

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

Re: Which language to use?

Fri Oct 18, 2013 3:21 pm

kingBakura wrote:For me, when I first learned assembly language (it was IA-32), it became a lot easier to understand just how a CPU works. It provides a great amount of control when it comes to optimizing your programs. Makes me remember what the computer is actually doing, in contrast to all of the high and higher level languages that are so often used today. I honestly wouldn't recommend it as a beginner program language to learn though. BASIC seems like a pretty good starting point, easy syntax, easy to remember keywords, and it gives you a great idea of what real programming is like.
:) Well x86 (IA32) assembly is probably a bad idea for a beginer.

Though Have you looked at ARM assembly?
ARM assembly is very easy to learn and program in.
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

User avatar
BluDragon
Posts: 83
Joined: Thu Sep 05, 2013 7:32 am
Location: 127.0.0.1

Re: Which language to use?

Fri Oct 18, 2013 6:25 pm

DavidS wrote:I had never figured out the why there is so much oposition to Assenbly Language.
ShiftPlusOne wrote:To say that you need to look at ARM-specific software to determine the best language is amusing. It's limitation of ASM that anything written in it for ARM will only run on ARM...
"Whenever a separation is made between liberty and justice, neither, in my opinion, is safe." - Edmund Burke
"Men make counterfeit money; in many more cases, money makes counterfeit men." - Sydney J. Harris

kingBakura
Posts: 3
Joined: Thu Oct 17, 2013 10:47 pm
Location: New Jersey
Contact: Website

Re: Which language to use?

Fri Oct 18, 2013 8:20 pm

DavidS wrote:
kingBakura wrote:For me, when I first learned assembly language (it was IA-32), it became a lot easier to understand just how a CPU works. It provides a great amount of control when it comes to optimizing your programs. Makes me remember what the computer is actually doing, in contrast to all of the high and higher level languages that are so often used today. I honestly wouldn't recommend it as a beginner program language to learn though. BASIC seems like a pretty good starting point, easy syntax, easy to remember keywords, and it gives you a great idea of what real programming is like.
:) Well x86 (IA32) assembly is probably a bad idea for a beginer.

Though Have you looked at ARM assembly?
ARM assembly is very easy to learn and program in.
I briefly worked through this tutorial, link:http://thinkingeek.com/2013/01/09/arm-a ... chapter-1/
about the ARM assembly that the raspberry pi uses, the assembly was pretty clear and straight forward, and the registers seem easier to use than in IA-32 in my opinion. I only worked on it for a few days before other stuff came up, but I would definitely try to get fairly proficient with it at some point in the future. One great application of ARM assembly on the pi would be writing your own custom drivers for things. And of course, optimizing ported software like emulators, etc.
---------------------------------------------------------------------------------
Raspberry Pi web server: http://rpihomeserver.no-ip.org/

kgbman
Posts: 4
Joined: Sun Mar 02, 2014 5:40 pm

Re: Which language to use?

Fri Jul 11, 2014 2:36 pm

>> If you want an ultimate challenge and want to learn completely new symbols along with reverse polish notation then best of luck with APL (I got as far as making APL add two and two to make four before I gave up with it).

>Wow. That is further than I. I gave APL one look and walked away.

As the old joke says "APL -it all Greek to me".

I've been programming for over 40 years now, and I have professionally used many languages, including IBM 370, Intel 86, 6502, Z80 and ARM assembler, ALGOL, Basic, C/C++/C#, Cobol, Fortran, Java, Lisp, PL/1, Python. However, my personal preference is still APL.

As a second or third (or 20th) computer language, because APL (or other Array Programming Languages such as J or K) are so very different form the standard high level languages using "if then else" blocks, it will be a steep learning curve. (Just as learning assembler after Python is.)

However as a first language, with no pre-conceptions, APL is Easy.

The Hello World program:
'Hello world'

Adding 2 plus 2:
2+2

As to APL using "reverse polish notation", that is just plain wrong.
(Not that I have anything against RPN, the Burroughs B5700 mainframe "Master Control Program" used that on it's stack, to very great effect.)

APL does have a very simple order of precedence for functions, from left to right (unless over ridden with parenthesis).
So no more wondering if "greater than" is evaluated before or after "shift left".

As to "learn completely new symbols", yes APL uses a lot of symbols. Not all are new, such as multiply and divide symbols you learnt at school rather than "*" and "/".
But then I looked at all the new functions I had to learn with each Python classe.

Back to the topic: Which Language to use?

As a beginner on the Raspberry Pi (remembering what the Pi stands for), the answer must be Python.

I say this not because Python is the best or fastest or easiest to learn, but because it has the most support within the Raspberry Pi world. I guess that 90% or more of the articles and book on Raspberry Pi will use Python.

Also as a Python programmer, there are currently far more job opportunists than say for APL (but then APL may pay better :lol: ).

Shadow_7
Posts: 52
Joined: Sat Jul 12, 2014 5:50 am

Re: Which language to use?

Sun Jul 13, 2014 2:26 pm

I've always liked assembler, but it is platform specific. And not a skill listed in most job ads. But it has it's perks, compile time, execution time, and resulting binary size are as good as it gets.

I would say C personally. It's one of the few that you could write, shove in a drawer for twenty years, and not have to change any (or much) of it to reuse it. The other thing with C is that you are likely to be the first to have a compiler for the next new thing CPU wise. Without having to relearn much. Be it x86, arm, mips, or whatever the future holds.

I have a decade-ish old java game programming book, and none of that code even compiles on what is java today.

As far as python, speedometer is a nice net usage monitoring tool, until you realize that it's written in python and uses like 30% of the cpu on a raspberry pi. Probably not the best example, but if you want to get the most (resources and performance) out of finite resources, probably not a first call language. Then again, resources are cheap these days. They'll probably be a 2GHz quad core arm board with 2GB+ RAM out by the end of 2015 for < $100.

If you plan on doing something more that hobby-ist things, you might take a look at potential jobs that you might like to pursue. And the requirements for them. At least the ones that make sense. Just one more year and I can apply to those Y2K jobs that required 20 years of win95 experience in 1998.

Heater
Posts: 14729
Joined: Tue Jul 17, 2012 3:02 pm

Re: Which language to use?

Mon Jul 14, 2014 10:46 am

I've always liked assembler, but it is platform specific. And not a skill listed in most job ads. But it has it's perks, compile time, execution time, and resulting binary size are as good as it gets.
Except if you are programming for modern x86 and perhaps other new devices reduced execution time is no longer a sure thing. It's pretty much impossible to know the optimum way to write code for these processors. Compilers will do just as well or at least close enough it not worth the bother of going to assembler. Why? Because with all the "go faster" features of modern CPU's like the various levels of cache, pipe lining, out of order execution, parallel instruction dispatch etc they have become totally non-deterministic in their execution timing. Worse still optimal instruction sequences for one generation of processor may well be very sub-optimal on a new generation. This has happened a few times already. All in all writing in assembler on x86 is a lost cause.

Having said all that I do feel learning and practising a little assembler for at least one architecture is a worth while endeavour for any programmer.

C and C++ are definitely the way to go if you want performance. That portability and longevity of code is worth gold.

Languages like Python are great for getting stuff written quickly. My current favourite is JavaScript running under node.js

Huge resources are not always necessary for Python and JS. Have you see the Espruino and MicroPython projects. Those have JS and Python running on tiny ARM micro-controllers, amazing.
Memory in C++ is a leaky abstraction .

Return to “C/C++”