Which Programming Languages for Linux

otinane

Member
Oct 13, 2016
68
13
36
OK, i' m currently working on acquiring CCNA and RHCSA. I strongly believe that learning some programming could help any professional ambitions.

I have come down to start with Python, then move to C, and finally to assembly.

All the above through self-learning.

Any suggestions, tips, pitfalls to avoid? And even if it never happen to use them i could "play" on git etc
 

ControlD

Diamond Member
Apr 25, 2005
5,440
44
91
If you are just wanting to pick a language at random to start with, Python is a pretty good choice. Python is fairly friendly to learn. If you have an actual goal in mind then you should try to pick a language based on that instead.

Personally, I started with Pascal, then C, and I am now learning Python. There are a ton of good Python learning resources out there if you decide to start with that.
 

otinane

Member
Oct 13, 2016
68
13
36
If you have an actual goal in mind then you should try to pick a language based on that instead.

That's a useful input. I am not looking to be a programmer, but to have a programming language to assist me on a networking/linux administration job.

I know for linux C is the basis, Python is a widely used language (i think it can be used in networking as well), and assembly because it's useful in debugging.

I also has notice R, which is used in statistical analysis/financial data, since i have a degree in economics, so maybe i should consider it as well.
 

Murloc

Diamond Member
Jun 24, 2008
5,382
65
91
since you have to do admin stuff, my thinking is that what would be useful is being able to automate repetitive tasks.
So I would suggest learning bash very well.
 
Last edited:

otinane

Member
Oct 13, 2016
68
13
36
I know what you mean with bash scripting for repetitive tasks. And also know the basic guidelines for that.

The standard arguments like: if/then/else, for/do, while/do but i can't find a handy handbook.

It seems that in the end it comes down to personal creativity.
 

Chaotic42

Lifer
Jun 15, 2001
33,929
1,098
126
I know what you mean with bash scripting for repetitive tasks. And also know the basic guidelines for that.

The standard arguments like: if/then/else, for/do, while/do but i can't find a handy handbook.

It seems that in the end it comes down to personal creativity.

If you want a good handbook for BASH, try this: https://www.amazon.com/Bash-Pocket-...89275345&sr=8-4&keywords=bash+shell+scripting

The book Classic Shell Scripting is good as well, but much larger. Get familiar with things like sed, awk, grep, and the like. Python has a lot of handy modules available to help interface with a GNU/Linux-based system. I'm a Python programmer (mostly), and like Java, it's super popular but abused to hell and back. Document your code using Docstrings, use sensible variable and function names, and test the crap out of your functions/modules. Pass them weird inputs. Try to break them. Unfortunately Python will barf on corner cases in production code if you're not careful. A good thing to do is to check out some project from GitHub/GitLab/whatever and read the code. Does it make sense? What would you have done differently?

Keep in mind there are different standards for Python, namely 2.7 and 3. A lot of folks still use Python 2.7, and I wish they had called Python 3 something else, because you'll find a number of books on 2 or 3 just called "Python". C is similar, there are a few standards, but at least go for C99. Assembly is fun, but can be frustrating.

It sounds like you're on a good path. I don't really know anything about CCNA, but being comfortable with Python and BASH scripting is a huge plus and will make your job a lot easier, I'd imagine. They look good on a resume too.
 

otinane

Member
Oct 13, 2016
68
13
36
Thanks for the info on bash script books. I'm certainly going to check them.

As for C and Python, i managed to find two books that focus on practice rather than theory, because wherever i have searched info, everybody is saying that programming requires a lot of practice.

And yes, i kinda looked ahead, and already have create a git account just for that, reading code from others, and play with it, for practice.
 
Feb 25, 2011
16,801
1,474
126
For fun, do the ProjectEuler exercises in Bash and Python.

As a networking / sysadmin, those are the two you need to worry about. Forget C.
 

Red Squirrel

No Lifer
May 24, 2003
67,641
12,241
126
www.anyf.ca
C is the main goto for Linux, but from a professional standpoint, programming is not something you tend to see often as that is usually outsourced and/or premade programs are used. Bash scripting is something worth looking at though. I'd probably look at that before C/C++ but it is good as a hobby language as you can do a lot with it and it's a general language and not tied to any platform.
 

you2

Diamond Member
Apr 2, 2002
5,724
947
126
I prefer c++ myself - with lots of stl usage - though boost is the flavor of the day. Also java isn't bad. - Some folks are finding new love with go (google simplified version of c/c++).
 

DidelisDiskas

Senior member
Dec 27, 2015
233
21
81
I think it's pretty good to know C in any case, since you get a feel of how things work under the hood. I really liked "C Programming: A Modern Approach, 2nd Edition" when i was learning it. Has a bunch of exercises and goes at a pace where you can soak up the basics skills, unlike something like "The C Programming Language", which is a great book, but can be confusing for a beginner.
 

Greyguy1948

Member
Nov 29, 2008
156
16
91
I believe you have got most of the languages. I am just now using a Raspberry Pi. Not all languages for x86 are ported to ARM. One thing you should learn and test is Open Mp. In Raspberry 3 you have 4 threads for example. Open MP is for C, C++ and Fortran and you can find much info on the net. For learning most languages Rosettacode.org is a very good place.
 

JBT

Lifer
Nov 28, 2001
12,095
1
81
Python, and Bash scripting seem like it would help you on a day to day basis and would improve your value as a Network Engineer. I don't see much reason to go after C unless you've gotten those two down fairly well.
 

hasu

Senior member
Apr 5, 2001
993
10
81
Lazarus is hands down the best IDE for Linux -- especially GUI application development. It has cross platform capabilities, integrated visual debugger and database support. It is an amazing tool based on Pascal Language that produces high performance executables just like c. Lazarus can bring explosive growth to Linux applications.

CodeTyphon is Lazarus pre-packaged with plenty of components.

Gambas is also pretty good with visual basic sort of programming features.
 

Gryz

Golden Member
Aug 28, 2010
1,551
203
106
As others have said, I'd focus on Python if I were you.

Maybe learn a little bash-scripting. Scripting isn't really programming. You're not designing algorithms or data-structures. With scripting you're just throwing lots of activities on a big pile, and try to tie them together. Stuff you want to do is really simple, or it requires you reading manual pages for simple things you have not done before. You'll understand the difference once you've written some Python programs and bash-scripts.

I wouldn't bother with assembler at all. Waste of time. For you. But also a waste of time for most people.

C or C++ are nice programming languages. But to do those, you'd get into the real programming for programming's sake. Which is not your goal. Your goal is to learn programming so you can automate administrative things regarding systems or networks. Python is good for that. You'll never use C or C++ as a systems- or network-admin.
 

Bardock

Senior member
Mar 12, 2014
346
39
91
for ease of learning and understanding without practical application: YAML
to make money in the future: Fortran

Many usa hospitals run old mainframes that are built on fortran. The boomers are aging out. Learn it well and make bank doing that gig.

But for all practical purpose bash, awk, stuff that will help across distros in practically every environment.
 

you2

Diamond Member
Apr 2, 2002
5,724
947
126
Fortran isn't a horrible language; though I haven't touch it since the mid 80's. Hum. Actually I did help someone find a bug in 93 (one of those situation where the variable didn't have a correct value because the line was one character too long. And while it isn't as bad as cobol (which I hear is still in use somewhere); I really can't recommend anyone actually learn it today.
-
I myself like C++; but not sure it is the future.
-
Btw are you sure banks used fortran ? Never saw much fortran there - mostly old govt labs used fortran for numerical libs.
 

LPCTech

Senior member
Dec 11, 2013
680
93
86
I just got a position as a sysAdmin for a large company. They want me to know bash and powershell. We use a mix of windows and linux servers while all workstations are windows.

Personally. Regardless of use, I feel like the languages to learn now are Python, JavaScript, and C#. These are the most in useful imo.

Assembly - waste of time unless you are creating an OS
C - unless you are creating linux software, again, kinda a waste of time. Always good to know C I guess.

GL
 

urvile

Golden Member
Aug 3, 2017
1,575
474
96
C is good for fundamentals. If you want to understand how to manage memory alloc/dealloc etc. Assembler might be good for understanding the fundamentals of CPU registers and stuff and low level operations. What you want to learn is C# (.NET/Mono), Java, Javascript/Jquery and some fundamental concepts/patterns like MVC.

One thing I have learned over the years is you want to make it easier for yourself not harder. Some languages are much better designed than others and go hand in hand with technical approaches like OOAD and design patterns. Also languages like the ones I mentioned are more likely to get you a job.

EDIT: Oh if it is specific for your job then I would learn whatever they use currently. :)
 
Last edited:

urvile

Golden Member
Aug 3, 2017
1,575
474
96
for ease of learning and understanding without practical application: YAML
to make money in the future: Fortran

Many usa hospitals run old mainframes that are built on fortran. The boomers are aging out. Learn it well and make bank doing that gig.

But for all practical purpose bash, awk, stuff that will help across distros in practically every environment.

A buddy of mine does ground water modelling and he is using fortran dlls/assemblies/whatever which he calls from C# code (using a wrapper I would assume). It's Fortran 77. He sent me some screenshots of it. It looks horrendous but if you want to go down that track then COBOL is another one. There are still a lot of IBM mainframes out there running COBOL.
 

Bardock

Senior member
Mar 12, 2014
346
39
91
lol I am no programmer but have done some websites in the past but they had cms and install scripts and I didn't have to learn much in the way of php and all that javascript. But its handy to know if something breaks.