• Nagesh (unregistered) in reply to Matt Westwood
    Matt Westwood:
    Nagesh:
    tharpa:
    Javelin:
    Zylon:
    TRWTF is "E for effort".

    E???

    Could be referring to the "E/G/S/N/U" grade scale (standing for "Excellent"/"Good"/"Satisfactory"/"Needs-improvement"/"Unsatisfactory") used in place of "A/B/C/D/F" by some elementary schools.

    Alternatively, it's a grade between "D" and "F".

    In some universities, "E" is "Conditional Failure", meaning that the student can meet with the professor who will set conditions for upgrading to a "D".

    You can meet with professor only if your sex is opposite to that sex of the professor.

    Not that I am doing any such things here.

    Yes of course. Same-sex shenanigans is frowned upon where you come from, innit?

    Cow and sheep is not complaining, but professor will only be with the opposite

  • decet (unregistered) in reply to XXXXX
    XXXXX:
    So instead of just putting a web-interface onto the perl scripts, they decided to throw their perl away because ????
    Because they're ignorant bigoted Python fundamentalists.
    EatenByAGrue:
    Now, as to why you need to convert everything from Perl, you don't have to, but it sure can make the jobs of the sysadmins and maintainers easier. Also, Python code is significantly more distinguishable from line noise or the output of /dev/random *ducks*.
    ... for example.
  • Reductio Ad Ridiculousum (unregistered) in reply to prefec2
    prefec2:
    TRWTF is not to use existing tooling, comparable to Checkstyle (http://stackoverflow.com/questions/2977866/checkstyle-for-python). Even as a stupid college student, you should know a) look if someone already solved the problem b) if yes, test if it works and is maintained c) if yes, use it, else discuss finding with supervisor
    The Intern did that. I'm sure it took all of 10 minutes the way he did it. How long would it take your way to avoid re-inventing the wheel?
  • Name (unregistered)

    TRWTF is expecting someone with zero real world experience to have in depth knowledge of both languages and be able to not just translate the literal code but the intent behind it. Chris is the dud here in managing people.

  • Norman Diamond's cat (unregistered)
  • Cheong (unregistered)

    I don't know Python so don't know what's the quality of the code written, but if the code actually works, IMO it deserves a C or above even if it's written in a bit clumsy way.

    Going for style is only needed when you aim an A. And you shouldn't be surprise to see the code doesn't work when inadequate supervision is given for interns.

  • Linux Kernel (unregistered) in reply to Piss Head
    Piss Head:
    Yuri:
    Matt Westwood:
    Butthats 4Eva:
    Hannes:
    Anonymousy:
    "TRWTF is why replace a concise shell command with lots of Python code."

    Hear hear, give this man a beer!

    And give two to me, or else leave me be!

    And I will take four, or boot your ass out the door!

    I'm having eight Fuck, I am in a state

    Sixteen for me, ("I have a problem", you see..)
    I'll take thirty-two, Of your wonderful brew!

    Shishxty-forrr, oh hello floor. snore

  • Dave (unregistered) in reply to Tim
    Tim:
    And here lies the entire problem with the way programming/computer science is taught in college. You see Dudley was taught that he will always be given the exact description of what the issue/project is and he should never go above that

    Yup. This is why we have to interview (or at least go through the resumes of), on average, 70 university grads to fill one job position at my company. Alongside all the other WTF'ery we see, there are way too many who can't do anything at all unless given grade-school paint-by-numbers instructions on how to solve a problem. We'd have to dedicate a full-time staffer just to tell them what to do, they'd be a net loss in productivity.

  • Dave (unregistered) in reply to tharpa
    tharpa:
    In some universities, "E" is "Conditional Failure", meaning that the student can meet with the professor who will set conditions for upgrading to a "D".

    For example whether she spits or swallows.

  • foxyshadis (unregistered) in reply to Cheong
    Cheong:
    I don't know Python so don't know what's the quality of the code written, but if the code *actually works*, IMO it deserves a C or above even if it's written in a bit clumsy way.

    Going for style is only needed when you aim an A. And you shouldn't be surprise to see the code doesn't work when inadequate supervision is given for interns.

    That only applies if the main criteria is "make something that works". If you already have something that works and need an improvement, something that just works is still worth a zero.

  • aRTna (unregistered)

    The real WTF is giving a crap about cyclomatic complexity.

    If your code is actually that bad, and you don't know it before measuring cyclomatic complexity, you should be fired.

  • (cs) in reply to Javelin
    Javelin:
    Could be referring to the "E/G/S/N/U" grade scale (standing for "Excellent"/"Good"/"Satisfactory"/"Needs-improvement"/"Unsatisfactory") used in place of "A/B/C/D/F" by some elementary schools.

    Alternatively, it's a grade between "D" and "F".

    There's at least one examination system here that uses letters A through G as passing grades (there's a complicated system to pre-split people according to which papers they'll take so that the grades are meaningful, with some overlap).

  • Herr Otto Flick (unregistered) in reply to Colin 't Hart
    Colin 't Hart:
    TRWTF is why replace a concise shell command with lots of Python code.

    Good. Now tell all those Linux idiots who keep rewriting their own version of rc - are we up to startmeupd yet or is the systemd "standard" sticking for now?

  • not an anon (unregistered) in reply to aRTna
    aRTna:
    The real WTF is giving a crap about cyclomatic complexity.

    If your code is actually that bad, and you don't know it before measuring cyclomatic complexity, you should be fired.

    It is a good tool for "we know this code is a rotten mess, but we need to find all the really rotten spots" though...(i.e. you've already seen a few overcomplex methods, but need a more systematic way to identify how far and wide the problem has spread)

  • (cs)
    [image]

    Dudley also wrote paper on how to speed up your computer. I also "THOUGHT" of uninstall java, but it did not make my computer FAST.

  • (cs)

    R.I.P. RobIn Wailams.

  • nmclean (unregistered) in reply to EatenByAGrue
    EatenByAGrue:
    Why do you need python for a web front-end?
    You don't need Python, but you need something, and Python is a pretty good one, with an MVC framework (Django) and at least one CMS (called Mezzanine).

    Now, as to why you need to convert everything from Perl, you don't have to, but it sure can make the jobs of the sysadmins and maintainers easier. Also, Python code is significantly more distinguishable from line noise or the output of /dev/random ducks.

    A note on dealing with interns: The point for the employer is to find good entry-level hires in a low-stakes situation that makes it easy to get rid of the idiots. That means that the ones that aren't going to make the cut are often real dunderheads, and should be treated as such.

    The confusing part is how it's stated that rewriting the scripts in python would allow for the web front-end. While it's true that you might want to rewrite scripts into something more maintainable, and it's also true that you need some kind of additional interface to get it up on the web, these are two independent concerns. Just translating the scripts to python isn't going to help you create a front-end.

  • nmclean (unregistered) in reply to Cheong
    Cheong:
    I don't know Python so don't know what's the quality of the code written, but if the code *actually works*, IMO it deserves a C or above even if it's written in a bit clumsy way.

    Going for style is only needed when you aim an A. And you shouldn't be surprise to see the code doesn't work when inadequate supervision is given for interns.

    You don't need to know Python to see nonsense here. Notice that the literal code from the original script is interspersed through the "rewrite". If it was desired to use all of the original code, they could have just called the script directly.

    Incidentally, the code doesn't actually work, because it doesn't substitute the variables with command line parameters.

  • Stuart (unregistered) in reply to Nagesh
    Nagesh:
    Dudley also wrote paper on how to speed up your computer. I also "THOUGHT" of uninstall java, but it did not make my computer FAST.

    Removing Java only made all my security warnings go away. Removing Flash made it FAST.

  • (cs) in reply to aRTna
    aRTna:
    The real WTF is giving a crap about cyclomatic complexity.

    If your code is actually that bad, and you don't know it before measuring cyclomatic complexity, you should be fired.

    +1, it's another LoC-type pseudo-metric.

  • (cs) in reply to nmclean
    nmclean:
    EatenByAGrue:
    Why do you need python for a web front-end?
    You don't need Python, but you need something, and Python is a pretty good one, with an MVC framework (Django) and at least one CMS (called Mezzanine).

    Now, as to why you need to convert everything from Perl, you don't have to, but it sure can make the jobs of the sysadmins and maintainers easier. Also, Python code is significantly more distinguishable from line noise or the output of /dev/random ducks.

    A note on dealing with interns: The point for the employer is to find good entry-level hires in a low-stakes situation that makes it easy to get rid of the idiots. That means that the ones that aren't going to make the cut are often real dunderheads, and should be treated as such.

    The confusing part is how it's stated that rewriting the scripts in python would allow for the web front-end. While it's true that you might want to rewrite scripts into something more maintainable, and it's also true that you need some kind of additional interface to get it up on the web, these are two independent concerns. Just translating the scripts to python isn't going to help you create a front-end.

    You wrap it in a function, and worry about the interface later. That's step 2.

  • Olanke Friedman (unregistered) in reply to chubertdev
    chubertdev:
    aRTna:
    The real WTF is giving a crap about cyclomatic complexity.

    If your code is actually that bad, and you don't know it before measuring cyclomatic complexity, you should be fired.

    +1, it's another LoC-type pseudo-metric.

    +2 to that. And I've seen so many cases of code that's been broken down into absolutely trivial functions and classes, presumably to meet some sort of complexity metric, so that it becomes more difficult to "see the forest for the trees".

    Some functions will naturally be complex because of what they have to do.

  • Cheong (unregistered) in reply to Nagesh
    Nagesh:
    [image]

    Dudley also wrote paper on how to speed up your computer. I also "THOUGHT" of uninstall java, but it did not make my computer FAST.

    I think uninstalling Java would help if you got JQS run as service. It'd consume some of your startup time afterall.

    I don't know, but for slow PC problem usually the better target would be to move to a less resource hogging antivirus package.

  • Koko (unregistered) in reply to Nagesh
    Nagesh:
    R.I.P. RobIn Wailams.
    I was so sad to hear about that. His ID didn't even say he's a programmer. Well now I know. Just wait until I get my paws on whoever let him read that code.
  • nmclean (unregistered) in reply to chubertdev
    chubertdev:
    nmclean:
    EatenByAGrue:
    Why do you need python for a web front-end?
    You don't need Python, but you need something, and Python is a pretty good one, with an MVC framework (Django) and at least one CMS (called Mezzanine).

    Now, as to why you need to convert everything from Perl, you don't have to, but it sure can make the jobs of the sysadmins and maintainers easier. Also, Python code is significantly more distinguishable from line noise or the output of /dev/random ducks.

    A note on dealing with interns: The point for the employer is to find good entry-level hires in a low-stakes situation that makes it easy to get rid of the idiots. That means that the ones that aren't going to make the cut are often real dunderheads, and should be treated as such.

    The confusing part is how it's stated that rewriting the scripts in python would allow for the web front-end. While it's true that you might want to rewrite scripts into something more maintainable, and it's also true that you need some kind of additional interface to get it up on the web, these are two independent concerns. Just translating the scripts to python isn't going to help you create a front-end.

    You wrap it in a function, and worry about the interface later. That's step 2.

    Yes... and? Rewriting and wrapping aren't the same. Of course you'll want to wrap the call to the external script in a function for easier consumption, but whether you want to translate all the old code to new python modules remains a separate concern.

  • (cs) in reply to Stuart
    Stuart:
    Nagesh:
    Dudley also wrote paper on how to speed up your computer. I also "THOUGHT" of uninstall java, but it did not make my computer FAST.

    Removing Java only made all my security warnings go away. Removing Flash made it FAST.

    Flash player is the best software. Their team is releasing so many updates every week.

  • (cs) in reply to nmclean
    nmclean:
    Yes... and? Rewriting and wrapping aren't the same. Of course you'll want to wrap the call to the external script in a function for easier consumption, but whether you want to translate all the old code to new python modules remains a separate concern.

    I don't even know what the point of this is. You're basically questioning why a Python interface would want to work with Perl code translated to Python.

  • nmclean (unregistered) in reply to chubertdev
    chubertdev:
    You're basically questioning why a Python interface would want to work with Perl code translated to Python.
    Nonsense. There's an enormous difference between questioning a process and questioning whether the end result of that process would be desired. Example: I don't want to grow and maintain a garden. This is not the same as "questioning why I would want access to free food".

    Follow the conversation. First, the article says: "Rewriting these tools in Python would let Chris put a nice web front-end on top so his fellow developers could run the tools..."

    This is confusing, as "XXXXX" writes: "I am confused...Why do you need python for a web front-end? ... So instead of just putting a web-interface onto the perl scripts, they decided to throw their perl away because ????"

    The answer was basically "because a python web framework exists" and "python is easier to maintain". While both of these could be true, they don't answer why Chris needs to rewrite the scripts in order to put a web front-end on top and allow his fellow developers to run them. "Creating a web interface" and "creating more maintainable scripts" are two completely independent goals.

    The point is Chris could have quickly and easily achieved the stated goal by running the web on perl and/or writing some wrappers. There was no need to make his fellow developers wait a whole summer for this while a bunch of interns rewrote all the scripts.

  • jas88 (unregistered) in reply to chubertdev
    You can use VB on the web, doesn't mean it's a good idea.

    I misread that as "V8" at first, and was thinking "WTF? Of course you can use Google's Javascript engine on the web, that's what it was built for!"

    That's probably because I've just spent all day trying to find a way to run a Javascript web app which needed 6 Gb of RAM to complete the calculation... (Before suggesting the obvious: x64 Chrome breaks horribly at 2047Mb. Yes, that whole project is a pile of WTF from beginning to end; I'd already had to bypass the chunk of C# at the start which was breaking when trying to build the list of items to process, then the client-side startup code which tried to load those 13,000 items via AJAX - all simultaneously - and the client had been promised the data by today, so no time to rewrite the remaining WTFery.)

    CAPTCHA: Once the code is all replaced, I can still usitas a browser stress test.

  • (cs)

    The fail here is at the outset.

    Chris started with WTF code. He told Dudley to change the language of that WTF code, without explaining why the WTF code was WTF code, or even that it was.

    For those who can't tell, the reason it's WTF code is because the File::Find perl module makes the first part of that pipeline unnecessary, and

    while (<>) {
        my @word = split /\s+/;
        print "$word[0] $word[3] $word[4] $word[5] $word[6]\n"
    }

    handles the last part. So it should have just been a pure perl program originally.

    Instead, Dudley was told to convert languages, as if the language itself was the issue. But you can write WTF code in any language. Most of the Python code I've seen demonstrates that (as it has mostly been WTF code written in other languages, translated to Python to "make it all better", and it never does.) One needs to understand why the old was bad to be able to fix it.

Leave a comment on “Literal Scripting”

Log In or post as a guest

Replying to comment #:

« Return to Article