Anything I can do in Shell I will do in Shell and yes I am a devops engineer thank for asking.
python < shell (for scripts)
Submitted 10 months ago by alexcoder04@programming.dev to programmer_humor@programming.dev
https://programming.dev/pictrs/image/3e919ec7-ac6c-414a-a158-ec317f7f4dee.png
Comments
Overtheveloper@lemmy.world 10 months ago
Obligatory relevant xkcd xkcd.com/1205/
kogasa@programming.dev 10 months ago
I can’t think of a single reason to use bash over Python. Anything you can do in bash can be done in pure Python. Unless you’re working in some embedded environment it’s a non-issue to install a Python interpreter (you certainly already have one).
CoderKat@lemm.ee 10 months ago
Python is superior for string anything (parsing, searching, manipulating). But Bash is much simpler for running existing CLI tools. Plus you should already be using Bash as a simple terminal language already, so wrapping what you’re used to into a simple script flows naturally.
Eg, if I have some admin tool for updating a user thingamajig, a common scripting need is just running that tool for every user in a file (or the output of another command). The string manipulation that often requires is annoying in bash, but running the commands is easier than Python.
kogasa@programming.dev 10 months ago
If what you’re doing is essentially a few shell commands, then you may as well put it into a script. If you’re talking about how “elegant” your shell scripts are and comparing them to Python, you’re probably wrong and should be using Python.
Reborn2966@feddit.it 10 months ago
i would not run a python script with root.
ultimitchow@sh.itjust.works 10 months ago
i run my daily NAS backup python script with root.
alexcoder04@programming.dev 10 months ago
Bash is much better for doing file operations and piping the output across multiple commands
bort@lemmy.sdf.org 10 months ago
I know whatever environment I run my shell script in has
sh
, I can’t rely on (the right version of) python being there.MonkderZweite@feddit.ch 10 months ago
Why is always about bash? POSIX shell scripts run everywhere.
Haus@kbin.social 10 months ago
sanosuke001@lemmynsfw.com 10 months ago
Python is never the right answer!
darcy@sh.itjust.works 10 months ago
what is a well-known genus of non-venomous snake ?
Chunk@lemmy.world 10 months ago
Anaconda!
Wait…
Reptorian@programming.dev 10 months ago
I know there’s a lot of downvotes because there are people reading this as hate toward Python. On one hand, one can make the case that it is overused and this doesn’t bold well for those that simply can never like it’s syntax. On the other hand, Python is perfect for small scripts that isn’t tailored for a Domain or just quick codes.
sanosuke001@lemmynsfw.com 10 months ago
Honestly, I’m not really a fan of the formatting and syntax of Python but I agree, it is a fine choice for scripting things quickly if you don’t mind the language itself.
The biggest issue I have with it are all the incompatible versions, juggling modules, having some other random thing with a ridiculous configuration, where a bash script would be infinitely easier. Anything more complicated and Python is just too much of a headache.
outdated_belated@lemmy.sdf.org 10 months ago
itadakimasu@lemmy.world 10 months ago
How to meet ladies?
TheBananaKing@lemmy.world 10 months ago
Friends don’t let friends do string manipulation in bash.
eochaid@lemmy.world 10 months ago
The only validation you should expect and need is self-validation.
Your work is absolutely valid and important. Your efforts are absolutely appreciated and worthwhile. But people are stuck in their own heads and work and stress and concerns and desires and validation loops and it takes actual work to break out of that to not only offer appreciation but to even realize that they need to offer it.
And for that reason, you should also really appreciate anyone that validates you.
Legendsofanus@lemmy.world 10 months ago
I know a bit of HTML so I just started learning Python. It’s fairly easy and fun, haven’t made anything real yet tho
darcy@sh.itjust.works 10 months ago
thoughts on lua ?
alexcoder04@programming.dev 10 months ago
Lua is weird, but I would rank it same as Python
SingularEye@lemmy.blahaj.zone 10 months ago
lua is hot and sexy
Chunk@lemmy.world 10 months ago
Lua is not as common as python. Every team I’ve worked on knew X and python. C++, Java, JS, or node, and then also python.
Reptorian@programming.dev 10 months ago
I’m using G’MIC for raster-graphic image-processing, but I can do other things in it too with ease. I feel this post so much.
shiveyarbles@beehaw.org 10 months ago
They may not know but they will when I explain kekeke
Diplomjodler@feddit.de 10 months ago
Python is the second best language for everything. Having one language that does it all is better than learning several that might do it a little bit better.
dukk@programming.dev 10 months ago
Speed is a serious problem in Python though. Python has its use cases, and so do other languages. Things would not end well if we started using Python for everything.
noli@programming.dev 10 months ago
This might be an unpopular opinion but python’s speed wouldn’t even be an issue if it was 5x slower than it is now.
Python is a language designed for write-time performance, not runtime performance.
Diplomjodler@feddit.de 10 months ago
If I wanted to write a 3D game engine, I wouldn’t use Python either. But there’s zero chance of me ever doing that. Die 90% of Things 90% of people do, Python works just fine. And the performance thing is actively being worked on and getting better all the time.
Vulwsztyn@lemmy.world 10 months ago
Nkt since 3.11, python is now one of the fastest languages
Chunk@lemmy.world 10 months ago
I have worked on a lot of real time simulation with python glue. It is… not fun. I’m a better programmer for it though.
bort@lemmy.sdf.org 10 months ago
Careful, that attitude is how we ended up with this infestation of JavaScript!
entropicdrift@lemmy.sdf.org 10 months ago
Python is the best “glue” language I’ve ever used. When you want to chain together your program’s high-level logic and all of the loops happen inside other languages like Rust, Go, Zig, D or C, Python’s performance is perfectly adequate and it’s so clear and concise it reads like pseudocode.
Diplomjodler@feddit.de 10 months ago
As long as you do all your lookups with dicts or sets performance is pretty decent for smaller workloads.
nixfreak@sopuli.xyz 10 months ago
Even worse when you look at a class that’s over 1k long.
sigh@lemmy.world 10 months ago
holy shit you’re right