- 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
He was speaking from the BROWSER'S perspective!
Admin
Won't it? Well, just give it a try. (Oh well, you might find it amusing typing FQNs all the time, but most people dont.)
Admin
I have no idea what you mean. What is she doing? Please enlighten us.
Admin
public class Package {
}
in Package.java - compiles fine for me - using 1.5.0
Admin
I never said it won't compile. But try to use it.
Admin
UGH = Uncomprehenisble Gnarled Hack?
If you CATCHPA = knowhutimean
Admin
I believe she's trying a bit of ball control with 11 stiff men... :-)
Admin
I work in the same office as David. A minor point of clarification: the developer in question did all his work and testing on his own laptop with a Windows port of apache. He railed at great length at the developers of PHP when he discovered the name collision, and then we heard no more until after he was let go. The WTF came after he left and we discovered that this was how he intended to resolve the conflict at all of our customer sites.
Admin
As in the original quote: The girl on the right playing foosball.
My reply: She's playing foosball? (eyes never went down that far, not caring what she's doing)
CAPTCHA: enterprisey
Admin
Sure, there are reserved words in every language, but in most languages, the number of reserved words in an application doesn't increase every time you make a new function. The ability to have a function caleld package is nothing...The inability to call two different "toString" functions is significant.
I like PHP, but things like this make me grit my teeth. There is no excuse but sloppiness for lacking even the most rudimentary namespace.
Admin
Yea. I've had issues of a similar nature with PHP namespace collisions, but every time I've had someone inform me of one, I've simply renamed the offending function. It's a pain, but it's not a significant pain.
In this case, seeing as he clearly knew that there was an error, due to the crappy backend hack he tried to disable the zip library, and knowing that it wasn't heavily used, only an incompetent would have done anything other than meekly change the name.
People who view their own code as holy or sacred get on my nerves.
Admin
Something smells wrong about this WTF. If this project has 50,000 lines of code then it suggests that what the disparaged contractor was given and what was requested was substantially more than would be implied by 14 pages.
Admin
I have a feeling he'd have found a way to call it Zip::Zip or something like that. Everyone knows every field needs its own class.
I'd have just recompiled the zip extension (php_zip.dll and php_zip.so) to change all the zip* function names to oldzip*, then packaged them with the installer (as well as an apache reload cycle). Of course it would only work on one particular version, but no one uses it anyway, so it doesn't need to be documented. It worked fine on mine!
See, this guy just didn't go far enough, is all.
Admin
Guys! The girl is Paula! She has learned to code, and play foosball!
Admin
Then again, we are talking php here ;)
He could have used a code generator which generates.... lots of code.
Admin
Yep it often called WAMP or winLAMP ("winLAMP is not Linux Apache MySQL PHP" what a great acronym).
Admin
Not necessarily with taking into account that the contractor had a history of over engineering. I've know people like this. They could easily accomplish in 1,000 lines what it would take me to do in 50 or 60 lines of code. The sad part was that enven with the extra 1000/50 ratio, they still failed to meet the objective of having the program work correctly. A $100,000 dump truck is not necessarily superior to a wheel barrel in performance, it depends on the task you are trying to accomplish.
Admin
<Obligatory blonde joke in reference to Paula's intellect />
Admin
It's odd -- I don't know of a single server-side technology that does not allow for combining content w. code -- ColdFusion, Java, VB, .NET, etc. etc.
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.
But, "not seperating content and code" is always described as if it's (a) peculiar to PHP and (b) insurmountable. It is neither. Every server-side technology allows you to code like that. You shouldn't.
Either way, it's not PHP's fault. Write better code.
Admin
Surely there must be an IDE for PHP that supports refactoring... In Eclipse, Alt-Shift-R on any Java identifier (class, package, method, field, even a local variable) will rename throughout the application (or within the identifier's scope at least), updating all references, javadoc and comments (optionally).
There must be something similar for PHP I would think.
Admin
50,000+ lines of code. whew!
That's a body of work... Let's say each line is an average of 10 chars, That's potentially 500K of application script. OMG. Hopefully there's a ton of whitespace sprinkled in there. Or perhaps that handy zipcode class actually had the full zipcode listing embedded in it. I can't imagine needing THAT much application to vend 14 pages. This *app* must be amazing. Probably has it's own geo-locator-mapping system built-in. Driven by some verbose XML database, with enough XML parsers and enough dynamically generated XSLT and stylesheets to choke a dedicated T3 line. Probably abstracted the whole HTML markup language, all the arithmetic and trig functions and... why the heck not, re-write the zip library (since we don't need that one anyway).
I wonder how many simultaneous users it supports.
Admin
It isn't peculiar to Php, it's just really common because it's so easy to do it with php and comparatively hard to do it the right way.
Admin
Chalain here again--
Almost all of the code was hand-written by the developer. He suffered from a severe "Not Invented Here" complex. Some of the more notable items:
Admin
That is what i'm running on this box. Plus Filezilla.
check out Xampp.
Admin
Once someone sees it she will.
Or he.
Admin
Jeez, Now I feel sorry for the guy. Probably has real potential if he'd let go of the (made-by-me) complex. I missed it in the WTF, but it was noted that he wanted to work "undistracted", a clear sign that he had his own agenda. Sometimes, the hardest part about re-usablity is actually using it.
On the bright side... (hopefully it's working out) Look at all the great code you've bought. Might be some gems in there.
- DB Drivers
- Query Objects
- Session Management
- Proven Template Language
- And a few widgets to boot
It's a Win-Win for both parties. You got that, and he got to build it.
Admin
Admin
Admin
Hah! How utterly serendipitous - I'm at Disney World in Orlando, FL as I read this!
On a positive note, I'm pretty sure I've found the guy responsible for this WTF...it's either Goofy or Dopey.
I'll dope-slap 'em both tomorrow just to be safe.
Admin
Yes it will, there's this thing called reflection. Go look it up.
Admin
Really? It is perfectly ok to make such classes. It is called "abstraction". That is, if you have some complicated problem to solve, you can extract out a part of the problem, solve it, and you then use this solution as a tool to solve the original problem. Makes you see things more clearly, and it enables you to make more robust and flexible solutions.
--
Jon, abstractiomanic.
Admin
I don't know for sure about PHP, but with some other languages using classes for every little thing can be a performance bottleneck. Depending on the traffic, it might not matter though.
goto captcha;
denialOfEverythingThatPeopleAreGoingToSayAboutThat:
Of course, if all you do is make calls to the standard library (which it sounds like this guy did NOT do), it should all end up brillantly optimized. I think that's what the computer is trying to tell me right now anyway.
captcha: java
goto denialOfEverythingThatPeopleAreGoingToSayAboutThat;
Yes, this is proof I have long since lost what little sanity I had.
Admin
A classes value isn't solely based on it's re-use or extensibility, a class is also useful for encapsulation, as in a static class, or a Singleton
Admin
olddog: 'I missed it in the WTF, but it was noted that he wanted to work "undistracted", a clear sign that he had his own agenda.'
In this case the original estimate was only two weeks work, so it's somewhat understandable. But indeed for anything longer than that, reluctance to demonstrate, or at least give insight into, what one is doing is a huge red flag that the person or company concerned is not to be trusted. See the infamous Paula.
Incidentally - anyone else had problems with the Reply and Quote buttons disappearing from this site? When they disappear they aren't in the source either, so it isn't a browser problem. (I appreciate that anyone who is suffering from the problem now won't be able to respond ...)
Admin
Ah yes, we all know how well the brillant optimisation works ;)
On another note, I think it may be personal preference as to whether code and content should be seperate or not. Personally, I think they should not, so that there's a one-to-one file-to-page mapping (with abstractions to referenced business objects, common functions etc.). Following on from this, however, if anyone who can honestly tell me they've been (in a practical environment, with indecisive clients and time constraints) able to write a complex application in ASP.NET with absolutely no HTML in the codebehind and no code (Databinder.Eval references aside) in the aspx, I'd be impressed.
Admin
Strange, that quote was supposed to be from Time Waster, but when I quote that post, it says it's from Anonymous. It gets the embedded quotee correct though. WTF?
Admin
On PHP:
Well... I hate to type that:
<font color="#0000ff">?>
<div class="warning"><?php echo _("File not found error!") ?></div></font><font color="#0000ff">
<?php</font>
so actually, I do that
<font color="#0000ff">echo gDiv("warning",_("File not found error!") );</font>
features:
* no open/close php tags
* no html-ism, but c-ism
* easy to read
unfeatures:
* hardcoded html
* slow
implementation:
<font color="#0000ff">
function gDiv($class,$data){
return "<div class='$class'>$data</div>";
}<font color="#000000">
my php code has 1 <?php tag, and 1 ?> tag.
--Tei
</font>
</font>
Admin
You should stop dreaming.
Java's Refactoring IDEs came in existance because of the guys switching from Smalltalk environments (that include refactoring, and pretty much everything you can think of too) to Java, who wanted the power of Smalltalk environments back into their Java IDEs. It became widespread because it was (and is) useful (and even more in recent times because of the annoyingly static nature of Java or C#), but the core of it is that the guys who invented refactoring and refactoring tools were smart guys with a vision, who worked on huge projects.
You won't find that kind of guys working with PHP.
Hence no refactoring PHP IDE (hell, there ain't even a usable Python or Ruby refactoring browser, much less integrated to an IDE, and I don't think there is any Py/Rb IDE with Smalltalk's or Lisp's concept of images)
Admin
I reject your reality and substitute my own!
Admin
Time Waster isn't registered, thus becoming Anonymous... This is pretty annoying, and I think it would better if the inserted name would remain also in the quote...
You can obviously (OBVIOUSLY) write the 'correct' name yourself as the quoted user, still annoying though.
Admin
And then, somehow, we saw that Smalltalk didn't catch on. That our clients didn't want those applications anymore. They now wanted this newfangled Java. So I do Java now. My colleagues say I am one of the best. But really really I cry fo Smalltalk and, somewhere deep inside, I hate Java to this day, for a number of reasons. But I don't want to delve into its design flaws now. I just find it sad that good quality goes down the drain.
Admin
Very important, Alex: Make sure that Cambrian House sponsoring, and, more important even, their ad, stays on that right-hand-side column forever! :)
Admin
How do I post anonymously?
Admin
It's important to remember that code/HTML separation is a means to an end (i.e. maintainable software) and not an end in itself. OTOH it is a useful means, and I wouldn't like to use one-file-per-page except for very simple pages.
I haven't seen an ideal way of structuring this, and I doubt that one exists. One approach which I think is promising is to use for each page:
And obviously common functions etc are separated out appropriately. And it should go without saying that Javascript and CSS are separated out in their own files (but on the evidence of quite a lot of sites, it doesn't go without saying.)
Admin
Start by putting a bag over your head, then climb onto a wooden table...
Admin
Well the joke is on you for coding in PHP.
Admin
Well. I use PHP because is cheap, you only need a text editor ( nano, scite, whatever), and run everywhere (Linux, Windows, Mac, etc..).
Theres also the MySQL database, that is easy to use and has good tools (phpMyAdmin,..).
The other options where Perl, ASP, C and bash.
ASP and Bash where not widen supported.
C is somewhat of a bad tool for the web (too much string handling)
Perl is evil for big stuff.
Tada!!..: the winner is PHP.
I kind of like the new Microsoft stuff. The ASP.NET framework looks like the right thing (minus the doPostBack travesty). But the culture is about huge IDEs, and I hate bloat, so .NET is a big no-no to me. But I think is a good thing, maybe the right thing . Theres also the Ruby/Python thing, that is nice. Maybe I will kill PHP soon and move to something with better design than PHP.
--Tei
Admin
Have you tried Apple's Cocoa/Objective-C? Probably the closest thing to a direct descendant of SmallTalk available.
Admin
You just did. Any questions? You mean you don't remember how you did it?
Admin
Have you checked out MONO? .NET cross platform!