Question:
What programing language should I learn?
Unixie
2010-10-13 03:00:06 UTC
I work on Linux and FreeBSD machines and know quite a bit of Bash but want to broaden my horizons, I m not really interested in web design though. Which do you think will be the most usefull and serve as the best learning tool for other languages
Four answers:
koppe74
2010-10-13 03:40:46 UTC
Unix/Linux is mostly written in C, so I would certainly learn C... When you've learned that, it's easy to learn C++, as it just add some keywords (and a bit of a different way of thinking) to C++. Knowing C++ will also help you learning Java, and Java coupled with C++ is similar to C# (or Mono, which is available for Linux/FreeBSD).



After learning C++ basics, I would recommend you took a look at Qt (from Nokia), as it lets you make GUI-programs in C++ in a relatively simple way. Qt programs can also easily be ported to Windows and Mac. Qt also comes with a RAD (Rapid Application Development) tool; where you can make the layout of your program, connect the widgets (e.g. textbox, checkbox or button) with eachother, and thus creating much of your program automatically.



For C, the GIMP Toolkit (GTK) can be used in a similar way, though it works in a different way. There are also RAD-tools for GTK.



GTK is the basis for GNOME, while Qt is the basis for KDE. (But even if you use GNOME, Qt would be useful to learn.)



+++



To force you to learn good programming practices, an educational language like Pascal (e.g. FreePascal) may be useful to learn first. To really discover the beauty of Object-Orienting (e.g. C++), Smalltalk is a good language to try. Unlike languages like C++ and ObjectPascal where OO is glued on top a structured language, Smalltalk is OO all the way, and really show you how OO is supposed to work.



Java is very "in", and sure will help you get a job. It's also portable and easy to distribute as part of web-pages.



Learning a bit of assembly (e.g. nasm) may also be useful (don't use gas, it's intended as a backbone for gcc).



+++



If it's more for sys-admin tasks you need to program -- automating routine work, checking logs and so forth -- then Perl is probably a better choice. Perl is a scripting language. Learning the ins and out of bash will also help you with sysadmin, but Perl is more flexible than bash.



There is also a language called Tcl (tool command language) with it's GUI extension Tk (thus tcl/tk), that lets you make similar script to Perl. Tcl is older than Perl, and it's popularity has dwindled. However Tcl has an extension called Expect, which lets you make scripts of the type when-you-see-this-do-that. It can be useful for controlling other programs, by reading the response from the program and sending a command (or keystroke) to it. E.g. you could let Expect handle and ftp-session, by sending your username and password when prompted by the ftp-program.



Python is a good language for quickly writing small programs, and also includes GUI. It is a good alternative to stand-alone Java-programs, but can also be used similarly to Perl (non-GUI automation). Ruby (basis for Rails) is yet another scripting-language, but where Python's syntax is similar to C++, Ruby's is similar to Smalltalk.



LISP (elisp) is used by the emacs-editor, so if you want to make your own functions for emacs, look at LISP. Scheme is similar to LISP, and is used as GNOME and GIMP's scripting-language.



+++



In any case, you should try to learn several different languages of different categories.
jplatt39
2010-10-13 03:50:05 UTC
Perl Python and Ruby. C/C++ is an obvious choice of course but most of the engineers I know work in the latter two languages and you just might not be into recompiling your kernel. To really broaden your horizons of course Lisp or Scheme can be quite helpful. And I had a fun adventure with ada (from which Pascal is derived) yesterday. It's on GCC as gnat. But if what you know is bash, I'd start with perl, python and/or Ruby. Oh and regexes and sed if you are weak on them, which I am.
husoski
2010-10-13 03:43:11 UTC
The most commonly used compiled language in the Unix command-line world is C (or perhaps C++ for new code, but Unix system calls are not particularly object-oriented in the sense of needing an OOP language). So that could be useful.



A more powerful scripting language (though bash is pretty darned capable) like Python or Perl could be good too--especially in Unix/Linux where interpreters are treated like alternate shells. I like Python for prototyping applications.



Java, if you combine it with an IDE like Netbeans or Eclipse (both free) is about the easiest language to develop windowed/GUI applications, if you sometimes want to have buttons and a windows instead of a command line.



There is also a lot of free online documentation and support for all of these.
2010-10-13 03:22:42 UTC
The obvious answer is C/C++


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...