Tom's Hardware > Forum > Linux/Free BSD > Linux/Free BSD General Discussion > Most Useful Linux Related Programming Language(s)

Most Useful Linux Related Programming Language(s)

Forum Linux/Free BSD : Linux/Free BSD General Discussion - Most Useful Linux Related Programming Language(s)

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

I want to learn a new programming language, just for something to do. I'm building a Linux rig pretty quick here, so what's a good language to learn? I want something that's not brutally complicated, but is still useful. Thanks :)

Sponsored Links
Register or log in to remove.
- 1 +

It kinda depends on what you already know, and if you want to stick to open source tools...

C & C++ are the main programming languages, and always usefull.
Perl & Python (scripring) are always usefull.
Java has been around for a long time and just keeps gong.
PHP (5 or 6) is well worth knowing, if you know C++ you'll find it big-time easy to learn PHP; learning MySQL will compliment it very well; PHP 6 will probably be a much sought after skill in a year or two.

C# (& Mono) I'm in two minds about, there's a lot of need for C# programmers; but MS holds all the patents and could let loose the Dogs of Law at any moment...

Reply to MrLinux
- 0 +

C, C++, Perl, Java and PHP use very similar constructs, if you know one it's much easier to pick up the rest.

Start with C and Perl :)

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0
- 0 +

I'd say that C++, Perl, and even Java fit the description "brutally complicated" (for beginners at any rate). I'd go with C or PHP. But it's kinda difficult to be sure without knowing what languages you already program in. C will provide a good foundation for many other languages; on the other hand it's much easier to do useful things like database access with PHP.

Reply to ijack

C# is dead easy on Windows because of .NET, but I'm not sure how complete the Mono project (open source implementation of the .NET framework) is. Never really looked at it. Not needing to worry about managing memory, or spending 30 minutes just programming a blank form is nice. C# is all about a trade-off of Rapid Application Development with the power of C++.

PHP is pretty easy but debugging it can be a pain. The errors aren't exactly descriptive, and since PHP is interpreted rather than compiled, if you have a bug inside a program loop, you could end up with a very... interesting looking web page, filled with countless identical errors. :lol:

Reply to randomizer
- 0 +

http://www.perl.com/pub/a/2000/10/begperl1.html

 
Quote :


Perl is the Swiss Army chainsaw of scripting languages: powerful and adaptable.

 
Quote :


#!/usr/local/bin/perl
print "Hi there!\n";

 

O'Reilly's Perl.com is a great place to get started. O'Reilly also publishes some very nice Perl and other computer books :)

 


If you have the right mindset you can teach yourself Perl and probably PHP in a few days by just playing around with examples from various sites :)

 

The same is true for C although C is much harder to master.

 

Scripting languages get you up and running fast and rather easily compared to most compiled languages.

 

With C# you are beholden to Microsoft, they may decide to shut you down or sue you any time they feel like it.


Message edited by linux_0 on 07-05-2009 at 07:01:55 PM
------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

Microsoft seem to be fairly lenient with open source versions of their proprietary stuff. Look at ReactOS for example. It's only in alpha stages I know, but it is meant to be an open source version of Windows. I wonder if M$ will just wait until the projects mature alot before suing, like Rambus :P

Reply to randomizer
- 0 +

Microsoft just got done beating up on TomTom over a very old and probably invalid FAT patent, I wouldn't want to take any chances.

They have also been attacking Linux for many years by proxy via SCO.

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

Thanks for all the feedback guys. I guess I should have probably included what I've already done :)

HTML, CSS, JavaScript (Not really programming, but it's similar)
Visual Basic
C++

I've done a bit of each, but do not fully know them (I'm not sure anybody does:p). I get the idea of how they work though, I just lack the experience.

Reply to Pyroflea
- 0 +

Since your know some HTML, CSS, JavaScript and C++ already branch out to PHP and Perl :)

Then circle around and pickup some good old C.

Understanding what you know and don't know leads to true wisdom.

:)

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

linux_0 wrote :

Since your know some HTML, CSS, JavaScript and C++ already branch out to PHP and Perl :)

Then circle around and pickup some good old C.

Understanding what you know and don't know leads to true wisdom.

:)



I started reading that Perl website you sent me, I like what I've seen so far :) I'll also check out PHP. :)

Reply to Pyroflea
- 0 +

Perl and PHP are similar so once you learn a bit of Perl it's much easier to pick up PHP and vice versa.

Perl also helps you learn shell.

Another great advantage of Perl and PHP is that they are cross platform, they will run on many different operating systems and architectures with no changes or very minimal changes.

Since they are interpreted you don't have to recompile your code either.

Great stuff :)

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

What program do you use to write Perl in? As well as other programming languages in Linux. On windows I just use Visual Studio for most things, but this is a bit of a different ball game.

Also, when writing programs, is there any way to make the programs compatible on most platforms? Or does that depend on which language you're using?

Reply to Pyroflea
- 0 +

Any editor :)

gedit, kedit, eclipse, kdevelop, Vi, emacs.

Some of these editors have syntax highlighting and other nice features.

Perl itself runs on almost anything and your code is mostly portable.

cpan.org has a bazillion modules you can use :)

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0
- 0 +

I'd say C is probably the be-all end-all for Linux. I mean, C was created for the purpose of writing the original implementation of Unix back in the '60's, so C is VERY MUCH ingrained in the *nix scene. Perl is also a biggie as it lets you rapidly manipulate large sets of data. As I understand it, Perl is pretty much the go-to language for any kind of complex string manipulation. PHP might be a good thing to pick up for Linux if you want to do any web stuff as it is part of the heart and soul of LAMP (Linux, Apache, MySQL, and PHP).

If you are interested in Kernel development or OS development in general, then C is an absolute MUST and the assembly language of your target processor should be fairly useful as well.

From what I heard, programming in Python can be pretty fun as you can use it to make prototypes for "real programs" (read: C-programs) really fast. There are decent tools for Python as I understand it (though I haven't used any) and as for its relation to Linux, Gentoo uses it to develop their package manager, so I think that means it carries some importance in the Linux world.

If you want a really handy tool, learn to program in the Shell (various dialects such as bash, ksh, zsh). It is really useful for making tools to automate tasks, and you can then use a cron program to automatically run those tools at a certain time!

If you would like to contribute to the KDE project, your C++ will serve you well. This is just something to keep in mind. It should also be fairly easy to make C++ programs for Linux, unless of course you learned to do C++ using something like visual studio or borland where much of the code is generated for you.

Java: this is a bit of a weird one as it has been in various stages of becoming open source for a while. It is good for making cross platform programs as it is an "interpreted" language (compiled to bytecode which is later interpreted at run time by a virtual machine). Programming in Java will be a bit disorienting if you are a big C/C++ fan as they remove pointers! Java was actually my first "real language" (the BASIC I knew doesn't really count), and though I liked it, after years of C/C++, going back to Java felt a bit like being given a pair of blunt scissors to work with.

As for development environments, if it is an IDE you want Eclipse is a good bet as it has only about 10^9 - 1 plugins for it. If you want to be a little more "hardcore" you can just choose to invoke gcc manually and program in vim and learn to use gdb from the command line (or use ddd, which is a frontend).

For a really awesome editing tool, you should really learn to use vim. I can't emphasize this enough! Once I started using vim, I was able to finish long and tedious editing tasks in a fraction of the time. Case in point being trying to fix code that got mangled by my programming partner's editor. His editor screwed up all the tabs and made our code hard to read. Normally I'd have to go through and fix everything manually, but in vim, all I did was type about 10 keys to combine different commands and it fixed the formatting of the entire file!

Vim is a great editor, and if you'd rather try a graphical version of it, you can install gVim instead, which also has Windows and Mac support. It comes with a bunch of pulldown menus at the top and all the commands in the menus have their keyboard shortcuts listed for a quick reference. Vim is intimidating to learn at first, but after about a week or so of just using it, you will probably never want to go back to notepad or gedit or whatever. If, on the other hand, you don't like vim, I have heard good things about nano/pico, joe, emacs, and gedit is pretty useful as it has tabs and syntax highlighting (like vim).

There are SO MANY free tools for programming on Linux that you are sure to find SOMETHING that you will like. Just try out the different tools we suggested and go nuts!

Just to recap in case you got bored and skipped to the end: C is the heart and soul of Unix, vim is a great editor, Perl/Python/PHP are all good languages to pick up, and Java is weird. I hope this helps!

-Zorak

Reply to Zorak

Wow, thanks a lot Zorak! That was a very useful post. I do eventually plan on expanding my C/C++, but it's just somewhat of an intimidating language, so I'd like to learn an easier language just to get the hang of programming again (I used to do a lot but I kind of quit over the last year, just recently restarted). But thanks again, very appreciated.

Reply to Pyroflea
- 0 +

Sorry for the double post, but I forgot to mention that LISP is probably a good language to learn eventually as it is very good for making lists of things and it has become widely accepted as the language of choice for AI development. If you would like to widen your programming background and learn functional programming (as opposed to imperative which is like C or object-oriented like Java), then LISP and Haskell are good choices. I have heard that learning these functional programing languages is really good for broadening how you think about programming. Good luck!

--Zorak

Reply to Zorak

Thanks again. I've got a lot of reading to do in order to decide which one(s) I'm going with :)

Reply to Pyroflea
- 0 +

Yeah, if you approach C from the assembly/machine code level, many things about the C language will become painfully obvious. Unfortunately assembly language can be horrendously complex to get into, but if you are interested, you should pick up a copy of this book. This was a book written by one of my favorite teachers, and it makes learning about assembly language and how a CPU works (albeit at a high level) pretty easy as you are learning a theoretical/simplified architecture. Making the jump to C from that solid basis then becomes a relatively trivial step (things like pointers then become pretty easy concepts). Incidentally, by learning this way, you will also be able to understand a bit how a compiler works as you would be able to generate the machine code yourself just by looking at the original C-source!

-Zorak

Reply to Zorak

Sorry, but I'm having some issues with navigating that website for some reason (probably because I just rolled out of bed [funny how this is the first place I come when I wake up...]). Do you have to purchase the book, or is it available for free online? Thanks.

Reply to Pyroflea
- 0 +

Linux has good built-in documentation, although it is a bit intimidating and technical ( /usr/doc/, etc ).

Wikipedia, ibiblio and various other sites have some useful documentation and info about various languages and useful links.

http://en.wikipedia.org/wiki/Ibiblio

http://en.wikipedia.org/wiki/Linux [...] on_Project

http://tldp.org/

Some universities post info on programming and sometimes offer class materials for free.

Good luck :)

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0
- 0 +

I had to buy the book when i took his course, but I am sure that you can find it super cheap online or at a used bookstore. I learned from the 2nd edition, and I believe he will be putting out a new edition soon, but the older editions of the book will serve you just as well as the new one. I am sure there are also places online where you can "acquire" a scan of the book, should that be necessary...

Either way, it is an interesting and useful book.

-Zorak

Reply to Zorak

I've decided to start learning C; it seems quite useful, and is partially tied in to an upcoming project of mine. I went through This entire tutorial today, and I like C so far. I'm just wanting to expand more on the base that that guide has given me, so does anybody have any suggestions for further reading, be it online or in book form? That would be much appreciated :)

Also, the only thing on that guide I couldn't get to work is the final project. It says to "Compile this program using the alias Cgfx", but I have no clue what that means or how it's done, and I believe that is the reason I am getting errors (even with the copy/pasted code) and it is not compiling. I'm using Code::Blocks for writing the code and GCC as my comiler. Help? :p

Reply to Pyroflea
- 0 +

Cgfx is a custom alias on drexel.edu's compile server so it won't work on your system.

Also their last example is using a custom graphics library developed at drexel.edu which is not available. You can't use the code in their example without the lib but you can use standard X11 calls instead.

Good luck :)

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

Ahh alright. Thanks :)

Reply to Pyroflea
- 0 +


This'll work :)

http://linuxgazette.net/issue78/tougher.html

Code :
  1. #include <X11/Xlib.h>
  2. #include <unistd.h>
  3. main()
  4. {
  5.   // Open a display.
  6.   Display *d = XOpenDisplay(0);
  7.   if ( d )
  8.     {
  9.       // Create the window
  10.       Window w = XCreateWindow(d, DefaultRootWindow(d), 0, 0, 200,
  11.                   100, 0, CopyFromParent, CopyFromParent,
  12.                   CopyFromParent, 0, 0);
  13.       // Show the window
  14.       XMapWindow(d, w);
  15.       XFlush(d);
  16.       // Sleep long enough to see the window.
  17.       sleep(10);
  18.     }
  19.   return 0;
  20. }



You can compile the program with the following command:

prompt$ g++ test.cpp -L/usr/X11R6/lib -lX11
prompt$ ./a.out

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0
- 0 +

The code was tested. It works on a modern x86_64 distribution with g++ 4.3.2

man XOpenDisplay

man XCreateWindow

for info on how the funcs work :)

Good luck :)


Message edited by linux_0 on 09-14-2009 at 05:46:00 AM
------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0
- 0 +

The example above compiles and runs with gcc and g++ :)

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

Perl takes a while to get used to, but it is by far the most powerful and affective coding language I have used. I would highly recommend either it or C++, as long as you are either fairly familiar with coding or you buy the manual.

------------------------------ "Half of the American people have never read a newspaper. Half never voted for President. One hopes it is the same half."

~Gore Vidal
Reply to Bruceification73

Bruceification73 wrote :

Perl takes a while to get used to, but it is by far the most powerful and affective coding language I have used. I would highly recommend either it or C++, as long as you are either fairly familiar with coding or you buy the manual.



Thanks for your input :) As mentioned, I've decided to go with C right now, as it's relevant to my current interests, but I do plan on tackling Perl someday, and expanding my C++ as well.

Anybody out there know of any more slightly-more-advanced sources of C tutorials? I can't find any :(

Reply to Pyroflea
- 0 +

http://en.wikipedia.org/wiki/C_%28 [...] anguage%29

 

http://en.wikipedia.org/wiki/Perl

 

http://computer.howstuffworks.com/c.htm

 

http://computer.howstuffworks.com/perl.htm

 

http://www.cprogramming.com/tutorial.html#ctutorial

 

Some Colleges and Universities post their entire C/C++ class material online

 

MIT has some stuff online, I'm not sure if they cover C at the level you're looking for but it's worth a shot. [ fixed typo ]

 

http://ocw.mit.edu/OcwWeb/web/cour [...] terScience

 

http://oreilly.com/ has some good books on the subject and I think they'll let you download the code examples from most of their books for free.

 

Good luck :)


Message edited by linux_0 on 10-17-2009 at 11:30:19 AM
------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

Thanks :) I'll have to check all those links out!

Reply to Pyroflea

randomizer wrote :

Microsoft seem to be fairly lenient with open source versions of their proprietary stuff. Look at ReactOS for example. It's only in alpha stages I know, but it is meant to be an open source version of Windows. I wonder if M$ will just wait until the projects mature alot before suing, like Rambus :P



As the ReactOS team use no MS code there should never be an issue. All they are doing is creating a binary compatible API that implements the same function calls but in their own code. As the API is in the public domain and no reverse engineering is used the lawyers look to be poop out of luck on this one.

@OP

The advice here is good (as normal). All that I would add is that moving from a procedural language like C to C++ take a mind shift. I did both at Uni and wish I'd missed C and gone straight to C++. Personally I was rather taken with Pascal and the fact that it forced good practice from the off, not much point getting into it now though :(

Reply to audiovoodoo

audiovoodoo, don't get mad at me for being a noob, but how did you and all the other Regulars and Moderators get your "More Information" thing to say you joined Tues Jan 01, 1970, seeing as how this site wasn't around back then (neither was the internet)? Also, why does it say you have almost 9,000 posts but only 3500ish points, when posts are worth 4 points? Please give a serious answer.

------------------------------ "Half of the American people have never read a newspaper. Half never voted for President. One hopes it is the same half."

~Gore Vidal
Reply to Bruceification73

Bruceification73 wrote :

audiovoodoo, don't get mad at me for being a noob, but how did you and all the other Regulars and Moderators get your "More Information" thing to say you joined Tues Jan 01, 1970, seeing as how this site wasn't around back then (neither was the internet)? Also, why does it say you have almost 9,000 posts but only 3500ish points, when posts are worth 4 points? Please give a serious answer.



I have 469 posts, and only 877 points, so each post isn't worth 4 points :) As for the join date, I believe that happened when they changed/updated the forum software awhile back.

Reply to Pyroflea

Thanks, but I get 4 points with each message, and the scoring system on the "status and badges" area of my profile says each message is worth 4 points, so how is it different for you guys? Does it change as you go up rank, or did it used to be different awhile ago?

------------------------------ "Half of the American people have never read a newspaper. Half never voted for President. One hopes it is the same half."

~Gore Vidal
Reply to Bruceification73
- 1 +

Does it matter?

Reply to ijack

Bruceification73 wrote :

audiovoodoo, don't get mad at me for being a noob, but how did you and all the other Regulars and Moderators get your "More Information" thing to say you joined Tues Jan 01, 1970, seeing as how this site wasn't around back then (neither was the internet)? Also, why does it say you have almost 9,000 posts but only 3500ish points, when posts are worth 4 points? Please give a serious answer.



It was all down to a site update many years ago, yes I've been here for years. The site update wiped the join date for all members and set us to 1970. This was the takeover before BOM, about 3 years back I think.

Reply to audiovoodoo
- 0 +

Tue Jan 01, 1970 is the epoch.

 

5046 posts 1999 points.

 

http://en.wikipedia.org/wiki/C%2B%2B

 

http://en.wikipedia.org/wiki/PHP

 

:)


Message edited by linux_0 on 10-25-2009 at 05:23:50 PM
------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

And as for the low points to post ratio you better ask BoM who decided to shaft it's regulars when they introduced this complete c0ck snot badge rollocks that just seems to attract noobs that think it's a points contest and not content.

Reply to audiovoodoo

audiovoodoo wrote :

And as for the low points to post ratio you better ask BoM who decided to shaft it's regulars when they introduced this complete c0ck snot badge rollocks that just seems to attract noobs that think it's a points contest and not content.



A much better explanation than Proflea.

------------------------------ "Half of the American people have never read a newspaper. Half never voted for President. One hopes it is the same half."

~Gore Vidal
Reply to Bruceification73

*Pyroflea

------------------------------ "Half of the American people have never read a newspaper. Half never voted for President. One hopes it is the same half."

~Gore Vidal
Reply to Bruceification73
- 0 +

BoM needs to implement a quality meter.

 

Some of my own posts are worth 0 quality points, others >0 and others <0. ;)

 

Semper Fi :)


Message edited by linux_0 on 10-26-2009 at 01:20:55 PM
------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

Bruceification73 wrote :

A much better explanation than Pyroflea.



Was that really necessary? Especially in my own thread about a completely different topic.

Reply to Pyroflea
- 0 +

Pyroflea's reply was correct.

The join date got reset during the migration and the point system wasn't added until recently.

Some of us old timers had 4,000 or more posts long before there was ever a point system.

Semper Fi :)

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0
- 0 +

Our friend audiovoodoo for example has 8991 posts and only 3585 points because if I remember right he had 7 or 8,000 posts before the point system.

I've got 5049 posts and 2007 points with roughly 4,500+ posts before the point system.

Semper Fi :)

------------------------------ $GNU_Linux=$Linus_Torvalds=AWESOME();

Need Linux help? PM me
Reply to linux_0

Yeah.. it was about that. I'll admit an awful lot of those are from scrapping down the Other but I do have the occasional moment of compassion and fix the odd problem. I gave up on the HW sections a loooong time ago, about the point ActionMan and Wussy got banned. The Linux section has so far remained fairly civilised.

Reply to audiovoodoo

Bruceification73 wrote :

A much better explanation than Proflea.



You didn't get what I was saying there did you?

Reply to audiovoodoo
Tom's Hardware > Forum > Linux/Free BSD > Linux/Free BSD General Discussion > Most Useful Linux Related Programming Language(s)
Go to:

There are 516 identified and unidentified users. To see the list of identified users, Click here.

Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them