• some guy (unregistered)

    If you have a python, everything looks like a mouse at frist.

  • ichbinkeinroboter (unregistered)

    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.

  • (nodebb)

    "Yeah, but I always forget to."

    I'm going to rule out "one of the best", just from that sentence alone.

  • (nodebb)

    "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.

  • (nodebb)

    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.

    • Calling "docker-stop" is better than having to write out the commands, it's much easier to remember, and it's less likely to fail because you got a command wrong.
    • They don't use bash directly because they're not familiar with it and if they took the commands they wrote and ran them directly it wouldn't necessarily work as pointed out in the next point.
    • When he said it handled errors I don't think he meant in the programming sense of the word. He just meant it still works even if there's errors. Why should he care if there are no containers to kill? He just wants to be in State A. He doesn't care about how he gets there.
    • If they're a Python dev that works in Python all day he could use the Docker library but in that case you have to learn something new. It's not free to learn library after library especially when it's just something for personal use. Maybe it's just me but I feel like I have to learn a new library constantly with my non-personal projects.

    Of course, all of this goes out the window if other devs have to use these scripts.

  • noOne (unregistered)

    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.

  • (nodebb) in reply to miniragnarok

    I totally agree.

    For personal dev scripts, there is only one rule: If it works, then it works.

  • (nodebb) in reply to noOne

    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".

  • Officer Johnny Holzkopf (unregistered) in reply to Baflingo

    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.

  • Jonathan (unregistered)

    I once inherited a C program that did stuff like

    char cmd[256];
    strcat( cmd, "mv ");
    strcat(cmd, src);
    strcat(cmd, " ");
    strcat(cmd, dest);
    exec( cmd);
    

    Somehow it just felt worse seeing it in C than in Python.

Leave a comment on “All Docked Up”

Log In or post as a guest

Replying to comment #692955:

« Return to Article