Most Useful Scripting Language To Learn?
Displaying poll results.30330 total votes.
Most Votes
- What's the highest dollar price will Bitcoin reach in 2024? Posted on February 28th, 2024 | 8470 votes
- Will ByteDance be forced to divest TikTok Posted on March 20th, 2024 | 6370 votes
Most Comments
- What's the highest dollar price will Bitcoin reach in 2024? Posted on March 20th, 2024 | 68 comments
- Will ByteDance be forced to divest TikTok Posted on March 20th, 2024 | 20 comments
Most Useful? No such thing... (Score:5, Insightful)
Simply learning how to learn a scripting language is more useful than the language itself.
Languages come and go, but the ability to learn is a far greater skill.
Agreed (Score:2, Insightful)
Even more complex scripting jobs written in perl or python utilize bash as the glue that ties everything together.
All of them (Score:5, Insightful)
I voted for Bash but I use a fair number of them on a regular basis. I think the real option should be "All of them".
As always... (Score:4, Insightful)
... the answer depends on "what do want it to you use for".
I hate those polls when there's no nonsense option you can choose to say "I hate this poll".
Re:Has to be bash (Score:3, Insightful)
And don't forget about ksh
Perl, to win a woman's heart! (Score:5, Insightful)
Ten years ago, I was doing the Spanish version of an international project in a Incredibly Big Monster company which creates hardware and software. There was a module which was based in a large XML file with lots of nesting levels. In the morning of the deadline day for this module, I saw the Japanese tester desperately fighting to find a nesting error in her version. She told me she had been reviewing the file all night, and she couldn't find the problem. Well, my "help-ladies-in-distress" instinct kicked in, and I took her file, scratched a Perl script to keep track of nesting levels, tag pairings, etc, and run it through the file. One hour later, the problem was fixed.
That day she decided that she would not let me escape, and today I'm happily married to her.
So... PERL RULEZ!
(Anyone knows if there is a "+1, Romantic" in Slashdot?)
Re:Perl (Score:5, Insightful)
Perl is a king when you need to do text processing, there is absolutely no doubt about that.
When it comes to bigger projects though... It is OK, but the library (aka CPAN) is a total mess. The OO model implementation is a little sloppy. It was good for its time, but I think it just stagnated and failed to move into new era (whatever that means :).
I moved to Python and never looked back.
Re:Has to be bash (Score:4, Insightful)
I find it easier to do stuff reliably in perl than in sh. Yes perl can be a bit kludgy, but sh is even worse. Python might be nicer but it's not installed by default on as many platforms.
I've written cross platform perl stuff. Probably could be modified to run on Windows too.
Bash.. Nope, Perl (Score:4, Insightful)
But there are a lot of problems I couldn't (or wouldn't) solve with bash. Database connectivity, parsing files, or building a web page.
So then I reached for PHP, because it's the most useful of what I know best.
Then I got to thinking that Perl's the winner. It's prevalent, flexible, old (mostly in a good way) and has years of (Free) pre-made functionality available at CPAN. Plus, it gave birth to PCRE which is one of the most useful tools I know of.
Re:Has to be bash (Score:4, Insightful)
Yes, but how likely are you to need to run an automated script on a box without perl and that you can't install perl on? Once in a lifetime, maybe? Not worth worrying about, especially given the major limitations of shell scripting.
Re:PowerShell? (Score:5, Insightful)
No jokes. The others are all multi-platform - Windows, OSX, linux, BSD ...
PowerShell not so much.
Re:Has to be bash (Score:5, Insightful)
But those operating systems are minorities today.
In the world of system administration, "minority" is a meaningless word. It works or it doesn't.
You don't want to go to the CTO to tell him that you only broke a "minority" of the servers.
Those servers are going to be different for a good reason, like being legacy and irreplaceable.
The Pareto principle tells us that a minority of the servers will be worth a majority of money to the business, and Murphy tells us that it will be those servers.
Out in the consumerist world, you can often afford to work for the majority, and disregard minorities who can't use your product or services. That saves you money, but you can get away with it if you don't overdo it and blow off the wrong minorities.
In the world where you need to write deployable scripts, you can't. "Mostly" is a synonym to "failure".
I've had predecessors who thought that "mostly" was good enough. Thus predecessors.
UNIXes today are mostly Linux or Mac, on which we can quite reliably lean on Bash or Python.
Non sequitur. The majority of Linux installations are embedded, where you only sometimes have bash, and almost never have python.
If you can't handle writing scripts without the extra support wheels, you are the problem, not the solution.
By all means, use bash and python. But make sure that you know, and not just hope, that your scripts will only be used on systems with bash and python, and where the version of python you wrote it for will always be available.
(And for dog's sake, use #!/bin/bash instead of #!/bin/sh and a python shebang that includes the version of python you need.)
Re:Has to be bash (Score:4, Insightful)
Because they just copied another script and actually have no idea how that first line works?
wrong. the reason is that by using #!/bin/sh you signalize, that the shell script should be runnable under any standard shell (i.e. that it doesn't use any bashisms).
also bash starts up much faster if it is invoked as sh. see the bash manpage about its invocation.
Re:Has to be bash (Score:4, Insightful)
Python by contrast can build some pretty cool applications. It has windowing tool set, and you can write server stuff in it. With WebkitPython, you can even build apps that run in happy little contained web browsers. But it doesn't have the depth or amount of choice that either PHP or Javascript have, in terms of use case possibilities.