• LCrawford (unregistered)

    class AlsoReturnComment extends ReturnValues { return "Frist"; }

  • Black Mantha (unregistered)

    Constructor super calls should not risk a call stack overflow.

  • Skroderider (unregistered)

    Beautiful! Brilliant!

  • RLB (unregistered)

    I have, for some time now, been convinced that "Agile" is the new "Enterprise".

  • Senior Dev Robot (unregistered)


  • Kashim (unregistered) in reply to RLB

    I have, for some time now, been convinced that "Agile" is a great idea in the short term, but we will see in 10 years that all of the companies that adopted it have folded because of failure to pay down their technical debt.

  • Mr. Grumpy (unregistered) in reply to Kashim

    I have, for some time now, mentally substituted the word "Chaos" for "Agile" whenever I heard it.

  • (nodebb)

    Oh....... WTF??

  • Sole Purpose of Visit (unregistered) in reply to RLB

    Good luck persuading anybody of that. (It's very possible that Dave Thomas agrees, but the other Agilistas are off selling courses and suchlike.)

    I hold in my hands a book called "Disciplined Agile Delivery," published by IBM Press and 481 pages long. I would not hesitate to suggest that this book, simply by its very existence, proves that Agile is the New Enterprisey.

    It's hard to blame Agile for the rottenness in the OP, however. Like the (arbitrary, but useful as a sanity check) limitation on five parameters to a function, the existence of this cast-tastic multivariate indeterminate return structure should, in any methodology whatsoever, induce an immediate rethink and refactor.

    You can create technical debt in any methodology whatsoever!

  • Sole Purpose of Visit (unregistered) in reply to Kashim

    I am of the same opinion.

    But the thing is, even if (y)our hypothesis is true, there's no reason for a software organisation to care one way or the other. Ten years is an awfully long time in software development, so management could legitimately (by their metrics) claim, on the macro level, YAGNI.

    If this monstrous heap of unfumigated crap lasts five years and satisfies business requirements ... it's been amortized basically to zero cost. Rinse, wash, repeat.

  • Simon Clarkstone (unregistered)

    I thought this tactic looked familiar, then I recalled:

    "If you have a class with 10 properties (member/method) in it, consider a base class with only one property and subclassing it 9 levels deep so that each descendant adds one property. By the time you get to the last descendant class, you’ll have all 10 properties." -- http://mindprod.com/jgloss/unmaindesign.html

  • Casual Observer (unregistered)

    Yeah, of course the extensions on extensions is bad, but what bugs me more is the naming convention they "chose".

    "Also return" > "Add" > "Include" > "Include" > "Return with" > "Return with" > "Return with" > "Return with" > "Return with" > "Return with"

    I guess they really ended up liking "Return with", but still...

  • Perri Nelson (unregistered)

    If you've got to return more than one thing from your method, your method is probably doing too much.

  • (nodebb)

    Add a sub class... Now you have two problems.

    Class dismissed!

  • Barf4Eva (unregistered)

    fucking facepalm ugh nasty

  • (nodebb)

    I think the main problem here is that there aren't enough classes. For instance, what if I want to return the number of days, the last name, the price, and the expiry date? There should be a class for that combination too, without forcing me to also include the transaction data and so on.

  • Gerhard Visagie (google) in reply to RLB

    Id like to touch base on this issue, and synergize the outcomes across multiple spheres of engagement.....

  • Hermit (unregistered)

    def message(): return "Such a pity", "they don't use Python"

  • SplinyJoe (unregistered) in reply to Bananafish

    Why yes, yesterday was my birthday, thank you! I was perfectly square again

  • (nodebb) in reply to SplinyJoe

    Why yes, yesterday was my birthday, thank you! I was perfectly square again

    Happy birthday, Joe. Wish this article went one step further for you and included:

    class ReturnWithBirthdayWishes extends ReturnWithPriorities

    Cuz everyone knows, birthdays are a priority - sometimes with great returns ;)

  • (nodebb) in reply to SplinyJoe

    May happy returns of the day, SplinyJoe ;-)

  • Scott Christian Simmons (google) in reply to Scarlet_Manuka

    Good point, Scarlet_Manuka. With twelve parameters, we can capture every possible combination with 4095 subclasses. Not only will this give you the ability to only ever pass the values you actually need, but also it helps your bottom line if you're paid or evaluated by lines of code.

  • ZZartin (unregistered) in reply to RLB

    Agile is not bothering to design things properly upfront and calling it a strategy.

  • Sole Purpose of Visit (unregistered) in reply to ZZartin

    I would go slightly further.

    It's managers telling you to do the minimum required work now (but you have to test it. But there is no quality measure on the tests, so, useless).

    And it's managers telling you that it's "OK" to acquire Technical Debt -- trust me, they actually say this -- because Technical Debt can always be paid down later.

    And it's managers running the shop as a sausage factory, churning out mystery meat, and claiming bonuses based upon spurious metrics.

    And it's managers who blame the designers and the programmers when the whole unwieldy mess of pottage turns upside down and loses them customers.

    Not quite the original ideal, but if you examine the original ideal, it was nothing more than a bunch of failed Extreme Programming maniacs (plus Dave Thomas) trying to revive their consultancy careers. In which they were quite successful.

    Dave Thomas (my old boss), is exempted from this. He has recanted. But he really shouldn't have said it in the first place.

  • DrPepper (unregistered)

    YAGNI (You ain't gonna need it) is in response to those bloated bits of code where you put literally everything you think someone might need, because, you know, they might need it.

    So you start off with just what you need, and maybe when you need a bit more, you add more to it. But SOMEONE should have said -- Hey, wait a minute, this is getting complicated, let's figure out a better way of doing this...

    C# and javascript have dynamic objects; or you could have a dictionary of keys/objects, or (gasp) put the actual return values on the heap somewhere and just return a key to find that return object, or ...

  • RLB (unregistered) in reply to Gerhard Visagie

    Sorry, mate, you'll have to run a story by the owner of my journey for that.

  • Little Bobby Tables (unregistered) in reply to Simon Clarkstone

    Ugh. I wish I hadn't read that Unmaindesign page now. It made me want to weep.

  • Appalled (unregistered)

    And each Class is repeating the same database IO (probably from the same table(s) or View) to retrieve that piece of data. Good thing most databases nowadays have good caching.

  • TheCPUWizard (unregistered)

    "wonder if maybe they should have been just a little less agile and that perhaps a tad more planning was required" - I completely disagree.

    RESPONDING to change does not imply any sacrifice to "Technical Excellence", "Best Design and Architecture" or any other element.

    It is all about making JUST IN TIME (not too early, nor too late) decisions.

  • TrollingMagician (unregistered)

    Snoofle, how did you know it was my birthday on the 6th? Eerie.

  • anonymous (unregistered)

    TRWTF is that practically all programming languages still only support one return value, even though multiple parameters have been around forever. There are many situations where multiple return values may be required, just look at the number of functions that take reference/pointer parameters for additional return values.

    A classic example is a function that needs to return a piece of data long with a status code. The common solutions are to either a) use a reference parameter for one of the return values, b) hackishly "combine" the return values into one value, such as using a positive pointer for the data or a negative error code, or c) use a follow-up call to another function to get the status of the previous function call.

    There's no technical reason why multiple return values aren't possible, and no sane reason to assume that this won't or shouldn't be necessary. AFAIK Lua is the only language that gets this right, and all the big OOP languages (even the newer ones like Kotlin) require a workaround and don't naturally support multiple return values.

  • Barbara Kwarc (unregistered) in reply to Mr. Grumpy

    I think it was originally meant to spell "fragile", but the initial "fr" couldn't come through unit tests, so they simply dropped it :q

Leave a comment on “Many Happy Returns”

Log In or post as a guest

Replying to comment #:

« Return to Article