- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
If you have a python, everything looks like a mouse at frist.
Admin
I did the Windows and cmd script equivalent to this sort of thing quite a lot back in day (25-30 years ago). I can't rememeber if it was genius or madness (or just neccesity). I would have to send the robot to fetch and load that backup tape into my memory ... and I don't know if its been kept in nice enough conditions to survive :-). Plus the robit has a tendency to just slam the tape not QUITE in the slot... LOL.
Edit Admin
I'm going to rule out "one of the best", just from that sentence alone.
Edit Admin
"If I just do it in bash, if the first command fails, the second command doesn't run."
You have to use the -e option with bash for this behavior. The default is for bash to continue.
As far as the best or the worst programmer... He wrote code that does what he wants it to do. That makes him a good coder.
Edit Admin
Maybe I'm misunderstanding something but this doesn't seem like a WTF. The way it reads it sounds like these are personal scripts for the dev and not something the dev writes for others to use. The dev is correct about a lot of the points.
Of course, all of this goes out the window if other devs have to use these scripts.
Admin
but since shell=True is set on run(), these are more or less shell/bash scripts, he even uses shell features ($()).
So, don't tell him, but he knows and uses shell/bash.
Edit Admin
I totally agree.
For personal dev scripts, there is only one rule: If it works, then it works.
Edit Admin
The way I read it, that's kind of the point. It's a bash script running from Python, but he "doesn't know bash".
Admin
I don't see any bashisms so far, so it's just sh (if $SHELL is not really bash, but ye olde paine sh, or maybe dash, or something else sh-like), making the thing more portable if needed - in his case, just python is a dependency on the target system. So "Ernest was either the worst developer he was working with, or one of the best." maybe can be answered with YES.
Admin
I once inherited a C program that did stuff like
Somehow it just felt worse seeing it in C than in Python.