PHP, Zend Framework and Other Crazy Stuff
Archive for April, 2006
Protoshell
Apr 21st
Thought I’d spread the word in case anyone may be interested.
Moocat recently announced an open source RPG project entitled “Protoshell”. A quote:
This is the official announcement of my work a new project, Protoshell. Protoshell is a cyberpunk RPG based in a browser. It is still in the planning stages, however I am going to go open source with it once I have it to community level standards. Some currently planned features are as follows…
Rest of the post can be found over on Red Haze.
Sounds like an interesting project, and the name is certainly memorable – unlike Quantum Star SE Evolved which is quite a mouthful! Hope all goes well and we get a shout when the website for it is up. I’ll be adding Moocat’s blog to my sidebar list – not sure when it was left out. I originally had it there…
Good luck on the project! ![]()
Release early, release often…
Apr 21st
I was reading iamsure’s blog a short time ago and was disappointed to learn that the BNT Proton branch has suffered something of a setback. Not because of lack of development, not because iamsure’s PC crashed and he’s awaiting a new motherboard, not because there were major issues in the code – but because the code was firstly not backed up, and secondly not publicly available. I hate when that happens to me…and it has in the past.
It brought to mind the open source maxim “Release early, release often”. As I’ve hinted at in the past (and just pointing out a personal view), BNT is a project shrouded in a great deal of secrecy when you’re a non-developer looking in. It’s open source, yet not strictly open community. We all know there’s a BNT mailing list somewhere – but its apparently private and its existence rarely noted. I think I’ve only ever come across a handful of references to its existence though the forum may contain far more I’m unaware of. We all know there is (or was depending) some interesting Proton code in BNT Land which no one from the public could access. Its a shame really, BNT hangs out there like few other PHP games on the scene in terms of popularity and its user base.
It’d be interesting to see what would happen if someone magically turned the mailing list into a public free for all with archives all the way back to when it was established, and all code regardless of its status was always committed and publicly available from subversion. Suddenly every Tom, Dick and Paddy would have the ability to read all new code within hours of its writing and have access to all those private closed-door discussions (barring private email).
How would that impact BNT as a project? In QS our published policy (a mere formalisation of what pre-existed in our group tradition) is to delegate only disputes or sensitive (read: copyright) material to private forums or email. Everything should be open, and it should be static (no after the fact editing). Both of those have come under fire in the past – some people dislike publicly discussing their code, others dislike seeing public discussion of their projects unrelated to QS. In both cases I made it clear they were not debatable practices.
For QS the policy definitely shows advantages. Open communications, from bug reporting all the way up to inter-developer debates, when accessible to the public draws feedback – and more importantly suggestions and opinions. Open code, while of limited utility in QS Evolved where everyone is dealing with something 2 developers cooked up as individuals before we contributed it as OS, promotes peer review, alternate solutions, debate over approaches, and usually a great deal of valuable brainstorming.
Of course all individuals and groups have their preferences, and we all have reasons for them. BNT is hardly the only or even the rarity when it comes to keeping its communications and code to a more private level. Projects similar in organisation can be as fantastically successful as any other project. I just believe that in the PHP Game genre its more beneficial to give outsiders a window into the project’s administration and the ability to post their point of view, and review new code if they feel like it.
So long as BNT and similarly organised projects don’t take the path of Legend of the Green Dragon though everyone can safely ignore me…![]()
The perfmon thing I have yet to finish
Apr 18th
Catching up on my email I found a request for details about that overdue adodb-lite module for performance management. One of these days I’ll simply forget to check my email for a few months and everyone can live on in darkness and despair.
I might have peace thereafter…
Anyways, the module still progresses at a snail’s pace. As I said here on the blog before I was expecting to be taking time off PHP development (except for adodb-lite perfmon). Since my last update on the subject I have fixed a few issues I was having. I also updated the HTML output to XHTML 1.0 Transitional (complient but for 1 error). I also renamed a few function calls and standardised others. I have been testing on MySQL 4.1 and 5.0 and it seems to work just fine. I have not tested on PostgreSQL so that’s next on the agenda.
Before I continue I need to port the work to date to the newest ADOdb-Lite version which was announced with changes which may alter how its included. Not sure yet – so something for a future post. I have decided not to separate out the presentation elements. It’s too much work, and would require a fairly large overhaul – even in comparison to what I’ve adapted to date.
The only bug I know of at the moment (without intensive testing) is a failure of the SQL Log pages to run EXPLAIN commands on logger queries. It offers a blank page with a standard footer but no error message (for non-SELECT statements) or explanation for SELECTs. Probably something small that got passed over while cleaning up the class. Maybe if progress inches too slowly I’ll just make a test release in case anyone’s interested in peer review and feedback.
Programming is a language – use it correctly
Apr 18th
I have determined this day to blog about a topic which is sorely missing in at least half the PHP (and other!) projects I have reviewed over the space of the last year. I say a period of a year, but you can drag it back in time.
My first presumption is that all people have at least a working knowledge of their native language (questionable I know
). Languages are weird things, often full of obscure rules which may not only differ between related languages – but between dialects also. However they all generally have similar standard rules, terms, and conventions.
Programming is a language. Most people tend to agree with that statement. Afterall how many would interpret:
if($i == 2){
echo ‘True’, “\n”;
}
as:
If variable i equals 2 then echo True-newline.
Most people would be my guess. The if statement is one of the most common constructs in programming today – even BASIC on the Commodore 64 I vaguely remember playing Dizzy (horrible thought…) used it. Unfortunately there is an enemy of language. This enemy is a crafty nefarious beast who slithers across text editors and IDE’s across the world whispering madness. You will recognise this creatures foul deeds when you happen across something like
if($i == 2)
echo ‘True’, “\n”;
$i = 3;
echo $i, “\n”;
This is something horrific which should immediately be banished to the Netherworlds from whence it crawled.
But there is worse. Much worse. There are horrors whose malevolence may drive you insane, tearing hair from your head and leaving you slumped on your keyboard moaning in fear… There are developers who may resist so much as a suggestion of a flaw…
Therefore I have collated the following rules (dutifully plagiarising some in the blogosphere tradition):
1. A programming language is like any language; use full sentences with correct grammer. Please…
2. An if statement without braces (curly brackets if you’re confused) is an if statement capable of unimaginable evil. Brevity is not an excuse for laziness. And yes, it is lazy.
3. Remember that short tags, asp tags or any other alternative are also evil. Only the most depraved would dare use them. Use
4. Register globals cannot be ignored. In short, don’t rely on them. If you do you shall be punished in unspeakable ways by people whose server leaves it off as a security precaution.
5. If you decide to comment code, than use full sentences. phpDoc generation makes no sense unless comments actually explain the code – not simply summarise it as “My DoThis() function”. All those funny @return, @param and such tags are essential – they’re not optional.
6. depreciated != deprecated
7. Do not mix functions or object methods which do the same thing. It’s annoying, confusing and makes Maugrim a little crazy. Likewise do not mix using a getter/setter with directly accessing a class property – its just as bad.
8. Indent code appropriately. It makes reviewing code a simpler faster process.
9. Always update 3rd party code as required, i.e. whenever the 3rd party releases an update.
10. Never ignore constructive criticism – it’s officially termed “peer review” and considered a good thing.
11. When someone tells you your code contains a security vulnerability, please – do not ignore it for 6 months until someone with access to a major security listing decides to give it a lot of publicity. It’s a bit rude.
12. Never claim you are separating PHP from HTML in an application… Because that’s plain stupid.
I give these in no particularly order, and in no particular category. They are just some things I most often find annoying me when trying to read or adapt code. Some annoy because what they claim to do may differ from what they actually do – particularly annoying when its pointed out and they refuse to update documentation.
Nearly all of these I view as common sense. I’m not above admitting my common sense may differ from someone elses. But from a personal point of view the above 12 points usually capture most things which frequently annoy me when reading someone’s source code.
Twas inevitable…and who is this Norris guy?
Apr 6th
After 2 weeks waiting for the bug to bite, it seems the long running progress on Quantum Star SE Evolved has finally stumbled to a halt. On a regular basis I reach points in time where my attention span on a hobby project will simply drop. As of today, I have not really worked on the code to any great degree for a few weeks, and have instead fallen into a backup cycle of planning the next stage of my plan for world domination of the browser game market…as if. Maybe I’ll have a few epiphany moments – always a sure sign the activity is about to accelerate once more. Anyways, until further notice I will not be actively developing QS. The break may last anywhere between a few weeks to a few months depending largely on what I end up doing as an alternative.
I know folk rarely like hearing such sentiments, but I’m not a machine (unforunately
) and I need to take a break from projects to let my brain recharge and come up with some nifty new ideas that will re-ignite my enthusiasm. Watch this blog. The project is not dead, Maug just needs to recharge his QS batteries…
In the meantime having recognised the symptoms I have been casting about for a creative outlet. I’m already committed to a performance management module for ADOdb-Lite (still enthusiastic about finishing that off, just held up by TES IV: Oblivion). I’m also thinking about digging around in my fiction notes and pulling together a storyline to build into a Mod for Oblivion. I’ve been kicking around the Silgrad Tower forums to keep an eye on mod developments – and wondering if it would be too embarrasing to add my thick Wicklow accent to the recently formed Oblivion Voice Actors’ Guild group. Maybe would be embarrasing – as much as I can write decent english, speaking it is quite another thing. Looking on the bright side, the hard to quite recognise as english accent may be useful. It’s certainly unique unless the Guild is swarming with fellow Irish.
Morrowind mod making was something I always regretted missing – but in 2002 I was a mere noob on the bottom of the corporate career ladder with an obligation to work attrocious working hours for peanuts. 4 years later and I’m not about to let the fun slide away. I have stories to tell, and a medium to tell them with. More on the mod scene in later posts no doubt after I get a little working experience with the fiendishly difficult object lists in the TES Construction Set.
On a final note, I have found further confirmation that the legendary BNT mailing list does indeed exist. This sanctuary of all things BNT where admission of new initiates is rumoured to involve the ritual sacrifice of a goat, two chickens and an iguana, is rumoured to be the source of the first Chuck Norris Fact. Chuck’s publicist declined to comment stating, “Chuck Norris doesn’t go on the internet, he has every internet site stored in his memory. He refreshes webpages by blinking.”
