• Prime Mover (unregistered)

    The frist RWTF:

    "... rather gigantic Perl codebase."

    ... nuff sed.

  • (nodebb) in reply to Prime Mover

    Yeah, it could be a bit awk ward.

  • Industrial Automation Engineer (unregistered)

    "And then they left." Who left? Management? The lone developer? The development team? The sane code-review policies?

  • Sole Purpose Of Visit (unregistered)

    You absolutely sure that mandatory Pair Programming is a good idea?

    Because I'm not.

  • Gearhead (unregistered) in reply to Sole Purpose Of Visit

    You absolutely sure that mandatory Pair Programming is a good idea?

    It has its place, for example walking a new developer through bits of logic. But it would be madness to mandate that all programming be Pair Programming.

  • FrodoB (unregistered)

    "Mandatory Pair Programming" does not necessarily mean "All code has to be created with Pair Programming". It could also mean "Every developer has to do 2 hours of pair programming per week with rotating partners". Small step towards sharing knowledge and best practices, right?

  • Sole Purpose Of Visit (unregistered) in reply to FrodoB

    A completely useless step, in my experience. Which also causes much pain amongst the more introverted, not to mention pointless shouting matches.

    But yes, I guess that qualifies as "small," in a non-utility dimension.

  • Jason Stringify (unregistered)

    its value

  • Jonathan (unregistered)

    "checks the last index of the errors array" would normally mean examining the value at the last index, and would (normally) be written as `$errors[-1]".

    The "$#" syntax returns the index of the last position of the array, or 1 less than the length. (Assuming your index started at zero, which believe it or not Perl would let you change, even though every time I saw it mentioned it was immediately follow by "Don't do this."). So essentially this was `if( array is empty )".

    Much as I love Perl, things like this make me understand why many people hate Perl.

  • Fizzlecist (unregistered) in reply to Steve_The_Cynic

    Who sed? (Sorry, just couldn't resist. I should probably work on that)

  • Altreus (unregistered) in reply to Jonathan

    Things like this are not Perl.

    This is Perl:

    if (@array) { ... }

    You can write bad code in any language. I wouldn't get someone who barely speaks French to write French, but apparently it's normal to get people who barely speak Perl to write Perl. And so the cycle of people hating Perl continues.

  • Altreus (unregistered) in reply to Prime Mover

    Oh no, the article mentioned Perl. I wonder if TDWTF readers are worldly enough to not make the same tired, uninformed comments about Perl as the rest of the internet.

    I guess not.

  • (nodebb)

    To be fair, if $group_name contained a number, that interpolation of it wouldn't do anything terrible. If it contained undef or a reference it would be generally bad news though.

    And please don't ask me about the number off times I've seen people stringingifying undef (or None if in python code) and wondering why things subsequently went haywire

  • a cow (not a robot) (unregistered) in reply to Prime Mover

    'nuff sAd, you mean... (?)

  • Randal L. Schwartz (google) in reply to Jonathan

    Much as I love Perl, things like this make me understand why many people hate Perl.

    And it completely ignores the idiomatic way of just saying if (@someArray) { ... } to mean "if the array isn't empty".

  • Abigail (unregistered) in reply to Jonathan

    Perl hasn't allowed you to change where its array indexing start for at least a decade and a half, and has been screaming loudly if you try to do so for years before finally disallowing it.

  • Nick (unregistered) in reply to Sole Purpose Of Visit

    Pointless shouting matches? There shouldn’t be any shouting in a professional environment, pointless or not!

  • (nodebb) in reply to Altreus

    You can write bad code in any language.

    True but from my experience with my own code – thrown away and replaced by python mostly – it makes it particularly easy to get “smart” about the bad code.

    That said, it might also be because Perl was my Master-thesis time use case of scripting language that ended up teaching me about how not to write code due to being unable to debug and extend it a year later.

    Or maybe the part where it is a dynamic language without a built-in repl. Then again, I never really used it with a proper IDE either.

    Makes me wonder if other people also have made the experience of burning their ha da in Perl mostly due to their own lack of experience at the time?

    Can't find a reason to use Perl though, when I could use python instead, unless I can't install python on the target machine.

    Addendum 2023-01-24 03:20: That said, Python has some "implicit casting" behavior too, that creates similar annoyances. Like how passing a string instead of a single-element list of strings will often be misinterpreted as the list of characters instead of raising and exception. Or f-stringw silently steingifying methods, when you mistake them for a property.

  • Yazeran (unregistered) in reply to thosrtanner

    Using $var = "$var"; can do 'bad things' if the $var is not a primitive (scalar). For instance if $var is an object, and either the tostring or th destructor has unexpected side effects you are in for a surprise.

    Especially adding side effects to tostring is pure evil.

    The destructor could also give strange behavior if sometimes $var is the only reference to the object and other times not....

  • (nodebb)

    "All"? Rarely true for ANYTHING .... but pair program, done well (93% is done very poorly according to studies) is fantastic. Definitely my preferred method of working.

  • nasch (unregistered) in reply to Altreus
    Comment held for moderation.
  • (nodebb) in reply to TheCPUWizard

    (93% is done very poorly according to studies)

    My favorite was the job interview where the hiring manager was talking about how they have adapted agile development. On the scrum board was a single note saying "introduce agile".

  • Cappy (unregistered)

    Laughs in old man retired IT guy.

  • Ghost (unregistered)
    Comment held for moderation.
  • Saidalimo (unregistered)
    Comment held for moderation.
  • markm (unregistered)

    My guess is that someone wanted to be able to insert a breakpoint to see the value of $group_name before it was changed. I've done similar things, although unless I was quite confident about the stupidity of the compiler, I'd use something like $temp = $group_name so it wasn't so obvious that the line could be optimized away.

    Of course, as Yazeran said, you have to be sure $group_name is only a variable, not a construct with side effects.

Leave a comment on “The 13 Month Bughunt”

Log In or post as a guest

Replying to comment #:

« Return to Article