Posts tagged "Rant"

Reading other people's Code

I don’t know if i just suck at understanding other people’s (php mostly) code, but i frequently find myself slapping my forehead while reading code other people produce. I don’t say i’m a lot better at it, and i know that, that”s why i would never ever put my crap code online for other people to use and work with.

I”m on the search for a Wiki Software (more a Wiki Class) that i can use to start writing something that is in my head, and i don’t currently want to write my own Wiki just for that. (I wonder how long i can withstand that urge though). While going through the numerous PHP Wiki’s that are available, i’m getting more and more frustrated.

Just an example of what i feel is just bad:

@ini_set('session.use_cookies','1');
@ini_set('session.use_only_cookies','1');
@ini_set('url_rewriter.tags','');
@ini_set('session.use_trans_sid','0');
@ini_set('display_errors','on');
@ini_set('default_charset',wc_charset);
@ini_set('mbstring.func_overload','7');
@ini_set('mbstring.internal_encoding',wc_charset);
@ini_set('mbstring.internal_encoding',wc_charset);

Please don't do that, it will drive poor Admin's insane trying to figure out why the settings in your precious php.ini don't seem to work. (Especially enabling display_errors inside the code somewhere is just a no-go, and who knows what the software does if i forbid ini_set in my php setup)

Having a full page of require's, that point to 5 line classes is bad. Having everything just in one single file is not the way to go either, and having 50 lines of Documentation for an absolutely obvious function that is exactly one(!) single line of code, against having not a single line of comments for a 50+ line function is just silly. Either document properly, or don''t document at all!

Writing entire functions in a single line that even grows out of my editor window (which is 200 chars wide) is bad. Having 10+ functions of those beneath each other makes me sad.

After opening another php file, and seeing this:

foreach($_GET as $key => $value){if(in_array($key,$export_vars)){$$key = $value;}}
foreach($_POST as $key => $value){if(in_array($key,$export_vars)){$$key = $value;}}

i immediatly quit my editor and rm -rf the thing. You know Spaces don't cost extra money to use in Sourcecode.

/*
    Yes, most of the formatting used in this file is HORRIBLY BAD STYLE. However,
    most of the action happens outside of this file, and I really wanted the code
    to look as small as what it does. Basically. Oh, I just suck. :)
*/

At least they’re honest with that statement. AND OH BOY IS HE RIGHT! (rm -rf)



Wow:

The ErfurtWiki engine is fully contained in one script file, but almost 200 feature enriching plugins and extensions modules are available.

Guys, THAT IS NOTHING TO BE PROUD OF! 130KB of Code! That's a whopping 4000 Lines! Aaargh!

I've got a headache now, and i still don't have anything that i can use. It''s not all bad though. Take a look at the source of coWiki. It is nicely structured, has _usefull_ comments in the code, and is beatifully indented. I think i will just use the Markdown class, and start writing code around that.

Fonts Rant (Linux vs OS X)

Ever since i connected a 19” TFT (Instead of my 19” CRT) screen to my Mac Mini i find the fonts to look ugly. Look at this Screenshot:

Linux vs OS X

On the Left side is my Linux Desktop with Font settings to TFT Optimized. The Antialiasing is hardly noticed, and looks very sharp, on the right side is the same page on my Mini, also set to “Optimized for TFT” and the Antialiasing just jumps into your face. I’m tempted to connect the CRT to the Mini again, because it looks naturally better with Antialiasing on a CRT than on a TFT.

It May also be that i’m just too dumb (I live Linux, and only got the mini last year). Anyone with a hint on how to make the fonts look “good” on OS X ?

(If you told me 2 Years ago, that one day i would say that fonts on the Linux Desktop look better than on a Mac, i would’ve probably burst into a laugh. Glad to see there has been some major improvements over the time!)

PHP

The quote

although I’ve since learned that the actual purpose of PHP isn’t dynamic websites so much as bringing the security levels of Linux boxes in line with Windows-led industry standards
(From: Brane Dump – The Thoughts of Matt Palmer) Sums up pretty well how i’ve been feeling about PHP alot lately.I know it’s not PHP’s fault, but rather the programmers, but it seems PHP attracts sloppy and unsecure coding. Time to take a look at Ruby.

Template Engines

Why people still avoid Template engines in their projects is a absolute mistery to me. I download some random PHP script/app, put it onto my webserver at home, and take a look at the source.

If i see a single print/echo line spewing out html, i’m always immediatly tempted to rm -rf the thing. I have no problem customizing a PHP script, but people need to keep content + code apart from each other. It is so much nicer to fire up your random HTML editor with the template and customize it, without worrying to break some random line of php code.

rant- Eugenia tests Fedora

Eugenia of OS News, my all-time-favourite newsprovider about Operating Systems, tested Fedora Core 1. Read the story here. The quality of those ‘reviews’ are a Mild Disappointmet. I’ve read a couple of her articles in the past, and i’m not very pleased with her ‘reviews’. If you can’t compile an application, then please don’t complain that the distribution is faulty.