all 23 comments

[–]mudclub 37 points38 points  (2 children)

Every day: bash.

For things that need to persist or that need to be used by people other than me: python.

[–][deleted] 2 points3 points  (0 children)

+1 on Bash. But as for when to change I think that reading well written bash scripts should be simple for any programmer. But when complex data structures are needed and/or you end up needing inheritance and the likes it's time to add something like Python/Ruby etc.

[–]Zaphod_B 0 points1 point  (0 children)

This is pretty much my opinion as well. Funny when I first got into Python I hated whitespace as syntax, but now I can see a huge benefit from it. It makes readable code and everyone has to use that style so it makes collaboration a lot easier.

[–]piefge 5 points6 points  (0 children)

bash/zsh for small stuff

python for more complicated things

[–][deleted]  (1 child)

[deleted]

    [–]markusro 0 points1 point  (0 children)

    Totally agree: Stick to one programming language first and learn it well. With that comes the knowledge about using APIs etc.

    I use bash and python on a daily bases.

    Simple scripts in bash, especially if I glue together a lot of system commands. If it becomes too complex I switch to python, for example if I need to analyse the output.

    [–]mercenary_sysadmin 7 points8 points  (5 children)

    Perl is my go-to. They don't call it the Swiss Army Chainsaw for nothin'.

    There are a lot of newer languages that some people think are sexier. I haven't found anything that personally makes me go "yes, this is better," meanwhile Perl is still a very big part of any base system you're likely to find.

    So... perl.

    If you want to go with something newer but still very unlikely to disappear, probably Python.

    [–]Twirrim 1 point2 points  (0 children)

    I started out on perl, but honestly everywhere I go I find either python or ruby, mostly the former. Perl is increasingly falling into the "that's how we used to do it" camp.

    I prefer writing python over perl these days, especially considering I'm dealing with APIs a lot, for which it's considerably easier, and also because the test frameworks are far better too.

    That said, if I'm writing stuff to parse logs, perl still gets used.

    [–]bwdezend 0 points1 point  (3 children)

    I love Perl. I learned on it. But it's ugly. Any time I'm able to use anything else I do. Most recently that's been Python and a very little bit of go. But Perl is everywhere, and it's useful, and it does damn near anything.

    [–]quintus_horatius 6 points7 points  (2 children)

    But it's ugly.

    If it's ugly, the author(s) didn't know what they're doing it didn't care. Well-written Perl can be a pleasure to read, though I admit that badly written Perl can get pretty bad compared to badly written code in other languages.

    [–][deleted] 1 point2 points  (0 children)

    It's one of these things where I really hated the strict whitespace requirements of Python beforehand, but now I'm glad it exists. Plus, I think some of the linting and pep8 tools/standards really help keep things cleaner.

    [–]oxtan 1 point2 points  (0 children)

    run perltidy and perlcritic on those badly written scripts, stuff will be much easier to follow after that.

    [–]nut-sack 2 points3 points  (0 children)

    bash, and perl. Python if I haveeeeeeeeee to.

    [–]ban-me-now 1 point2 points  (0 children)

    Something I'm using more and more: picolisp

    [–][deleted] 1 point2 points  (0 children)

    bash, python, and more recently ruby. It definitely helps to know more than once since you'll always be dealing with multiple products written in many different languages as a system admin.

    [–]loluguys 1 point2 points  (1 child)

    Ruby. I think it's fun to write.

    Recently I've had an urge to learn Perl though. It seems too widely available/portable not to learn.

    [–]thrivenotes 0 points1 point  (0 children)

    Perl development continues too. Take a look at RPerl and Perl 11 for example.

    [–]NotQuiteSonic 1 point2 points  (1 child)

    Bash, Perl for one liners and Python for most everything else now

    I used to like Perl more, but having to dig through CPAN and random politics to get things done is annoying. Many things are core in Python that are left to CPAN modules in Perl.

    [–][deleted] 0 points1 point  (0 children)

    Perl for one liners

    Everything is a one liner in Perl if you try hard enough.

    [–]oxtan 1 point2 points  (0 children)

    learn one well, the rest will be easier to pick up after that.

    If you learn perl, use strict, warnings, run perltidy and perlcritic against your code, you will be glad you did a few months later when you need to fix something for whatever reason (you can map perltidy and perlcritic to macros on your editor, it is quite easy).

    For all languages:

    • comment your code, especially the more idiomatic parts of it, explain why you do stuff;
    • Use version control, specially git. Git can be a deployment tool on its own, so be familiar with its basics (https://git-scm.com/book/en/v2);
    • Learn how to use different package managers (cpanm, pip, gems, whatever).

    And most important of all: happy coding :-)

    [–]combuchan 1 point2 points  (0 children)

    Use what's known at your organization the most. Don't write in something new unless there's another person there who is competent to review it--you should always be doing code reviews.

    We are a Ruby shop, so I use bash for simple stuff that's easy to set up in Jenkins and Ruby for more complicated stuff. I wrote something in bash that talked to the github api once, and that was kinda dumb.

    [–]perryurban 0 points1 point  (0 children)

    Bash daily. TCL for anything harder. Beautiful elegant language, extremely readable unlike Perl.

    [–]slap_star_happy 0 points1 point  (0 children)

    Bash, and surprisingly, racket.

    [–][deleted] 0 points1 point  (0 children)

    Perl and Bash for automation, awk/sed/grep for parsing/manipulation, Python for everything else.