LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Programming Language (https://www.linuxquestions.org/questions/linux-newbie-8/programming-language-4175460777/)

greytux 05-05-2013 08:11 AM

Programming Language
 
Hi I'm from Australia and would like to know the best language ( for Linux as a newbie like me ) to learn.
All help would be great.


Thank you

IamaHack 05-05-2013 08:21 AM

Greytux, wars have been fought over less. Almost any answer that someone gives you would be opposed by some one else. That said, I would suggest learning the C language if you have any interest in developing Linux drivers or kernel features, since that is the only language that can be used for kernel development.

johnsfine 05-05-2013 08:34 AM

Quote:

Originally Posted by greytux (Post 4945303)
Hi I'm from Australia and would like to know the best language ( for Linux as a newbie like me ) to learn.

Just a newbie at Linux or at programming as well?

C++ is the best language for almost all purposes. (Obviously, many people here will disagree).

Quote:

Originally Posted by IamaHack (Post 4945310)
I would suggest learning the C language if you have any interest in developing Linux drivers or kernel features, since that is the only language that can be used for kernel development.

Very few programmers ever work on drivers or the kernel in Linux. Neither a Linux newbie nor a programming newbie should be aiming at those as a direct goal. After you are experienced in both programming and Linux, you might want to learn how to code Linux drivers or parts of its kernel.

Many people suggest learning C before learning C++. I don't think that is a good idea. I/O and strings and containers in C++ are important features for beginning programming and are much easier to learn in C++ than the corresponding features in C. So I think it is best to start with a practical subset of C++ that includes those features. As you progress from beginner to intermediate in C++, you would naturally learn almost everything you would need to program in C. If at that point, you were interested in Linux kernel programming, learning more advanced C instead of more advanced C++, would be an easy next step. I think you can get to advanced C programming more easily through beginner C++ programming than through beginner C programming.
If the next step after intermediate C++ is big complicated projects, then one would stick with C++ and learn more of it.

Quote:

Originally Posted by IamaHack (Post 4945310)
Almost any answer that someone gives you would be opposed by some one else..

I'll oppose the word "almost" in that claim.

Another language I would suggest is bash. If you want to really learn Linux, you need to understand that bash is used as a programming language, not just as a command language. If you want to really learn Linux, bash may be the most important programming language to learn. Probably the biggest reason I haven't become a Linux expert myself is lack of patience for learning bash. When used as a programming language, it is a painfully awkward programming language. But it is heavily used as a programming language in Linux. Understanding Linux requires getting a lot of information that is not really documented and can only be learned by understanding various bash programs.

Obviously, far more of the full system is written in C, rather than in bash. But far more of the C functionality is documented well enough that you can be expert in using it without ever looking at the source code. The bash portions differ more from distribution to distribution and are less well documented, and Linux experts depend more on understanding the bash source code than on understanding the C source code.

IamaHack 05-05-2013 08:39 AM

See what I mean? ;-)

I use C++ for application development and C for kernel development, and have used Java, Perl, Bash and assembly where I had to or where it was appropriate. You almost have to learn some kind of shell scripting when developing for Linux.

jdkaye 05-05-2013 09:01 AM

Quote:

Hi I'm from Australia
G'day maite. ;)
Quote:

[I] would like to know the best language
It's a bit like asking "I'd like to know the best tool". A spanner is a good tool but you wouldn't use it to saw a plank in half. Tell us what you're interested in doing and then let the suggestions flow.
jdk

johnsfine 05-05-2013 09:10 AM

Quote:

Originally Posted by jdkaye (Post 4945334)
"I'd like to know the best tool".

A vice-grip, of course. There is a correct tool for every job, and when you can't find it, you use a vice-grip instead. (I didn't like using a vice grip to cut a plank in half, but I've done it.)

C++ is much more general purpose than vice-grips. There are lots of specialized tasks in scripting or networking or text manipulation in which some other language is better. But that ignores the cost of learning and remembering all those other languages. If you know C++, it is pretty good for almost any programming task. No other language has near that range.

mohscorpion 05-05-2013 09:24 AM

i guess first you should focus on your goals .
for low level coding and direct access to os and hardware mostly c and c++ are used ( a little higher level than assembly and also mostly cross platform ).
for high level without GUI or simple guis , there are lots of languages for applications and web application like TCL , Perl , Python , Ruby and so on.
if you like very new approaches which are cross platform and also nice gui , you can consider JAVA and MONO ( .net ) .
also i have to strongly agree with johnsfine , bash is more than command script and is heavily and smartly used for programming and is very good for understanding linux .
the bottom line is : there is no absolute best language each one has it's own pluses and minuses . even for specific applications , weak points in a language can become a plus point and vice versa.

jdkaye 05-05-2013 09:25 AM

@johnsfine YMMV. I wouldn't recommend C++ for any job involving pattern matching.
jdk

DavidMcCann 05-05-2013 09:29 AM

Learning C as a first language may be a bit like learning to swim by jumping off a cliff! Python is quite easy and very versatile: a lot of the configuration tools in Linux distros are written in it: see the Wikipedia article for details.

flshope 05-05-2013 09:54 AM

The "best" language depends heavily on your application. I got into programming by learning Basic. My interest was scientific programming, and I quickly got into Fortran. I have considered C and took some courses, but that language struck me as too undisciplined (maybe I should say "too flexible") for scientific applications, where you have a lot more to worry about than just programming (like getting the physics and numerical methods right).

mohscorpion 05-05-2013 03:03 PM

i forgot to say , PURE Basic is also a good choice based on your needs . it is cross platform ( even executable on mac ) , high performance and advanced graphics support.


All times are GMT -5. The time now is 06:58 AM.