Display 10 checkboxes



  • I got an inquiry from a client to "fix" an app. This function is supposed to set the state on 10 checkboxes (either on or off) from a database query. How bad could it be?



    WTFs include:


    • Each checkbox UI control is in fact a global variable
    • Each checkbox UI control has its own separate instance of the checkbox graphic
    • The developer went through three or four different ideas for storing the "selected" state of the checkboxes before finally settling on ten global strings. Note: the UI framework checkboxes have a boolean property called "selected" which handles the troubling boolean storage for you.
    • The checkbox retrieval process involves: Selecting a row out of a one-column sqlite table, unpickling one STRING field of the row into a dictionary, and finally converting the STRING properties inside that dictionary into their native types.
    • Like any good database read, it should really write the data back out afterwards. Preferably to another row.

    The hundreds of lines it takes to display 10 checkboxes won't fit in a single forum post here, so I've posted it up to gist:



  • Insert binary notation joke here.



  • Ah yes, Objective-C, the deformed freak child that's the result of Apple fucking C in the ass. Its existence is up there with VBscript on the "abomination" scale, and the capabilities of many of its programmers is also... poor, to be kind.

    Apple's ability to create shitty products that look beautiful, can be used by people who are barely capable of breathing, and sell in millions is great, but I'd prefer that the company didn't attempt to apply the same principle to development. Pretty soon every art major will think they're a programmer, and then civilisation as we know it will collapse, and it'll all be Apple's fault.



  • You can make gigantic failures in every language, in some it's easyer than others.

    Clearly this developer has read "Worst ObjC programming practices in 10 volumes integral edition".

    But I totaly agree that calling:

    NSBitmapImageRep* bmp = [NSBitmapImageRep initWithBitmapDataPlanes:planes pixelsWide:320 pixelsHigh:460 bitsPerSample:72 samplesPerPixel:60 hasAlpha:0 isPlanar:YES colorSpaceName:NSDeviceRGBColorSpace bitmapFormat:NSFloatingPointSamplesBitmapFormat bytesPerRow:0 bitsPerPixel:0];
    

    Is totally brain fucking (no pun intended)



  • @The_Assimilator said:

    Ah yes, Objective-C, the deformed freak child that's the result of Apple fucking C in the ass.
     

    LOL'ed on this one!!! And it is so fucking true!(Although I never used it. Just read some tutorials...)

    @The_Assimilator said:

    Apple's ability to create shitty products that look beautiful, can be used by people who are barely capable of breathing

    One thing comes in mind: iPhone4 not being able to be a phone (the antenna problem). WTF you need a phone for, when you have iPhone4?! (wow, this actually rhymes)

     



  • @The_Assimilator said:

     Its existence is up there with VBscript on the "abomination" scale

     

    DEVELOPERS   DEVELOPERS  DEVELOPERS  DEVELOPERS 




  • The worse thing is that I have to use this deformed freak child of a language as I sometimes need to develop iPod/iPhone apps (The typical "Wouldn't it be cool if we provided a free iPhone app to do xyz? Do it!" from management). To get any support whatsoever I have to use XCode, which means I have to use a Mac. At least my Mac is virtualised. 

    And of course, to do develop software for Apple platforms means you have to sign up to the Apple developer program, and beg Apple to send you a new developer license every 3 months (else they expire), and I have to pay annually to use this crap. 

    Does this mean I'm paying Apple to fuck me in the ass whenever they see fit?



  • @Mole said:

    Does this mean I'm paying Apple to fuck me in the ass whenever they see fit?

    Yes, but Apple's Reality Distortion Field makes you think you enjoy it.

     

    B



  • @havokk said:

    @Mole said:

    Does this mean I'm paying Apple to fuck me in the ass whenever they see fit?

    Yes, but Apple's Reality Distortion Field makes you think you enjoy it.

    ...Which explains why everything in the Heart of Gold is ipod-white, decades before the ipod became popular.  Time travel and reality distortion!



  • @The_Assimilator said:

    Ah yes, Objective-C, the deformed freak child that's the result of Apple fucking C in the ass. Its existence is up there with VBscript on the "abomination" scale, and the capabilities of many of its programmers is also... poor, to be kind.
     

    Apple didn't create Objective C.  They did do the cleanup and enhancments to create the Objective C 2.0 spec, but had nothing to do with the initial version of it.

     And, there are plenty of people with a background in languages like Scheme who seem to like it just fine, though I can't say I care for it particularly.  (And I especially dislike some aspects of Cocoa, independent of Objective C.  It's practically impossible to make a full Cocoa application without using Interface Builder.)



  • @The_Assimilator said:

    Pretty soon every art major will think they're a programmer, and then civilisation as we know it will collapse, and it'll all be Apple's fault.

    Funny you should mention this. Our management team wanted to jump on the iPhone bandwagon and decided I was the one who needed to get his head around Objective-C. I've been doing nothing but .NET development for the last five years, so there was definitely a learning curve for me. I mentioned this to our graphic designer (who is a marketing major) since he and I were working on the project together. His response? "Apple makes everything so easy! Why aren't you picking this up faster? All you need is a hierarchtical stack of objects." I've mentioned this guy in other posts. Every time he says 'hierarchtical' I want to snatch out his eyes, Kill Bill-style. That and he's a marketing major who writes ActionScript occasionally and thinks he has a clue about what we do or how we do it.



  • @Smitty said:

    @The_Assimilator said:
    Pretty soon every art major will think they're a programmer, and then civilisation as we know it will collapse, and it'll all be Apple's fault.

    Funny you should mention this. Our management team wanted to jump on the iPhone bandwagon and decided I was the one who needed to get his head around Objective-C. I've been doing nothing but .NET development for the last five years, so there was definitely a learning curve for me. I mentioned this to our graphic designer (who is a marketing major) since he and I were working on the project together. His response? "Apple makes everything so easy! Why aren't you picking this up faster? All you need is a hierarchtical stack of objects." I've mentioned this guy in other posts. Every time he says 'hierarchtical' I want to snatch out his eyes, Kill Bill-style. That and he's a marketing major who writes ActionScript occasionally and thinks he has a clue about what we do or how we do it.

    Female graphic designers I can live with because they're usually hawt. The male ones, I want to strangle or throw out the nearest window because they're usually incredibly stupid.



  • @The_Assimilator said:

    Female graphic designers I can live with because they're usually hawt. The male ones, I want to strangle or throw out the nearest window because they're usually incredibly gay.

    FTFY



  • @The_Assimilator said:

    Female graphic designers I can live with because they're usually hawt. The male ones, I want to strangle or throw out the nearest window because they're usually incredibly stupid.
     

    Hawtness one gets used to. Stupidity is an annoyance forever.

     

    And ever.



  • @dhromed said:

    And ever.

    And ever.



  • @Smitty said:

    @dhromed said:
    And ever.
    And ever.
    Amen.


Log in to reply