The online racing simulator
[OT] The Coding Horror Thead.
2
(42 posts, started )
Quote from Dygear :Do you know HTML?
Do you hand code your BBCode, for vB, phpBB, IPB, & SMF?

Yes, and yes, but most forums I visit are vB.
Quote from Dygear :You know, I have to wonder some time, why are there so many flavors of BBCode? I've spent the past 4 years learning BBCode, and what's demoralizing about learning BBCode is that vB's BBCode is different from that of phpBB, and these two are different from that of IPB's BBCode. Drives me nuts!

The original reason for bbcode is a simple one - it was easier to filter and sanitise than HTML. In this day and age of SAX and spare CPU cycles theres no valid reason to use bbcode at all, except to conform to expected standards.
PHP Sucks, But It Doesn't Matter
He's quite right, though. I work with PHP a lot, and find it very useful for the tasks I use it for, but it is a mess - no two ways about it.
It's extensive but the function names are fitting and it's well documented, unlike Ruby for example, which is just a jungle of functions with weird names... which is what I would call a mess
Have to admit though, I never really got into Ruby, it just "scared me away"
Well, it's what you get used to, really. I mean, I had a really hard time transitioning from PHP function names to Java function names - I wanted to put an underscore everywhere I wouldn't say either is easier - in pure usability terms, Java function names are technical superior, by not requiring you to reach for the underscore, but it's all a matter of what you're used to.

As for Ruby... let's not even go there *shudders*
Quote from morpha :It's extensive but the function names are fitting and it's well documented, unlike Ruby for example, which is just a jungle of functions with weird names... which is what I would call a mess

As you've alluded to, the biggest issue is not the size of the stdlib, but more a case of consistancy. There is no structure in PHP regarding various things - be it function naming format, whether or not it's haystack, needle or vice versa. That is PHP's largest problem these days and sadly without breaking compatibility, in a very big way, it cannot be fixed

There are plenty of applications and frameworks which help with this, and the various classes which have been introduced into PHP recently show a willingness to conceed that PHP is "broken" (in terms of spaghetti naming, argument ordering, etc.), but can't be fixed right now.

These frameworks immeasurably help in coding with PHP, although they do clearly add some overheads, which in some instances are actually pretty significant.

With regards to security issues (which is mostly what stems many sysadmin related arguments I've had with people regarding PHP, and in turn has affects "users" understanding and opinions on it), in the right configuration and the right hands PHP can be secure. However like all software it can contain bugs or be misconfigured. Things like the hardening patch (now Suhosin), having sensible PHP configuration, and good filesystem permissions go a long way, along with coding practises.
Quote from JamesF1 :in pure usability terms, Java function names are technical superior, by not requiring you to reach for the underscore, but it's all a matter of what you're used to.

Not necessarily cause CamelCode requires you to reach for shift and a certain key, whereas underscore is always the same combination

Quote from the_angry_angel :As you've alluded to, the biggest issue is not the size of the stdlib, but more a case of consistancy. There is no structure in PHP regarding various things - be it function naming format, whether or not it's haystack, needle or vice versa. That is PHP's largest problem these days and sadly without breaking compatibility, in a very big way, it cannot be fixed

Never really thought about that, DreamWeaver with its wonderful autocomplete pretty much eliminates the naming/order issues
However, I aggree that consistancy is very important, had to rewrite huge parts of my InSim framework just because I mixed different coding styles* and ended up with a load of crap. It worked but it was awfully slow, average packet processing time (yes, I'm taht kind of geek) was around 4ms* (rewritten version < 1ms*).

*on a Celeron 2.0/512/80GB IDE running CentOS 4.5
That's something which really bugs me in PHP, the devs shot themselves in the foot with the backwards compatibility thing. Really, they should have fixed the language back with PHP3, before it became uber popular. I mean, screw backwards compatibility really, if it's a problem then people just shouldn't upgrade.
Quote from morpha :Not necessarily cause CamelCode requires you to reach for shift and a certain key, whereas underscore is always the same combination

Fitt's Law (given it's adapted permutation for keyboard commands) and KLM's would beg to differ Using shift requires movement of, usually, a single finger. Unless you're a contortionist, you can't keep all-but-one of your fingers on the 'correct' keys, whilst hitting underscore
One one qualm with PHP is it's god damn function names.

get_file_contents(); ?
file_get_contents(); ??
file_put_contents(); ???
set_file_contents(); ????

or there is the string function naming problem. is it str_len() or strlen(); Well if it's strlen() here, then why is it not countchars() instead of count_chars();?

That's just insane!
Revisiting the Black Sunday Hack
Revisiting the Black Sunday Hack

One of the best articles from Mr. Atwood in a long time pointing back to a time where community vs hosts takes an unexpected turn for the side of the host. Not something that happens very often without the community leaving for good. Great article, even if most of it is a quote.
Quote from Victor :Maybe something that might be interesting for lfs's pubstats?

Is that a hint?
Exploring Wide Finder

This is more of a topic about the beauty of programming, and why you should be wary of beautiful code. Just because the code is beautiful does not mean it's correct. I strive to provide elegant solutions to complex problems with the simplest solutions and the least amount of code. I strongly believe that the smallest amount of code that needs to be written in order for something to work is the best. I also believe that just because something works does not necessarily make it correct.
Regular Expressions: Now You Have Two Problems
Regular Expressions: Now You Have Two Problems

Everyone knows about my battle with Regular Expressions. Mr. Atwood as finally taken on the subject proper, and as included some nifty tools. He also includes some do's and dont's. Enjoy.
regular expressions are evil, and to my eyes not very regular. Why are we fighting in the middle east - we should be fighting regular expressions and makking the world a better place.
2

[OT] The Coding Horror Thead.
(42 posts, started )
FGED GREDG RDFGDR GSFDG