Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Kimmax111066yNo seriously - it depends, as always, on what you want to do. A simple bash or sh script might do, maybe python or perl for more complexity or unleash the beast and do it in c++ or similar if it seems reasonably fit. But somewhere along the lines 'quickly' segfaults and your 10min project turns into a 6 hour regex interpreter
-
bahua129056yPerl, python, and ruby were pretty much designed exactly for this purpose. Python is easy to learn, but slower and more expensive. Perl is only slightly harder to learn, the code is more verbose, but only compiled code can parse and handle text faster and more efficiently. I can't really speak to ruby.
-
as the others said, it depends. But my order is bash, go, python, nodejs
Bash for simple things
Golang for portability (I use that heavily for CI stuff)
Python for converters
Nodejs for "Just work God damnit" -
VaderNT16346yI agree with the Python suggestions, also I'd add the libraries "argh" for argument parsing and "tqdm" for progress bars. You'll have readable code that does the right thing in no time.
-
musician9426y@FrodoSwaggins
Last time I checked html wasnt a programming language 🤔
In general I find it hilarious how emotional some people get in this thread over something like the language used to write a cli tool. The world doesnt stop turning if I write a little cli util in node or python. Its fast enouh and doesnt consume gigabytes of ram ;) -
@irene npx comes with most dependencies you want for that. Install library xy that does most of the work and glue it somehow (preferably async) together.
If a project depends on this script, just mention it's requirements as optional, who cares where the script is. Just shebang the shit out of it.
Try it, my reaction was "pretty fast for shitty pastings", 7/10 would do again
Or trust my coworker "The QuickFix. (forever)"
@Kimmax Sorry, I know I'm addicted, but it just feels right, I can't get off from it. We have shitty error messages, so now every exception throws a second exception with the message "Nope, sorry!". At least they get logged. -
Python. It's an opinion that this thread is fighting over apparently. It won't run quickly, it will use more memory than nessesary, it will have multiple imports and dependencies, but it will develop quickly!
Write it in python. With argparse, you'll be done in 10 minutes. Run it, be happy. Then realize you're bored, it's slow, and could be better. Then write it in perl or C or golang or etc.
But python is a great "I don't have time for this. I want it done now. Not perfect, just now" language.
Related Rants
What language would you recommend for writing CLI tools quickly?
question
cli