I’m not UlrikHD
- 0 Posts
- 54 Comments
UndercoverUlrikHD@programming.devto
Programmer Humor@programming.dev•I wonder if this was made by AI or a shit programmer
4·8 months agoWhat big advantages does pathlib provide? os.path works just fine
That’s for images though, not text content.
UndercoverUlrikHD@programming.devto
Python@programming.dev•Python Performance: Why 'if not list' is 2x Faster Than Using len()
5·11 months agoWhile I agree to some extent,
if not varis more than clear enough for anyone that knows python. If that pattern confuses someone, they probably aren’t at level where they should be dealing with python at a professional level. The same way you would expect people to understand pointers and references before delving into C code.This sort of stuff is something I taught first year engineering student in their programming introductory course, it’s just how python is written.
For what it’s worth, it’s sort of similar in Erlang/Elixir. If you want to check if a list is empty, checking the length of the list is discouraged. Instead you would use Enum.empty?().
UndercoverUlrikHD@programming.devto
Python@programming.dev•Python Performance: Why 'if not list' is 2x Faster Than Using len()
18·11 months agoI’d argue that if it’s strict explicitness you want, python is the wrong language.
if not varis a standard pattern in python. You would be making your code slower for no good reason.
I think it’s a thing mainly for hobby programmers and young students that don’t have a solid foundation/grasp of programming yet, which also likely makes up a big portion of programming meme communities.
Functional programming would have quite the problem if it wasn’t a thing.
It would be nice to have way for admins and mods to make notes on people. E.g. If you are giving someone a warning, you currently need to use an external tool to log the warning.
UndercoverUlrikHD@programming.devto
Programmer Humor@programming.dev•Like programming in bash
1·1 year agoI’m not anti bash or fish, I’ve written in both just this week, but if we’re talking about readability/syntax as this post is about, and you want an alternative to bash, I’d say python is a more natural alternative. Fish syntax is still fairly ugly compared to most programming languages in my opinion.
Different strokes for different folks I suppose.
UndercoverUlrikHD@programming.devto
Programmer Humor@programming.dev•Like programming in bash
4·1 year agoFor example, how could it know whether
cat $fooshould becat "$foo", or whether the script actually relies on word splitting? It’s possible that$foointentionally contains multiple paths.Last time I used ShellCheck (yesterday funnily enough) I had written
ports+=($(get_elixir_ports))to split the input sinceget_elixir_portsreturns a string of space separated ports. It worked exactly as intended, but ShellCheck still recommended to make the splitting explicit rather than implicit.The ShellCheck docs recommended
IFS=" " read -r -a elixir_ports <<< "(get_elixir_ports)" ports+=("${elixir_ports[@]}")
UndercoverUlrikHD@programming.devto
Python@programming.dev•Why is learning Python a mistake for beginners? https://chat-to.dev/post?id=QWV6WTNiZ2hoZlp5S3lFcklZRWcwdz09&redirect=/profile?u=amargo85 #python #programming #code #developers #softwaredevelopment
31·1 year agoAs someone who worked as a TA at uni for the introductory course to programming for engineers, which used python, that never once a problem lol.
Mac users were recommended to install anaconda rather than python directly, and that was just about it.
UndercoverUlrikHD@programming.devto
Programmer Humor@programming.dev•Like programming in bash
10·1 year agoIf you’re going to write scripts that requires installing software, might as well use something like python though? Most Linux distros ship also ship with python installed
Writing Lua code that also interacts with C code that uses 0 indexing is an awful experience. Annoys me to this day even though haven’t used it for 2 years
UndercoverUlrikHD@programming.devto
Programmer Humor@programming.dev•You can lead a P to M but you can’t make ’em F’ing R
8·1 year agoHow about 8 hours troubleshooting while trying to find the right documentation.
UndercoverUlrikHD@programming.devto
Programmer Humor@programming.dev•We Are Against Animal Testing
4·1 year agoPlenty of projects have exe files available on the release page though, it’s just hard to find unless you’re familiar with github.
UndercoverUlrikHD@programming.devto
Programmer Humor@programming.dev•In case you've ever wondered why the Windows control panel was so awful...
8·1 year agoWindows/Microsoft’s biggest selling point is the backwards compatibility though. It has been the corner stone of their software development.
UndercoverUlrikHD@programming.devto
Programmer Humor@programming.dev•Yup...i can confirm that
451·1 year agoThe sea should be marked as C considering that’s what you’ll discover when you get deep into it.
UndercoverUlrikHD@programming.devto
Programmer Humor@programming.dev•average day in NPM land
65·2 years ago3, about two lines per contributor

I got a bot on lemmy that scrapes espn for sports/football updates using regex to retrieve the JSON that is embedded in the html file, it works perfectly so far 🤷♂️