• (cs)

    fr1st=fr1st.fr1st.fr1st

  • (cs)

    Frist? Frist frist. Frist.

  • (cs)

    But, but, but.... isn't all data considered to be data? What an appropriate and consistent naming convention!

    Kudos for a job well done!

  • Peter (unregistered)

    I guess this guy like Data from StarTrek TNG?

  • Data (unregistered)

    Data data data. Data data.

  • Mohonri (unregistered)

    Of course, the proper way to do this would be with a loop. After all, you never know how far down that object hierarchy you'll have to go:

    while(data.data){
        data = data.data;
    }
    
  • Joey (unregistered)

    Holy hell, doesn't anyone use ternarys anymore? Gosh!

    var srcData = data;
    return data.data && data.data.data ? data.data.data : data.data ? data.data : data ? data : null;
  • Riccardo (unregistered)

    Chicken chicken, chicken? http://www.youtube.com/watch?v=yL_-1d9OSdk

  • Chicken Chicken Chicken (unregistered)

    I guess this is research-based programming.

    Google "chicken academic paper".

  • kmd (unregistered)

    TRWTF is the unused variable srcData...

  • WhoMe (unregistered)

    TRWTF is no coding conventions in a large development team

  • Wookai (unregistered)

    Hodor hodor hodor. Hodor?

  • Smug Unix User (unregistered)

    At least it has vowels.

  • Andrew (unregistered)

    Bah! Data is overrated. Information is where it's at.

  • Yojin (unregistered)

    Is this a new pokemon?

  • Deezil (unregistered)

    http://en.wikipedia.org/wiki/Buffalo_buffalo_Buffalo_buffalo_buffalo_buffalo_Buffalo_buffalo

  • Jan (unregistered) in reply to snoofle

    But, but, but.... isn't all data considered to be data? What an appropriate and consistent naming convention!

    We use that too. And all the stuff that isn't data we just call 'stuff'.

  • Gumby (unregistered)

    I assume this was written by the Swedish Programmer

    [image]
  • Pista (unregistered)

    Boy, this would win with flying colors any obfuscated code contest...

  • Quicksilver (unregistered)

    Dadaism or Dataism?

  • the cornflakes guy (unregistered)

    Cornflakes? Cornflakes cornflakes. Cornflakes cornflakes cornflakes. Cornflakes, cornflakes cornflakes cornflakes.

  • Quicksilver (unregistered)
    var srcData = data;
    if (data.data) {
        data = data.data.data ? data.data.data: data.data;
    }
     
    if (!data) {
        return;
    }
    

    here way more readable!

  • (cs)

    hmmm... perhaps instead :

    while( data.data ) data = data.data;

    though... who knows... if (data.data == data) it might take a while :p

    I can think of cases where this might seem necessary. This is certainly eye candy, and definately ambiguously named... but not much of a WTF

    ADDED A FEW SECONDS LATER: .. .oO(WTF IS THE DEAL WITH MAKING VARIABLE strData)

  • causa (unregistered) in reply to Joey
    Joey:
    Holy hell, doesn't anyone use ternarys anymore? Gosh!
    var srcData = data;
    return data.data && data.data.data ? data.data.data : data.data ? data.data : data ? data : null;

    Batman!

  • Zirias (unregistered) in reply to Quicksilver
    Quicksilver:
    Dadaism or Dataism?
    Stop reading my mind. And yes, this is a piece of art.
  • ldam (unregistered)

    /me starts to hum the title song from "Indiana Jones"...

  • 3rd Ferguson (unregistered)

    This marklar is a perfect marklar for an embedded marklar with no marklar marklar. Marklar.

  • (cs) in reply to Joey
    Joey:
    Holy hell, doesn't anyone use ternarys anymore? Gosh!
    var srcData = data;
    return data.data && data.data.data ? data.data.data : data.data ? data.data : data ? data : null;

    That's just beautiful.

  • Krunch (unregistered)

    That programmer is obviously an orang-utan. http://www.dangermouse.net/esoteric/ook.html

  • Joe (unregistered)

    More reason to never data programmer

  • Crash Magnet (unregistered) in reply to Joey

    var srcSpam = spam;

    return spam.spam && spam.spam.spam ? spam.spam.spam : spam.spam ? spam.spam : spam ? spam : null

  • chopper (unregistered) in reply to causa
    causa:
    Joey:
    Holy hell, doesn't anyone use ternarys anymore? Gosh!
    var srcData = data;
    return data.data && data.data.data ? data.data.data : data.data ? data.data : data ? data : null;

    Batman!

    +1,000,000

  • (cs)

    function names and variable should not be of concern if function is doing job.

  • Hermit the Dog (unregistered)

    A true WTF that makes you literally say "what the f---?" when you're done.

  • (cs) in reply to Joey

    The "&&" makes it more unclear. Try this:

    return data ? data.data ? data.data.data ? data.data.data : data.data : data : nil
    

    That's way more concise.

  • Hodor (unregistered)

    Hodor?

    Captcha: Hodor

  • Tyler (unregistered) in reply to Joey

    Except that this looks like PHP, in which case using more than one ternary produces unexpected results. http://www.phpsadness.com/sad/30

  • Andrew (unregistered)

    Being John Datavich

  • (cs)

    This can't be a WTF, it's in JavaScript.

    $srcData = $data;
    if ($data['data'] && $data['data']['data']) {
        $data = $data['data']['data'];
    } else if ($data['data']) {
        $data = $data['data'];
    }
     
    if (!$data) {
        return;
    }
    

    There, now it's acceptable.

  • I am the night. (unregistered) in reply to causa
    causa:
    Joey:
    Holy hell, doesn't anyone use ternarys anymore? Gosh!
    var srcData = data;
    return data.data && data.data.data ? data.data.data : data.data ? data.data : data ? data : null;

    Batman!

    Why isn't this featured yet?

  • bluemoon (unregistered) in reply to Remy Porter
    Remy Porter:
    The "&&" makes it more unclear. Try this:
    return data ? data.data ? data.data.data ? data.data.data : data.data : data : nil
    

    That's way more concise.

    In dotnet 3.5 we have the ?? operator for this

    return data.data.data ?? data.data ?? data ?? null;

  • (cs)

    Changed to be formatted as the solution to an interview question.

    Function data_matryoshka (ByRef srcData as Object) as Object
      if IsNothing(srcData.Data) then
         return srcData
      else
         return data_matryoska(srcData.Data)
      end if
      return FILE_NOT_FOUND
    end function
    
  • (cs)

    What's the problem? It's just an example of data centric programming.

  • (cs) in reply to frits

    data.data = data;

    And if that is not using a pointer reference... then watch as the world comes to an end.

  • Berend (unregistered)

    Badger badger.badger(); Badger badger = Badger badger + Badger badger; badger.badger.badger ? badger.badger : mushroom

  • Martin (unregistered)

    I guess that when you read it aloud and with the right intonation it will sound like the national anthem of the programmer's country.

  • Jan (unregistered)
    var srcSpace = space;
    if (space.space && space.space.space) {
      space = space.space.space;
    } else if (space.space) {
      space = space.space;
    }
    
    if (!space) {
      space;
    }

    Space. So much space. Space, need to see it all. SPAAAAAAAACCCCCCCEEEEEEEEE!!!!!

  • Uncle Code Monkey (unregistered)

    I used to have a colleague that did something similar... but using single letter vars.

    if (a.a)...

    while (i<x.x.x)...

    and so on.

  • kongr45gpen (unregistered)

    A song to accompany this WTF: http://www.youtube.com/watch?v=SgvQqVLhBj4

  • Cujo (unregistered) in reply to causa
    causa:
    Joey:
    Holy hell, doesn't anyone use ternarys anymore? Gosh!
    var srcData = data;
    return data.data && data.data.data ? data.data.data : data.data ? data.data : data ? data : null;

    Batman!

    Dammit, you beat me to it. Nelson Riddle is probably doing about 60,000 rpms. I like how the Riddler insinuated himself into it. It appears Frank Gorshin has been channeled.

Leave a comment on “Data? Data data. Data.”

Log In or post as a guest

Replying to comment #388286:

« Return to Article