- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
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
Admin
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.
Admin
Admin
Which bit of RenderWare? Which version? I'm curious 'cos I used to work at Criterion...
Admin
Yea, mono seems a good way to use .net for good! :D
Admin
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.
Admin
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.
Admin
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.
Admin
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.
Admin
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).
Admin
why the hell would you write such retarded php code?
Admin
you get what you ask for...
Captcha: paste
Admin
Especially with the <?= $var; ?> shorthand.
Admin
Ah, but PHP so excels at it.
-dZ.
Admin
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...
Admin
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.
Admin
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!
Admin
over-engineering motivator
Admin
ziparuniii?!
Admin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...........ZIPAPURINIKI!!
Admin
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!!!!!!!!!!!!!!!!!!!!!!!!!!
PIZZA!!!
You're a Spartan!!!!
Admin
Sounds like a "snap 'n shut" case to me ;-)