Sign in with
Sign up | Sign in
Your question

Most Useful Linux Related Programming Language(s)

Last response: in Linux/Free BSD
Share
a b 5 Linux
July 5, 2009 4:25:56 AM

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 :) 
July 5, 2009 5:44:17 AM

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...
a b 5 Linux
July 5, 2009 7:21:47 AM

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 :) 
Related resources
a b 5 Linux
July 5, 2009 7:41:21 AM

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.
a b 5 Linux
July 5, 2009 9:11:00 AM

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: 
a b 5 Linux
July 5, 2009 11:07:44 AM

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.
a b 5 Linux
July 5, 2009 12:13:26 PM

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 
a b 5 Linux
July 5, 2009 1:22:03 PM

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.
a b 5 Linux
July 5, 2009 4:26:23 PM

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.
a b 5 Linux
July 5, 2009 5:17:37 PM

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.

:) 

a b 5 Linux
July 5, 2009 5:18:58 PM

linux_0 said:
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. :) 
a b 5 Linux
July 6, 2009 9:29:21 AM

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 :) 
a b 5 Linux
July 8, 2009 8:38:34 PM

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?
a b 5 Linux
July 8, 2009 11:26:54 PM

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 :) 
July 9, 2009 3:37:34 AM

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
a b 5 Linux
July 9, 2009 3:42:59 AM

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.
July 9, 2009 3:44:29 AM

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
a b 5 Linux
July 9, 2009 3:48:38 AM

Thanks again. I've got a lot of reading to do in order to decide which one(s) I'm going with :) 
July 9, 2009 3:51:40 AM

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
a b 5 Linux
July 9, 2009 3:24:36 PM

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.
July 9, 2009 9:13:53 PM

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
a b 5 Linux
September 14, 2009 2:31:09 AM

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 
a b 5 Linux
September 14, 2009 3:04:03 AM

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 :) 
a b 5 Linux
September 14, 2009 3:06:03 AM

Ahh alright. Thanks :) 
a b 5 Linux
September 14, 2009 3:14:22 AM


This'll work :) 

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

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


You can compile the program with the following command:

prompt$ g++ test.cpp -L/usr/X11R6/lib -lX11
prompt$ ./a.out
a b 5 Linux
September 14, 2009 3:19:44 AM

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 :) 
a b 5 Linux
September 14, 2009 3:32:47 AM

The example above compiles and runs with gcc and g++ :) 
October 15, 2009 9:48:46 PM

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.
a b 5 Linux
October 15, 2009 9:51:20 PM

Bruceification73 said:
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 :( 
a b 5 Linux
October 16, 2009 6:19:48 AM

http://en.wikipedia.org/wiki/C_%28programming_language%...

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/courses/courses/index.htm...

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 :) 
a b 5 Linux
October 17, 2009 1:27:42 AM

Thanks :)  I'll have to check all those links out!
a b 5 Linux
October 18, 2009 3:56:38 PM

randomizer said:
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 :( 
October 25, 2009 5:58:00 AM

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.
a b 5 Linux
October 25, 2009 6:56:47 AM

Bruceification73 said:
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.
October 25, 2009 7:03:50 AM

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?
a b 5 Linux
October 25, 2009 8:18:37 AM

Does it matter?
a b 5 Linux
October 25, 2009 12:27:15 PM

Bruceification73 said:
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.
a b 5 Linux
October 25, 2009 4:02:18 PM

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.
October 26, 2009 8:41:25 AM

audiovoodoo said:
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.
a b 5 Linux
October 26, 2009 11:17:32 AM

BoM needs to implement a quality meter.

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

Semper Fi :) 
a b 5 Linux
October 26, 2009 1:10:37 PM

Bruceification73 said:
A much better explanation than Pyroflea.


Was that really necessary? Especially in my own thread about a completely different topic.
a b 5 Linux
October 26, 2009 4:28:42 PM

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 :) 
a b 5 Linux
October 26, 2009 4:32:52 PM

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 :) 
a b 5 Linux
October 26, 2009 6:16:13 PM

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.
a b 5 Linux
October 26, 2009 6:17:39 PM

Bruceification73 said:
A much better explanation than Proflea.


You didn't get what I was saying there did you?
a b 5 Linux
June 16, 2010 7:47:31 PM

Alright, mega zombie thread time :D  I just have some updates, as well as a few more questions :) 

I've actually made some progress. I'm hoping to get a lot more done over the summer. I've done a pretty good bit of C. I have gone through 2 of those "C for Beginners" type books, and can write very basic terminal-based apps just fine. I need to start going elsewhere with this learning however. I recently found GTK+, and have dabbled in that. I don't really know what the best way to go about making GUI's is, but GTK+ seems to work just fine; it's fairly easy to use (imo). Anything else I should be using, or will this work just fine? Any recommendations on how to start to deepen my understanding of C beyond the point of basic string and integer manipulation?

I've also started doing a bit of Perl over the last week or so. Again, just been making very basic applications, and I have a very basic understanding of how that all works. I'm still working on the tutorial series I found, so hopefully it continues to go well for me. It's a pretty fun language, and seems very logical and straight-forward to me.

Anyways, my main focus will be in C. I would like to start making some basic applications, which can lead into more advanced development for some projects. Perl I'll continue to dabble in, but I'm not planning on getting too serious any time soon. I've started using Linux quite a bit (yay!), so I figure I'm gonna spend some time learning some more terminal commands, and probably learn Shell, as it appears to be pretty simple, and quite useful.


- Jesse
a b 5 Linux
June 16, 2010 9:04:35 PM

How strange, somebody starting in C needs some pointers... :D 

Seriously, look at pointers and allocating memory, then look at managing it. Searching and sorting are also good ones to get your teeth into.
!