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 | 8481 votes
- Will ByteDance be forced to divest TikTok Posted on March 20th, 2024 | 7760 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
Has to be bash (Score:5, Informative)
Bash has to be the most useful in day to day admin work.
Of course that doesn't make it the best for more complex projects.
Re:Has to be bash (Score:3, Funny)
Agreed (Score:2, Insightful)
Even more complex scripting jobs written in perl or python utilize bash as the glue that ties everything together.
Not mine. (Score:3)
Re:Has to be bash (Score:3)
The proper answer is of course: "depends on your needs".
I voted Python as it's easy to learn and very versatile, though as sys admin you'll likely prefer bash and be closer to the system itself. And web developers will prefer JavaScript, PHP or Perl, where JS and PHP are very much web--only and Perl may be general purpose but tougher to learn.
All in all, a poorly set-up poll, but that's expected on /. anyway.
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.
Re:Has to be bash (Score:3, Insightful)
And don't forget about ksh
Re:Why I never actually learned bash vs. sh (Score:3)
Re:Has to be bash (Score:2)
Re:Has to be bash (Score:3)
No, but when it can be done without sacrifice, there is no reason to be incompatible.
Most shell scripts you find will have a #!/bin/sh shebang. Using bashisms without changing this to #!/bin/bash is asking for trouble.
And using bashisms for no good reason at all is even worse (like double brackets when you don't use the additional tests).
So yes, my vote goes to bourne shell. Write it for bourne, and it will run in bash/ksh/ash/dash/busyboxpervertedash too. Not having to worry is useful.
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.
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:Has to be bash (Score:3)
Embedded systems may not have a full featured shell. So even relying on shell scripting won't help.
Embedded systems usually use busybox, which can support a full-featured shell (even bash specific extensions, optionally). Most of the embedded systems I've looked at include at least ash support, so if there's any need to do scripting, shell script is the obvious choice. Anything else is likely to require more system resources.
Re:Has to be bash (Score:4, Interesting)
except unless you install cygwin or the like, it is on zero Windows systems, plus it involves installing a lot of other stuff you may not need. I tend to use perl more than bash or ksh or even csh scripting (largely dependent on the hardware and software I'm using - CAD seems embedded in ksh, but data management is csh or bash), mainly because I can write one script for all platforms with machine dependent code blocks for, say, shutting down and starting Windows services.
Not that I'm advocating the mess that is perl, it is just the best tool available for that job. I personally said javascript because I think with HTML 5 and beyond it will become more and more essential.
Re:Has to be bash (Score:5, Informative)
I tend to use perl more than bash or ksh or even csh scripting
Bad idea. Abort, abort.
Use csh (or better, tcsh) as a shell if you like, but don't use it [grymoire.com] for scripting [faqs.org].
Re:Has to be bash (Score:5, Interesting)
You can use strawberry perl, and then use pp on your perl program to create an exe that runs on most windows machines without having to install perl. I think the exe does tend to be at least 4MB in size unless you use stuff like upx.
Nowadays you can do a similar thing with python of course. I use python for windows gui stuff and perl if I'm going to need to do text processing, parsing and other messy glue
Re:Has to be bash (Score:3)
AFAIK it is actually easier to build a standalone perl or python executable of your script that runs on windows than to get a sh script to run on Windows (target system needs to install cygwin etc).
Re:Has to be bash (Score:3)
Python is installed on pretty much all linux systems by default.
This is not true. Most Linux systems are embedded, and while they will almost certainly have a bourne family shell, they seldom will have python.
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.)
Which "ash"? (Score:5, Funny)
I've seen a few things over the years calling themselves that. The one I actually used was "The Adventure Shell", by Doug Gwyn.
Re:Has to be bash (Score:2)
not if you use #!/bin/bash in the first line
Re:Has to be bash (Score:2, Interesting)
Fail.
solaris:~$ which bash /usr/bin/bash
Typically you should use `#!/usr/bin/env foo'. The env utility is dependably at /usr/bin on almost every platform.
Re:Has to be bash (Score:3)
Fail!
hardix:~$ which env --> /usr/local/bin/yomama/env
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.
MATLAB (Score:3)
Re:MATLAB (Score:2)
Boo!
Python + Numpy + Scipy + matplotlib tends to do the job the same, if not better, all whilst being easier to write and debug.
Plus, you don't have to worry about lacking the toolkits or extensions to do parse strings properly, write custom objects, etc... Also, you can design your interface any way you want to, that is, WITHOUT the figure window.
MATLAB is garbage, and should no longer be used. Python for scientific computing is the way to go.
Re:MATLAB (Score:5, Informative)
Python + Numpy + Scipy + matplotlib tends to do the job the same, if not better, all whilst being easier to write and debug.
Sorry, but MATLAB is the industry standard. As big of a pain as it is, we have a huge repository of functions already written in it. There's just too much momentum to change. Believe me, I tried!
Re:MATLAB (Score:3)
Nah, for a lot of stuff, py/sp/np/matplotlib is better. They have dolfin/FEniCS for finite element computation, for example, which is really the best thing
around nowadays, and far better than Matlab's offerings. For most standard computation, NP/SP has everything you need, and it is the superior language. It's just the existing codebase out there that perpetuates Matlab's popularity. (Momemtum does count. I know plenty of people who still insist on Fortran 77).
Also on the free side is R, which is pretty much the standard nowadays for stats.
Re:MATLAB (Score:2)
I've used them and hate them. MATLAB has some weaknesses when writing very large programs, but domain specific syntax languages exist for a reason. I'll take Octave over Python for my code any day of the week.
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.
Re:Most Useful? No such thing... (Score:2)
Re:Most Useful? No such thing... (Score:2)
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.
To further that point, knowing which scripting language would be most useful in a particular situation is golden knowledge in of itself.
Re:Most Useful? No such thing... (Score:3)
Bah. There are already too darn many languages. They tend to come, but seldom go. I already have way too many languages in my head (Verilog, perl, tcl, bash). How do you code an if/else if construct? Do you use "else if", or is it "elseif" or is it "elsif"? That sort of thing becomes cofusing the more languages you learn. Do you use "if (condition)" or "if {condition}"? Seriously, that sort of thing is annoying!
For anything serious, the bash syntax is just too different from almost anything else out there (I had to google how to add numbers in bash). Bash is a very clumsy language. However, this guy that I work with loves the combination of bash with sed. While it is true that sed is an order of magnitude faster at regexp large files than perl, a properly-coded perl program is an order of magnitude easier to read (especially properly commented).
Bourne Shell (Score:5, Informative)
I know complaining about lack of options is frowned upon, but I think the bash option should be replaced with Bourne shell (sh). The Bourne shell syntax is supported by sh, ksh, and bash. Bash, on the other hand, is a "new" shell with special features not available in the other shells.
I get frustrated when kids write shell scripts that use bash-special features. There's a reason to write it in basic Bourne shell syntax.
Okay, time for everyone to get off my lawn...
Re:Bourne Shell (Score:2)
BASH is relatively new? What?
It's pretty much the defacto standard for most places and products nowadays. If you said ZSH however.....
Re:Bourne Shell (Score:4, Informative)
And it is often a bad choice to use bash in your script. Using sh gives you much more portability, you do not need to worry about which version of bash you are running on: there is only one sh. sh is installed on all unixes. And sh interpretors are faster and lighter than bash interpretors.
Why write complex scripts in bash if you can write them in sh?
To make them non-portable to non Linux systems (Score:2)
Writing bash scripts and using bash-ism's which are not part of the standards process is a great way to make sure your code only runs on bash. It's even better advocacy if you still start the scripts with /bin/sh, and the best is if you can find a bash-ism that works in bash and ends up being destructive in sh.
Of course, if you really wanted to engage in advocacy, you'd use configure, which is a great way of taking a portable code base and localizing it to a particular platform. It works great for making the code run on the one platform that the last person who made a configure.in change wanted the program to run on... and only that platform.
Re:Bourne Shell (Score:2)
Arggg... Now you made me feel old, I remember the improvements of the Unix V7 shell over Unix V6 on the PDP/11.
And BSD4.1 on Ernie Co-Vax, this can't be more the 10 years ago, I'm sure...
O crap... 30years plus... Damn you...
So I vote "scratch" to find the kid in me again !
Re:Bourne Shell (Score:2)
There's nothing wrong with writing in Bash instead of Bourne as long as your shebang line points to /bin/bash instead of /bin/sh.
Re:Bourne Shell (Score:2)
100% totally completely agree. People, most importantly distro engineers, need to remember that bash != ash != dash != ksh != sh.
My most recent frustration with this situation was with dash, which has become Ubuntu's default /bin/sh. I was working on getting an in-house SCM tool operating with Ubuntu, and found that there was a non-POSIX sh/ksh/bash-ism in it, the "-p" switch, which dash definitely didn't support. Upon investigation I realized that while it was a good thing to have in the script in question if available, it wasn't strictly necessary.
I thought I'd perform a run time check to determine which shell was in use, and pass the "-p" switch except when running dash. However there was one huge problem -- dash provides *NO* reliable way whatsoever to identify itself. There's no "-v" or "--version", no pre-set environment variable, not even anything useful in running strings(1) against the binary. All you can do is poke at some end-case behaviors to try to differentiate it from other sh variants, and unfortunately I cannot trust those end-case behaviors will be consistent between versions.
I solved the problem by requiring bash as a prereq in the .deb and .rpm, then depending which operating system (not distro, but OS) is detected at runtime, trying hard to find any shell that supports "-p" before falling back to /bin/sh and hoping for the best. Frustrating.
Re:Bourne Shell (Score:2)
I replaced my Bourne Shell with the Cross shell and my scripting is even more intense!
Re:Bourne Shell (Score:2)
AMEN.
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".
Re:All of them (Score:2, Troll)
IMO, It's kinda stupid to put Bash and Python on the same line. They are completely different and designed for completely different purposes.
Also "scripting" language is pretty stupid concept by the way. There is absolutely no reason why Java (or *any* other language) can't be on this list.
Re:All of them (Score:4, Informative)
Also "scripting" language is pretty stupid concept by the way. There is absolutely no reason why Java (or *any* other language) can't be on this list.
Yes, there is. Scripting languages replace what an operator can execute as a series of commands. Java doesn't do that - it has no provisions for it.
bash and perl are scripting languages. python? Hardly.
Come back with your java once you can do something like
/etc/passwd" | awk -F: '{print $5}' | sort -u
perl -pi.bak -e 's/#include "stdio.h"/#include <stdio.h>/' *.c
or
ssh othermachine "grep 'sh$'
or
vmrun list | grep '^/' | sed 's/^/vmrun suspend "/;s/$/"/' | sh
Scripting languages exist because they're useful - you can do things very quickly.
Re:All of them (Score:2)
Now do the same with Ruby or Python. Or Lua. Or JavaScript.
My point is that there is absolutely no reason why Python and JavaScript did make this list and Java didn't.
Scripting vs non-scripting is certainly an understood concept. We might debate over the specifics, but I'm not aware of any useful definition that puts Java into the scripting category.
Generally speaking, scripting languages tend to have the code interpreted at run-time rather than be compiled. They also tend fairly strongly towards dynamic and/or duck typing. Java does none of these things.
Re:All of them (Score:2)
Generally speaking, scripting languages tend to have the code interpreted at run-time rather than be compiled.
With the exception of Bash (and possibly Lua - dunno), none of the listed languages (or rather "runtimes") "interpret" the code, they all compile it into some internal byte code first. The most recent implementations of JavaScript and Python runtimes even use just-in-time compilation, just like Java.
This is however all done behind the scenes from the author. You write code, you run the interpreter directly against your code, and it executes. A language IMHO doesn't hop the barrier because the interpreter maintainers found a more efficient way to get the job done. And there's always eval.
They also tend fairly strongly towards dynamic and/or duck typing. Java does none of these things.
Those languages are called Dynamic languages, not "scripting".
I've always thought of Dynamic languages as a subset of scripting languages.
And where does your definition put the likes of Common Lisp, which use dynamic typing, but compile into native code?
I lack enough familiarity with Lisp to give you a meaningful answer there.
QBasic (Score:3)
Re:QBasic (Score:3)
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:As always... (Score:3)
No, they have PHP in there.
(a scripting language, really?)
Re:As always... (Score:3)
Wait, why isn't php a scripting language? I write scripts in it, especially when I need to pull information from the mysql database.
[John]
Most useful (Score:2)
The one that had the greatest effect on my productivity is TinTin [wikipedia.org]
Perl (Score:4, Informative)
Re:Perl (Score:2)
Why that "negatively" about the way it inspired Python?
I don't have much experience of Python (I hate the semantic spaces) but I've got plenty of Perl (mostly in the pre OO days) and of Ruby (last 7 years). Apparently Ruby got from Perl a short hand syntax for regular expression, the possibility to place an if/unless at end of line and nothing else. From your comment I think I missed some fundamental common trait, which one?
Re:Perl (Score:3)
Because so many Perl writers can't be bothered to use strict or -w, or want to be clever instead of writing clearly.
Re:Perl (Score:3)
OK then, it's also because Perl makes it so easy to write executable line noise, and some of its partisans think it's a good idea.
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:Perl (Score:2)
that's because you only started using Perl a few months ago...
"Perl would be Voodoo – An incomprehensible series of arcane incantations that involve the blood of goats and permanently corrupt your soul. Often used when your boss requires you to do an urgent task at 21:00 on friday night."
My soul is hopelessly corrupt, but it doesn't mean I like it anymore...
UNIX Korn Shell (Score:2)
First I learned the C Shell because the customer for the project (US Air Force) wanted it. About two months after I joined the project, the customer changed its mind and wanted Korn Shell. (All this was before I ever saw a PC or used Windows.) Having experienced both, I much prefer Korn.
I arranged with my Web host that my space on its Web server uses Korn. From my PC, I can enter a secure shell on the server to test my scripts. To a large extent, I can generate scripts in Korn without referring to any documentation.
English (Score:5, Funny)
Re:English (Score:3)
When I write my scripts in English, I find that the bulk of my audience can read them better.
What have you COBOL programmers been doing since that whole Y2K thing?
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, to win a woman's heart! (Score:2, Funny)
Love is wonderful. Marriage is grand. Divorce is twenty grand, but worth it. Support payments are ongoing....
Re:Perl, to win a woman's heart! (Score:5, Funny)
Sounds like she just exchanged one nesting error for another.
Re:Perl, to win a woman's heart! (Score:4)
Ignore the anon cowards who try to get modded funny, it's beautiful story and I'm glad you shared it with us all.
Re:Perl, to win a woman's heart! (Score:3)
Kudos Sir!
Re:Perl, to win a woman's heart! (Score:2)
Nice, but most people are better of using Pearls for that purpose, rather then Perl....
On the other hand, if there was a CPAN module ladies::in::distress, I think that would help a lot of Slashdotters!
Re:Perl, to win a woman's heart! (Score:3)
Roses are red
Apples are not blue
That's all the clue
I'm giving to you.
Depends on OS and task (Score:2)
For Windows, I use Powershell and VBScript. Powershell does more, but has a syntax designed by math morons with no human factors knowledge at all. VBscript is designed to be understood by humans with little effort - a no no at Microsoft, but has been crippled (It now crashes early and often) and ignored.
On Linux, I think TCL is your best bet. While its syntax is as awful as Powershell, which it resembles somewhat, it really does work pretty well.
Re:Depends on OS and task (Score:2)
Powershell does have some useful tricks for parsing data into Active Directory and Exchange servers that are hard to match with mere batch files.
Most useful to LEARN (Score:2)
It's "Lua" not "LUA" (Score:5, Informative)
Lua is not an acronym. From the Lua web page:
"Lua" (pronounced LOO-ah) means "Moon" in Portuguese. As such, it is neither an acronym nor an abbreviation, but a noun.
LuaJIT [luajit.org] is probably the fastest scripting language in existence. I have found for math-heavy algorithms it's as fast as optimized compiled C code. Plus it's FFI interface is stunningly fast, allowing easy fast access to native libraries.
LOGO (Score:2)
TURTLE!
Nuff Said!
Example of each? (Score:5, Funny)
Javascript:
Lua:
Perl:
PHP:
Python:
Ruby:
C++
Why doesn't slashdot have a /code function? Replaced most Open,close tags with [ or ].
Oh geez, now my comment has too few characters per line. Here we are on a "Geeky" site and can't type out any code. Is Code now illeagal? Will the NSA,CIA, Google come after me now because I don;t have facebook and want to type code into slashdot. Grrr. So I guess that I will now type more meaningless stuff (looking...17.4 words average.) and I guess I will find out what the magic number is soon. Maybe it is 20. I know that spaces in the C++ code is very meaningful, not meaningless as slashcode seems to think. :( (Checking---20.7.. So 20 is not the magic number.) What will I need? Oh well, Will I need an average of 140 characters per line so I will be mini tweeting? Maybe I should go to the petition Government site and pressure sites like slashdot to not be so damn prohibitive. the only HTML code allowed here is [b], [i], [p], [br], [a], [ol], [ul] (Oh yeah, I can make an ordered or unordered list), [li], [dl], [dt], [dd], [em], [strong], [tt], [blockquote], [ecode], and [quote] Geez... Wait, what is ecode? Hmm... Will look into that. (Well, Now I can;t see what ecode looks like because I still can't get a preview. although I am up to 29.7 words per line average.
You know, my dreams of getting a +5 informative comment is gone. This is gonna be modded as irrelevant, useless, and stupid. All I wanted to do was put out a few examples of 'Hello world' for the three clueless people on this site, and now I seem to have become the fourth clueless person. So I just went to Google to see if I could find how many characters per line I needed to make the stupid post. (I will make it - I am determined now. ) Oh look, there is a post with only 12 characters in the whole freaking post and what do I have? As of that question mark, I have an 37.6 and it isn;t good enough. Damn, slashdot, throw us people a bone and let us make meaningful posts. I was going to type, "Why can;t we type using code? Why can't I use more HTML? Why can't I...? But I know that there are a few trolls out there that would try to find malicious code, use [blink] tags (Wouldn;t that be fun - Welcome to Internet circa 1991,) or just do stupid stuff...(Checking my current characters...38.7 Geez. Maybe I need 40.
Well damn, I ain;t stupid.OK maybe I am, but damn this is almost enough to make me mad. Almost. I still plan on doing what I was going to do today. It's my daughter's 18th and I wrote a small website commemorating it and announcing various gifts, added in a bunch of "dad" humor, threw in a few meme and pop culture references, etc. We are going to go car shopping afterward. But if I was really mad, I'd stay here until I got this post, I am not mad so I am going to continue doing today's planned activities. So I think I have made the point that I ain't mad, but I am frustrated. I don
Groovy (Score:2)
println 'Hello, world'
Re:Example of each? (Score:3)
And I don't know why we can't use BB tags or Textile [redcloth.org] to write comments. To write Html is such a pain. Or ask yourself, what is easier to write:
[a href="somewebsite/foo.html"]Foo[/a] or "Foo":somewebsite/foo.html,
[code]some code[/code] or @some code@
[ul][li]My Item[/li][li]More Item[/li][/ul] or * My Item * More Item
Re:Example of each? (Score:3)
I use Mosaic 0.99 and other old browsers at times. No, really.
Mostly to see how pages degrade. There are people out there who browse from old mobile phones or TV sets, and even if you don't want to support them, you at least can make the pages degrade gracefully.
I also use other browsers without javascript support, like lynx, in a version as new as the latest Chrome. Because I don't always have a usable GUI. If I'm logged in through ssh to a server on the other side of the world, using Firefox or Chrome tunneled through TCP/IP isn't an option.
And, finally, I often turn javascript OFF, and only enable it on sites where I have to, and which I can't avoid.
Enough people do the same that NoScript and similar are some of the most popular extensions for modern browsers.
So yes, comments around the script portions and an additional noscript tag are useful, and not using them tells more about the web designer than the visitor.
Re:Mosaic (Score:3)
How did you manage to do this? I while ago I tried to compile Mosaic, for nostalgia's sake, but it won't compile under with a modern libc/gcc.
Mosaic is available from rpmfusion, at least:
Mosaic.x86_64 2.7-0.3.b5.fc11 rpmfusion-nonfree
Mosaic.x86_64 : Web Browser
Very useful to ensure that tables and javascript degrades gracefully, among other things.
On Windows (Score:2)
JavaScript (Score:2)
Is there another one of these scripting languages than can run on a locked iPhone or iPad? I don't think so.
What for? (Score:2)
Depends on what you are doing.
Unix admin? *sh and Perl fight it out, but really anyone that know Perl for that use likely learned sh first. Python also works well, but you still see a lot more sh and perl.
Game dev or mods? Probably Lua. Lua is really great to embed in any application as an extension language due to its design and small size. And it is ridiculously fast (LuaJIT)
Web dev? PHP, Python or Ruby. Which is most useful depends on what you mean by useful. There is still more PHP out there than the other AFAIK. JS fits here too, for frontend, and somewhat for backend with things like node.js. JS seems to be on the rise in many areas...
There is even a lot to be said for VBA. Ubiquitous in Office and everywhere in Windows admin that hasn't moved to Powershell
Korn Shell (Score:2)
If you're shell programming, Korn shell is better than bash (although bash generally has better interactive features).
CowboynealScript (Score:2)
If you can't do it in brainfuck [muppetlabs.com], is it worth doing?
...laura
DNA (Score:4, Funny)
Re:DNA (Score:3)
Of course, "Hello World!" takes about 9 months to run, and there are legal and ethical issues with debugging a program, but I think the results speak for themselves.
It's going to take another 9 to 12 months before the results speak for themselves, and even then it's only a few simple words. I don't think either of my kids said anything REALLY intelligent until kindergarten age.
PowerShell? (Score:2)
What about PowerShell? Or are we only dealing with Linux scripting languages (cue jokes here).
Re:PowerShell? (Score:5, Insightful)
No jokes. The others are all multi-platform - Windows, OSX, linux, BSD ...
PowerShell not so much.
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.
LUA (Score:3)
its lua fucktards, on the website its never all caps and everyone points this out for a reason, but here its LUA!!!! OMFGRARWAR
anyway I voted lua, by itself its a very basic language, but its real reason is not to be its own language, its so dead simple to bind to C (whatever) and once you start doing that, you have a very easy and fast language to write in with whatever power you want exposed in a simple manner.
"its pseudocode that works"
and has its advantages
Re:What?!? No C, yet?!?! (Score:3)
Well, except that C isn't a scripting language.
Re:What?!? No C, yet?!?! (Score:2)
Well, except that C isn't a scripting language.
Sure it is! Any language that allows one to launch commands in the shell can be used as a scripting language. With C, that function is "system"
NAME
system - issue a shell command
SYNOPSIS
#include
int system(const char *string);
DESCRIPTION
The system() function causes string to be given to the shell
Of course, actually writing scripts in C is an abomination but it is an abomination that occasionally shows up in the real world
Re:What?!? No C, yet?!?! (Score:2)
Having to take the extra step to compile and link your code takes it out of the realm of what I would call scripting. I've always thought of a scripting language as something that can be used with no extra steps between writing and running, not necessarily having to do with calling system functions (except inasmuch as every program needs some degree of I/O).
Re:horses for courses (Score:2)
Perl is close enough while still being portable to non-Unixen.
Re:If you have a job or want one (Score:2)
> PowerShell
The problem with that is your answer will change in 5 or 10 years time.
Re:REXX... (Score:2)
Sigh. I only have OLIE for 3270 and it SUX!!!!
Re:REXX... (Score:2)
There is support for Rexx [rexxinfo.org] on all platforms, including Android and iOS.
Re:LAMP or maybe Ksh/PHP/MySQL/Perl (Score:2)
It doesn't make any sense to know just one of these. Even after about 15 years, I'm still pretty happy with Perl though, idiosyncratic though it certainly is.
Re:Powershell? (Score:2)
Compared to the alternatives on Windows, Powershell is extremely powerful, but it does have a pretty steep learning curve. There are a lot of niceties that make me never want to go back to bash or batch (shudder)- killer auto-completion on args (even extends to argument names and values if the right metadata is provided by the cmdlet), verbose and useful error messaging on many things, easy consumption of arbitrary .NET objects from script (resulting in a *huge* 3rd party ecosystem out of the box), etc.
The interesting part is that a lot of the internal admin tools on newer versions of Windows (and associated server apps like Exchange) are built on top of Powershell, so you can use the UI for basic stuff, then hit the "show me the script" button to get a Powershell script as a starting point for automating something. Similar to the workflow many people used for learning Office scripting ("record macro").
While I've not seen a major penetration of command-line-only scripting for Windows, having *everything* scriptable in a reasonable fashion (and enforcing that by building the UI tools on top of the script engine) is a great way to drive that penetration.
Comment removed (Score:3)