Jun
24
I’ve started reading the Pike tutorial tonight out of pure curiosity and something that struck me was their comparison to Python. Now in all fairness, I don’t think they’re trying to say that Pike is actually greater than Python (sorry, the title is a bit misleading), but they are making some bold statements! Keep in mind that I’m a bit of a Python fanboy.
Programs written in Python look very different from Pike programs, but Python and Pike are similar when it comes to ideas and use. Python is more widely used and has more libraries available. Pike on the other hand is faster, has a more advanced type system, and has better support for object-oriented programming. Pike’s more C++-like syntax makes it easier to get started with for programmers who know C++, C or Java.
Now, I’m in no position to say this is true or not. I’ve only started reading about Pike tonight. Here is an example of Pike’s syntax.
int main()
{
write("Hi there! What's your name?\n");
string name = Stdio.stdin->gets();
write("Nice to meet you, " + name + "!\n");
return 0;
}
Not sure I really like it, but wth, PHP looks much worse at times!
If there are anyone out there that has worked with Pike before, it would be quite interesting to hear your opinion! It does seem Pike is not as well supported as Python / PHP / Ruby…
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Programming Stii
Feb
03
This is probably the one reason why everyone should switch to PHP 5! According to Charl it is “teh shit”. It is the __autoload() function. You define an __autoload() function and by calling this function the scripting engine is given a last chance to load the class or include the class file before PHP fails with an error.
I’ve created this very simple example to demostrate the effectiveness of the __autoload() function. In the index.php file, I define my __autoload() function and tells it to include a file with the same name as the class. In other words, my class name is oneClass() so the file which contain oneClass() is called oneclass.php
//The magical autoload function...
function __autoload($classname)
{
require_once $classname . '.php';
}
Now I initialize class two :
$class2 = new twoClass('Second class');
$class2->getText();
PHP will require and include the file called twoclass.php without me doing anything. Nothing funny here… Thing is within class two I initialize class one. As you can see, nowhere did I say it should be included! So withing class two it autoloads class one and initialize it.
class twoClass
{
private $text;
function __construct($txt)
{
$this->text = $txt;
}
function getText()
{
$class = new oneClass($this->text);
$class->getText();
}
}
w00t!!! Nifty, hey? Note that I’ve create the page second.php to demonstrate how the same would result in an error due to the fact that I did not require class one. If you’d like to check it in action, feel free to download this example here.
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
PHP Stii
Feb
03
PHP 4 reached its end of life the 31st December 2007. They will continue to fix bugs up until 08 August 2008. Yet, most of the biggest CMS software, guys like Joomla!, Drupal and Wordpress keep on supporting PHP 4 instead of PHP 5. Why on earth?! I do get it that you cannot predict what version of PHP would be on a shared host, but the hosting providers should pull up their socks and upgrade!
PHP 5 is a 1000% improvement on 4 and has been out for a couple of years, so why would some shared hosts still cling to PHP 4? If these guys like Joomla!, Drupal and Wordpress develop in PHP 5, surely hosting companies will be forced to upgrade their PHP version? It is not like they would suddenly break all PHP 4 code as 5 is perfectly backward compatible. So what is the issue? When will this software be rewritten in PHP 5? Hehehe, that would be quite a feat, except that Joomla! 1.5 was written almost from the ground up not all that long ago!
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
PHP, Programming Stii
Feb
01
Still, it is lightweight and clean. Kohana is a Code Igniter fork that is completely open source and community driven. If you are used to Code Igniter, then Kohana would be a walk in the park. The one major difference is that Kohana is exclusively for PHP 5 while Code Igniter supports from PHP 4 and up. Kohana is strinctly OOP with benefits like visibility protection, automatic class loading, overloading, interfaces, abstracts, and singletons. Cool!
Whats more is that while Code Igniter supports only $POST arrays and no GET, Kohana lets POST and GET arrays live together in harmony with the same tight security of Code Igniter.
Another trivial thing thats always kind of bugged me of Code Igniter is the directory structure. Kohana’s directory structure makes a lot more sense. See, Code Igniter has one directory at the root called System. In this directory is a bunch of subdirectories of which your application directory is a part of. Kohana went and put the application directory with the system directory on the root path. I know, I know, it really is pedantic of me, but it just makes so much more sense to do something so insignificant. Well, actually, on second thought, its not as trivial as it might seem. Come upgrade time, you only need to upgrade the system folder and your application folder would be untouched. Code Igniter stores a bunch of system related files in their app folder which could get overwritten when upgrading, but need to be upgrade every once in a while as they do make changes to those files occasionally.
Another thing is that changes and fixes happens a lot faster in Kohana as it is a community project. Code Igniter is brilliant, but it was kind of slowish in releasing fixes and improvements as Ellis Labs first do Expression Engine (it seems) then Code Igniter. Kohana living in a community allows for rapid expansion and fixes.
All in all, I think Kohana is a great fork on an already great framework. Keep up the good work. If you are worried about it only working on PHP 5, well, PHP 4’s end of life was the 31st of December 2007 already! Convert! At least bugs will be fixed till 2008-08-08. Cool date they chose!
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Code Igniter, Open Source, PHP, Programming, web development Stii
Jan
07
Its a new year. As with every new year in the past, it is good and refreshing to start it with something refreshing. So I got myself a little dedicated server and rolled a cool Ruby on Rails setup on there all in the name of “research”. I’ve set it up to run a Typo blog (which is the preferred blogging platform for me at the moment), running behind Apache 2 and a sweet little Mongrel cluster. Nifty!
I know that some people have warned against running “scattered” blogs, but it is kind of the only option when wanting to experiment with different platforms and languages. So why not. Maybe there could possibly be a use for not rolling everything into one single blog.
So for the next couple of months (hopefully), I will be blogging with a multiple personality. I’ll give some views later on over there on how I find Typo. It would be pretty hard beating Wordpress…
So, please, visit me every once in a while over here: http://stii.co.za
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Blogging, Ruby (on Rails) Stii
Dec
06
Every programming language seem to have some sort of Ruby on Rails like framework. PHP got a couple lot. Python got Django (Django is not Rails though). Now the BBC went and made a Rails-like web framework with PERL.
This I found quite amusing:
“Like most organisations the BBC has its own technical ecosystem; the BBC’s is pretty much restricted to Perl and static files. This means that the vast majority of the BBC’s website is statically published - in other words HTML is created internally and FTP’ed to the web servers. There are then a range of Perl scripts that are used to provide additional functionality and interactivity.”
Their sites are statically published?! I did not know that and find it quite, uhm, shocking that a big organization would have such a primitive way of publishing their sites.
“For applications that run internally we use Ruby on Rail. Because we enjoy using it…”
No surprise there.
They built PERL on Rails because:
“We need to use Perl, there are restrictions on which libraries can and can’t be installed on the live environment and we needed a framework that could handle significant load.”
Now I’m just wondering, are they planning to release the source code, or is it going to stay an internal framework exclusive to the BBC? Should be quite interesting to see it and experiment with it. No-one knows yet. This part of their site is powered by PERL on Rails, they say.
They would almost certainly have to change the name. When PHP on Rails first saw the light, it was quickly slapped with a lawyers letter and had to change its name. Now known as PHP on Trax.
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Open Source, PHP, Programming, Python, Ruby (on Rails), Software Development, web development Stii
Dec
05
This is simply too good not to share. I love the xkcd comics. Python programming can make you fly high! Not so sure about that one, but give it a shot. Just don’t try everything in the medicine cupboard and then go programming. It does not work in PHP, Ruby on Rails, Python, etc… In fact, no matter the language, it does not work.

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Funnies, Python Stii
Dec
04
I’ve just listened to the Ruby on Rails podcast where they interviewed Avi Bryant from Seaside, which is a web framework developed in Smalltalk. I’m no Smalltalk guru, but I know it is quite a mature object orientated language so it does sound very interesting! Specially due to the fact that the framework not only eliminates SQL, but also the HTML! That and the fact that it allows for developing modal components on the web, much like you would for windows or osx. It all sounds extremely exciting and interesting, but I would probably not have any opportunity to play with it anytime soon! If you have or do get the opportunity, please let me know what you think!
You can listen to the podcast on odeo, or download the mp3 here.
Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Open Source, Programming, Ruby (on Rails), Software Development, web development Stii
Nov
14
I feel like I’ve been in the stone age the latter part of this year, but saw tonight that the new release of Mambo (version 5) is going to be powered by CakePHP. Wow! Interesting move. If you do not know this, Joomla! used to be Mambo and a lot of the Joomla! version 1.0.x code is still like mosMainBody or mosLoadModule. mos as in Mambo Open Source. That was until there was some serious disagreement about corporate influence by the company who funded and founded Mambo, Miro International. You can read more about that saga here. Ever since the fork between Mambo and Joomla! it has been Joomla! pretty much all the way for me.
What is kind of strategic interesting is that Mambo nr 5 will be powered by a great (Open Source) PHP MVC framework called CakePHP. I’m undoubtedly a Code Igniter fan, but Cake, although more complex/heavyweight, is a pretty good MVC framework! So I think this is a very clever/sensible move on Mambo’s side. Joomla! 1.5 reinvented the MVC wheel by developing their own MVC framework for developing plug-ins. This means that although you have been developing Joomla! components up to now, you will have to learn the MVC side of 1.5 from scratch if you want to use it.
Mambo users, both old and new can start playing with CakePHP and get a feel for how it would work in Nr 5. They might even win a couple of new supporters with this move to CakePHP. I’m dead sure the old supporters would not mind either as the API was starting to feel a bit outdated anyway.
I know this goes without saying, but it is less obvious given the nature of how Cake works, and that is whether existing Mambo components would be completely backward compatible. I suppose that would depend on how deep the Cake integration is going to go. It would be suicide to throw away all the existing component code! Thats a no-no. Then again, as I said, it goes without saying! Joomla! 1.5 has its own new MVC built in with funky ways to do new components, but they made damn sure they cater for existing ones to some extent. Lets see how Mambo handles it.
What would be interesting to see is whether Mambo would be powered by Cake or whether Mambo would become a CMS built for Cake…

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
PHP, Software Development, web development Stii
Nov
05
Apart from the free Sitepoint book (which expires soon! So hurry up and get it) and the book “Agile Web Development with Rails” you have to bookmark Railscasts. Railscasts is an extremely useful resource with screencasts of how to get some pretty awesome things done in Rails. There is currently 78 casts on various specific topics and every single one is more useful than the next. I really enjoy it and I honestly love the idea of watching how to get things done while at the same time it is explained in detail. Check it out:

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
Ruby (on Rails), Tutorials Stii
Recent Posts
My Posse
Filed in
Past Stuff
Meta Stuff