• (cs) in reply to Your Name
    Anonymous:
    And all this time, I've just been trying to avoid clashing with keywords and default packages:  imagine, I could have just not included things like memory managment, pre-defined integers, classes...

    Oh, come to think of it I might get the following to work:

    class int
    {
        constructor()
        {
           //allocate memory for the class
           pInt = new bytearray(4);
        }
        destructor()
        {
           //deallocate memory for the class and call base-destructors
           delete pInt;
        }
    }

    <sarcasm/>


    Hey that's nothing bro.
    In engg school I had to debug one of my teacher's code for a paper.
    The second line of the program read:
    #define INT int
  • (cs) in reply to byte_lancer

    My bad memory.
    It was
    #define int INT

    Things went downhill after that.

    It wasnt even a valid C program by ANSI '92 standards.
    The excuse was that it compiled in ...hold your breath, Turbo C [yes, in the year 2002, teachers here in India held it in high respect]
    Maybe the still do. I learnt a lot from their WTFs.

  • Anonymous (unregistered) in reply to Phil the ruler of heck
    Phil the ruler of heck:

    Anonymous:
    How do I post anonymously?

    You just did.  Any questions?  You mean you don't remember how you did it?

    Unfortunately, no...I don't remember. One day I'll get the hang of this thing.
  • Certainly not George (unregistered) in reply to Doug
    Anonymous:
    Hmmmm, I'm actually guilty of doing something similar. There was a 3D library we were using and I needed to make changes inside of it (Rendware SUCKS) and thus recompile it. For some reason (that I can't remember) it wasn't possible to re-compile the entire .lib so I ended up recompiling certain sections of it, then linking both libs, and having certain functions supperceed other almost-identical functions of the same name.

    Not my finest hour T_T


    Which bit of RenderWare? Which version? I'm curious 'cos I used to work at Criterion...

  • Tei (unregistered) in reply to doodle
    Anonymous:
    Have you checked out MONO?  .NET cross platform!


    Yea, mono seems a good way to use .net for good! :D


  • aeonymause (unregistered) in reply to ben

    Anonymous:

    And I know of a few good ways of *avoiding* this practice using PHP -- the Smarty templating engine is my favorite, but there are others.


    I don't get the point of smarty, maybe you can explain it to me. Why would someone go to the trouble of building a templating language on top of php. Php is already a templating language itself.

  • anonymous (unregistered) in reply to aeonymause
    Anonymous:

    I don't get the point of smarty, maybe you can explain it to me. Why would someone go to the trouble of building a templating language on top of php. Php is already a templating language itself.



    Well.. to use PHP as a template engine you sould write code like this:

    <td><?php echo _("Client:"). " " . $clientName; ?></td>

    ..but you can have a template with this code:

    <td>{client.label}{client.name}</td>

    ..the latest is more readable, easy to explain to a designer, easy to debug if the designer corrupt the macro:

    Imagine the designer corrupt the template:

    <td>{client.label{client.name}</td>

    ...this bug is easy to debug. Break in a easy, safe way.

    Imagine the designer corrupting this one:

    <td><?php echo _("Client:") + " " . $clientName; ?></td>

    ...this is dificult to fix. Can break in a real painfull way, maybe with side effects. A smart dumb designer can break that in very imaginative ways you will never catch.

    The general purpose syntax for PHP is verbose than simply macros like {NAME} that a template can use, but PHP can't do.
  • (cs) in reply to aeonymause
    Anonymous:

    Anonymous:

    And I know of a few good ways of *avoiding* this practice using PHP -- the Smarty templating engine is my favorite, but there are others.


    I don't get the point of smarty, maybe you can explain it to me. Why would someone go to the trouble of building a templating language on top of php. Php is already a templating language itself.

    Well... PHP is a crappy templating language with the kitchen sink included by default, Smarty is a somewhat less crappy but much more limited templating language without kitchen sink available.

    Oh, and smarty templates are actually readable too.

    Of course, it's only smart to use Smarty when you have to use PHP, if you don't you can use Python and the Python templating language you prefer (Django's templates, Kid, Cheetah, ...) or Ruby with ERB.

  • Dazed (unregistered) in reply to anonymous
    Anonymous:
    Well.. to use PHP as a template engine you sould write code like this:

    OK, I give up. I was going to write a considered reply to this, but HTF does one pursuade this forum to produce a less-than sign? Insert it as plain text and the forum tries to interpret it as HTML; insert it as an HTML character reference and it interprets it as plain text.

  • Nobody (unregistered) in reply to Shoe
    Anonymous:

    GoatCheez:
    <sarcasm>
    I can't believe that the contractor didn't notice how the other applications were failing to work because of the ZIP library not being present. It just completely boggles my mind.
    </sarcasm>

    So you think it's acceptable to make a system-wide change that affects everything when you have the opportunity to make a local change that affects nothing else?  If I write an application and can't figure out how to make its title bar purple, is it OK if I delve into your system settings and make ALL title bars purple?  No.

     



    The goggles, they do nothing, oh wait, apparently for some they block out <sarcasm> tags (as if the content wasn't enough to identify that the post was sarcasm).

    Yes please make global changes to my system, install rootkits with my music, and make my windows OS 'phone home' every day (oh, wait, someone's already beat you to it).
  • Aeonymause (unregistered) in reply to anonymous

    <td><?php echo _("Client:") + " " . $clientName; ?></td>

    why the hell would you write such retarded php code?

  • phlox (unregistered)

    you get what you ask for...

    Captcha: paste

  • Patrys (unregistered) in reply to Aeonymause
    Anonymous:

    <?php echo _("Client:") + " " . $clientName; ?>

    why the hell would you write such retarded php code?


    Especially with the <?= $var; ?> shorthand.
  • (cs) in reply to snoofle
    snoofle:

    Anonymous:
    I think this is more of a PHP wtf than a moron contractor wtf. It's another demonstration of how easy it is to screw up in PHP by not naming your {function,class,variable} correctly. Why does everything have to be a function?

    What does everything having to be a function have to do with choosing incredibly bad names? You can make that screw up in *any* language!



    Ah, but PHP so excels at it.

        -dZ.
  • (cs) in reply to Dazed
    Anonymous:
    Anonymous:
    Well.. to use PHP as a template engine you sould write code like this:

    OK, I give up. I was going to write a considered reply to this, but HTF does one pursuade this forum to produce a less-than sign? Insert it as plain text and the forum tries to interpret it as HTML; insert it as an HTML character reference and it interprets it as plain text.

    Convince it you're using Firefox or IE, then insert it as a HTML character reference in the HTML view (or just a < in the rich editor). Yes, it is a WTF...

  • (cs) in reply to aeonymause
    Anonymous:

    Anonymous:

    And I know of a few good ways of *avoiding* this practice using PHP -- the Smarty templating engine is my favorite, but there are others.


    I don't get the point of smarty, maybe you can explain it to me. Why would someone go to the trouble of building a templating language on top of php. Php is already a templating language itself.

    yea.  I don't get it either - what's the point of the overlay. Not that there's no use for it... I just haven't run across the need. As I understand it, the template system is basically a last-minute callback to PHP before the page is completed. This is to allow the designer the *freedom* of layout without the worry of the  programmatic underpinnings. The problem is that template systems suffer from the same "functionality creep" that applications do. In other words, the template system becomes so complex it requires a lengthy learning-curve. Not to mention the processing overhead.

    As soon as I say this, someone will probably point out why this can't work for them, but for my money, the easy way is to match css ( skins ) with pre-defined output tags. Let PHP compile the output into containers that can simply be echo()'d onto the page. ie:

    <HTML>
    <HEAD>
    <?php echo $the_css_files; ?>
    <?php echo $the_javascript_files; ?>
    </HEAD>
    <BODY <?php echo $the_onload_stuff; ?>
    <?php echo $the_menubar; ?>
    <?php echo $the_left_div; ?>
    <?php echo $the_main_div; ?>
    <?php echo $the_right_div; ?>
    <?php echo $the_footer; ?>
    </BODY>
    </HTML>

    Let the appearance be defined by stylesheets.

     

  • enterprisey! (unregistered)
    Alex Papadimoulis:

    A few months ago, David Brady's company gave a small, fourteen-page web application assignment to a contractor they had worked with in the past. Although he was known for over engineering and for refusing to accept any alterations to the purity of his designs, the contractor assured them that he could complete it in two weeks so long as he could work "undistracted" (read: unsupervised). The company was really in a pinch and figured that, worst case, he'd take a little more than a month to finish it. They gave him the go-ahead.

    Four months into the project, the contractor said he might be able to finish in three more months, but wasn't promising anything. Fortunately, David was able to convince his higher-ups to dump the contractor and finish the application internally. Unfortunately, David was the one assigned to finish it.

    Although plenty there were plenty of "oddities" in the horrible mess of 50,000+ lines of code delivered, today's example comes from the application's installation guide. As it turns out, the contractor had written a class to handle ZIP Codes, and, ignoring the large body of work in the field of compression technology, chose to name the class handling this "Zip". Following is how he reconciled his design when he discovered the collision with the PHP compression library of the same name ...

    --------------------------------------------------------------------+
                                 Troubleshooting, Continued             +
    --------------------------------------------------------------------+
    

    Q: I'm receiving the following "Fatal Error" Messages:

     Fatal Error: Cannot redeclare class Zip in 
     [install_path]\php_includes\classes\Zip.php
    

    A. This is a result of the application loading the PHP Zip class. To solve the problem, 1. Navigate to and open the php.ini file. 2. Search for the extension "php_zip.dll" 3. Comment it out with a semi-colon (";extension=php_zip.dll") 4. Restart the Apache service

    Since the other applications on the server required the Zip (as in, compression) library, David took an alternative approach to reconciling the collision. He sifted through the 50,000+ lines of code and sought to rename the Zip class to ZipCode. Since it was used exactly once, it was pretty easy to do.



    the "fo' reals" wtf is how this consultant turned 2 weeks into 4 months.  yeah, this coder has a problem.  he isn't too bright.

    but management...  oh my.  my oh my.  4 months is like 18 weeks. 

    this clown coder turned 2 weeks into 18 weeks.  this cat was a marketing genius, even if a dopey coder.

    can you imagine how much this dude pocketed per page?  can you imagine how much management paid per page?

    now tell me, where is the "fo' reals" wtf?  they guy getting paid 800% more or the guy doing the 800% more paying?

    captcha "paula"

    gotta love it!
  • (cs) in reply to Ben Adams
  • ARA (unregistered)

    ziparuniii?!

  • ARA FROM BAKU (unregistered) in reply to ARA

    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...........ZIPAPURINIKI!!

  • Ara Jon (unregistered) in reply to ARA FROM BAKU

    Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!!!!!!!!!!!!!!!!!!!!!!!!!!

    PIZZA!!!

    You're a Spartan!!!!

  • (cs) in reply to Ben Adams
    Ben Adams:
    Over-engineering: "In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. Van De Snepscheut ----- Time is an excellent teacher; but eventually it kills all the students.

    Sounds like a "snap 'n shut" case to me ;-)

Leave a comment on “Zippity-Doo-Da”

Log In or post as a guest

Replying to comment #:

« Return to Article