Click to See Complete Forum and Search --> : which language to learn?


DebianDave
07-19-2002, 03:43 PM
As a SysAdmin (or wannabe), how do you suggest I spend my summer most effectively?
Learning
-Bash Scripting/Programming
-sed/AWK
-Python
-Perl

I am not a programmer and have NO desire to become on. I just want to learn the tools I need to become an efficient sys admin. I know several well-paid sysadmins who do NOT know any programming languages other than shell scripting (BASH, C, and Korn). This seems to make sense to me. What do you think?
:confused:

TXTad
07-19-2002, 04:03 PM
I think that knowing a good scripting language in addition to the shell scripting is a good idea. Learn the Bash scripting, it's very useful. sed and awk are the least important and to some degree superfluous if you know Perl. As for Perl or Python, get into both of them enough to figure out which one you like better and go with that.

Perl and Python can pretty much do the same jobs, but they are quite a lot different in how they get things done. I might say that Perl is better as an awk and sed replacement and Python is better for making small programs to interact with, but neither language is by any means limited by these tasks. That is just my opinion as to what each is best at. Perl can certainly make a GUI app and Python can certainly process text.

Tad

Strike
07-19-2002, 05:26 PM
Python can do everything Perl can do, but cleaner :)

So, I suggest Python. Though shell scripting is always nice to know.

l01yuk
07-20-2002, 06:11 AM
Definately learn sh and bash scripting since so many configuration scripts are written in it, I would also learn quite a bit about awk and sed since these can be incorporated into shell scripts very easily and can be learnt quite quickly. However, I would then, as suggested, learn Perl or Python for more complex tasks.

If you are going to be a Linux admin I would also learn the rudiments of C so that if there is a problem with an app you can point the overworked IT programmer in roughly the right direction.

sas
07-20-2002, 06:12 AM
i'm attempting to learn python at the minute, doesn't look too hard to get into compared to C and stuff

Gaxus
07-20-2002, 09:31 AM
In my opinion python is THE easiest language to learn EVER.

Yes... more basic than basic :cool: :D

Tis quite powerful too!!! Just don't try to program any games in it :eek:

furrycat
07-20-2002, 09:56 AM
I am a sysadmin. I say learn Perl. So many real world scripts and tools are written in Perl it would be crazy not to learn it. Yeah, sure, if your boss says "I need you to do XXX" you can choose to do it Python or whatever but you WILL end up being given a Perl script to look over/fix/update and you will need to be up to speed.

Shell scripting? Yes you certainly should learn it but don't fret about it straightaway. It's easy to learn and when you think about it, after you've sussed out how to set up functions and conditionals, most of it is just calling standard system tools This does imply that you need to know all about those tools; sed and awk included. Also note that most of the time you will find that Perl is easier and probably more efficient than shell scripting for solving a given problem. I actually knew hardly any shell scripting when I got my first job. My Perl knowledge was a big bonus at the interview.

As an aside, I personally absolutely hate Python. I have never ever needed to use it in a professional capacity. I tried to learn for kicks it but I gave up because it's just horrible. But that's just my opinion and if you get some spare time after getting to grips with Perl then by all means take a look at it.

The best tip I can give you is to set yourself some realistic challenges to solve. For example, pretend you're running a mail server and some users are exceeding their quota. So you need to write a script to trim/delete/whatever your mailboxes, whatever your hypothetical boss wants. Go ahead and set up some mailboxes and write your script. It'll be fun and you'll learn something. Wash, rinse, repeat.

Strike
07-20-2002, 12:26 PM
Originally posted by Gaxus
In my opinion python is THE easiest language to learn EVER.

Yes... more basic than basic :cool: :D

Tis quite powerful too!!! Just don't try to program any games in it :eek:
Why not? There are whole libraries dedicated to it - http://www.pygame.org

Strike
07-20-2002, 12:32 PM
Originally posted by furrycat
I am a sysadmin. I say learn Perl. So many real world scripts and tools are written in Perl it would be crazy not to learn it. Yeah, sure, if your boss says "I need you to do XXX" you can choose to do it Python or whatever but you WILL end up being given a Perl script to look over/fix/update and you will need to be up to speed.
I take pity on the man who has to maintain Perl code. ESPECIALLY code that they didn't write. Perl is historically "write once, read many" meaning that yeah, you can write a cute little working Perl script, but don't expect to be able to make any changes to it due to the indecipherability of it. Python doesn't have that problem. Besides, if you know the basics of Python, you can glean the meanings of MOST well-written Perl (heh). Hell, I know Perl, and I still have to have the O'Reilly Programming Perl book sitting in my lap whenever writing any Perl. The same applies even more so to maintaining others' Perl code.

Shell scripting? Yes you certainly should learn it but don't fret about it straightaway. It's easy to learn and when you think about it, after you've sussed out how to set up functions and conditionals, most of it is just calling standard system tools This does imply that you need to know all about those tools; sed and awk included. Also note that most of the time you will find that Perl is easier and probably more efficient than shell scripting for solving a given problem. I actually knew hardly any shell scripting when I got my first job. My Perl knowledge was a big bonus at the interview.
My advice to those of you who want to live long - don't take a job where knowing how to WRITE Perl is a plus.

As an aside, I personally absolutely hate Python. I have never ever needed to use it in a professional capacity. I tried to learn for kicks it but I gave up because it's just horrible. But that's just my opinion and if you get some spare time after getting to grips with Perl then by all means take a look at it.
What's so "horrible" about it? EVERY time I argue the Perl vs Python argument with someont, the ONLY compelling reason Perl proponents come up with is "I just like Perl", and that is questionable in it's "compelling"-ness. I have yet to meet a person who wasn't entrenched in Perl that didn't like Python much better than Perl.

The best tip I can give you is to set yourself some realistic challenges to solve. For example, pretend you're running a mail server and some users are exceeding their quota. So you need to write a script to trim/delete/whatever your mailboxes, whatever your hypothetical boss wants. Go ahead and set up some mailboxes and write your script. It'll be fun and you'll learn something. Wash, rinse, repeat.
This, on the other hand, is excellent advice.

Gaxus
07-20-2002, 04:21 PM
Why not? There are whole libraries dedicated to it

I guess you could,...... yet the performance would be fairly bad seeing that it's a scripting language.....

furrycat
07-20-2002, 11:08 PM
> I take pity on the man who has to maintain Perl code. ESPECIALLY code that they didn't write.

You don't always have a choice. Like I said, you write your scripts from scratch in Python if you want. You can't just say "I don't want to maintain this code because I don't like Perl" unless you can completely rewrite it in Python in less time.

> you can write a cute little working Perl script, but don't expect to be able to make any changes to it due to the indecipherability of it.

As I'm sure you know, the Perl "motto" is There's More Than One Way To Do It. Yes, you can write code that uses all the cute tricks and looks bizarre to less informed people. Or you can write nice and easy code that anyone can understand. Indecipherable code is a property of the coder, not the language.

> What's so "horrible" about it?

Well first let me say that I like the idea. An object-orientated scripting language is a cool thing. I won't argue that the actual language is well thought out and nicely implemented. Yes it is clean. Yes forcing you to do things their way helps maintainability.

What I don't like is the actual programming process. I find it wordy. I don't want to construct a regular expression object and call methods on it. I just want to "$a =~ /re/;" and be done with it. What annoys me most - and I am sure you will disagree here - is the formatting thing. I don't mind being told I MUST indent my code because I do anyway. It's the way blocks are handled that annoys me. Maybe I'm set in my ways. Maybe I'm weak-minded. Maybe I'm just not a good programmer. Whatever the reason, I find the lack of any visible indication that you've left one block other than there's a blank line to be very offputting. It just doesn't "look right" to me.

The language itself is fine but it's "funny" to program in. I'd learn it if I had to but as I already said I've never had to. Perl is currently the language which people out there use. If that changes some time soon then fine I'll see what I can do with Python but at the moment forget it. At the end of the day "I just like Perl" is a perfectly compelling reason to use it. I've got a job to do. I don't have time to write code in a language I don't like - however stupid my reasons for not liking it are - and which no-one else in the company can read when I can do it more quickly in a language I like and which other staff know.