Boy oh boy, you gonna hate like a sith if you find out how sh*tty python is.

Or bash.

So incredibly annoying too read.

I know that there are use cases for [ ] over [[ ]]. There have to be. Why in god’s name would [ ] exist if there wasn’t a reason to use it over [[ ]]? I’m obviously the one in the wrong by only ever using [[ ]], because [ ] would definitely be better in some type of situations that I’m just not seeing clearly. Right???

I believe the reason is that bash is backwards compatible with sh and sh only has [ ], not [[ ]]

[ is a binary (sometimes a symlink) in /usr/bin. It’s /usr/bin/[ 🤓

Solution: fuck backwards compatibility and use fish

Fish might be good for interactivity, but in terms of scripting, just go straight to python. It’s not worth it.

Fish is starting to get more POSIX compliant as of late, the error redirect is no longer ^ /dev/null but 2>/dev/null

Affine Connection
link
fedilink
English
21Y

[[ is not a POSIX shell feature.

palordrolap
link
fedilink
31Y

Perl calls to you. Admire its beauty.

@seth@lemmy.world
link
fedilink
1
edit-2
1Y

deleted by creator

palordrolap
link
fedilink
11Y

Perl’s unreasonable effectiveness for creating write-only code was part of the joke.

@CoderKat@lemm.ee
link
fedilink
English
11Y

Bash is so bad. I literally use it every day and have written many Bash scripts, yet I’m constantly having to search for how to do things in it because syntax is so bizarre and difficult to remember. Need to do a for loop over lines in a file? You can bet I’m googling the syntax for it. I have a general idea for what it looks like and know what to search for, but no way in hell can I write it correctly in the first few tries.

String manipulation is the absolute worst. Have fun getting to learn the unreadable syntax of most sed and awk programs (the only thing most people have memorized is find and replace). Stuff like “split a string of comma separated ints and add them up” are way harder in Bash than in Python, despite the fact I often need to do stuff like that in Bash. Well, in the terminal anyway. Sometimes I’ll just use Python, but Python’s weakness is executing programs and getting their output, which is nowhere near as convenient as it is in Bash.

Side note, isn’t it weird that for a language where flags like --foo bar are so commonly used, there’s no built in or standard tools for accessing flags?

Skull giver
link
fedilink
161Y

deleted by creator

So many footguns. Use python in place of bash.

tbh i would rather use assembly than python.

@lud@lemm.ee
link
fedilink
11Y

Wouldn’t it make more sense to code in c++ or something and compile to assembly?

How much more efficient than a compiler are one really?

@herr@lemmy.world
link
fedilink
10
edit-2
1Y

Absolutely wild take, the two are used in completely different contexts

Python has its flaws for sure (I’m getting pretty fed up with the lack of required type notation, myself), but my point here is that bash is even worse:

Assembly is torture because it has too much math in it

???

You forgot your indentation and a third party docs is outdated. Now try and debug it with this error message:

Not enough value to unpack (expected 2, got 1) (not any stack trace btw) documentation was terrible. :D

@herr@lemmy.world
link
fedilink
8
edit-2
1Y

Huh? The Python Stacktrace is great. What kinda fucked up library were you using that it prints the error code instead of raising an exception?!

Also don’t think outdated library docs are a fault of Python 😅 In much the opposite way, I’ve found Python’s standard library to be really great, reducing the number of random third party libraries needed. (Looking at you, JavaScript)

@Mikurei@lemmy.ml
link
fedilink
2
edit-2
1Y

You forgot your indentation

Sounds like a problem for someone who is writing the code on a toilet paper or whiteboard. Most people have some sort of hackable editor/IDE that handles the indentation and code blocks.

obfuscated error messages

Just don’t use libraries which print or log exceptions without raising it :)

Fonzie!
link
fedilink
101Y

What don’t you like about Python?

I’ll throw a real petty one out there… indentation.

The syntax, the syntax-highlighting, venv creation and usage, having to import everything even inbuild types, have fun checking what a third party library has for functions and what they need :D Async is a hecking mess, documentation is another (bad) story.

I’m sure the syntax highlighting is entirely dependent on what editor you use, and is not a property of the language itself.

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 61 users / day
  • 247 users / week
  • 417 users / month
  • 2.88K users / 6 months
  • 1 subscriber
  • 1.53K Posts
  • 33.9K Comments
  • Modlog