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 1 year 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 1 year ago
Obligatory relevant xkcd xkcd.com/1205/
kogasa@programming.dev 1 year 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 1 year 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 1 year 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 1 year ago
i would not run a python script with root.
ultimitchow@sh.itjust.works 1 year ago
i run my daily NAS backup python script with root.
alexcoder04@programming.dev 1 year ago
Bash is much better for doing file operations and piping the output across multiple commands
bort@lemmy.sdf.org 1 year 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 1 year ago
Why is always about bash? POSIX shell scripts run everywhere.
Haus@kbin.social 1 year ago
sanosuke001@lemmynsfw.com 1 year ago
Python is never the right answer!
darcy@sh.itjust.works 1 year ago
what is a well-known genus of non-venomous snake ?
Chunk@lemmy.world 1 year ago
Anaconda!
Wait…
Reptorian@programming.dev 1 year 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 1 year 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 1 year ago
itadakimasu@lemmy.world 1 year ago
How to meet ladies?
TheBananaKing@lemmy.world 1 year ago
Friends don’t let friends do string manipulation in bash.
eochaid@lemmy.world 1 year 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 1 year 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 1 year ago
thoughts on lua ?
alexcoder04@programming.dev 1 year ago
Lua is weird, but I would rank it same as Python
SingularEye@lemmy.blahaj.zone 1 year ago
lua is hot and sexy
Chunk@lemmy.world 1 year 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 1 year 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 1 year ago
They may not know but they will when I explain kekeke
Diplomjodler@feddit.de 1 year 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 1 year 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 1 year 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 1 year 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 1 year ago
Nkt since 3.11, python is now one of the fastest languages
Chunk@lemmy.world 1 year 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 1 year ago
Careful, that attitude is how we ended up with this infestation of JavaScript!
entropicdrift@lemmy.sdf.org 1 year 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 1 year ago
As long as you do all your lookups with dicts or sets performance is pretty decent for smaller workloads.
nixfreak@sopuli.xyz 1 year ago
Even worse when you look at a class that’s over 1k long.
sigh@lemmy.world 1 year ago
holy shit you’re right