NinjaBoard Countdown to launch: Day 6
Follow up:
And to show you why the code reduction is so dramatic, we'll show you the code for creating the category view head to head.
Category view NB 1.0 vs 0.5.3
0.5.3 Does both the categories and the category view in the same file, so we've stripped out the code for categories view in this comparison to keep it fair and square. 1.0 Use two files for the category view.
NinjaBoard 0.5.3
/administrator/components/com_ninjaboard/views/category.php
Lines of "real" code: 81
NinjaBoard 1.0
/administrator/components/com_ninjaboard/views/category/html.php
Lines of "real" code: 12
/administrator/components/com_ninjaboard/views/category/tmpl/form.php
Lines of "real" code: 19
In total: 31 Lines of "real" code. That's not even half! And if you pay attention to the screenshots, you'll notice we've got a much neater state toggler, and that's been added while reducing code.
As a developer I was starting to get used to the general rule for joomla extensions that you can't have both. You can't add features without adding code, and you reach the limit on how much code you can remove without removing features or important code pretty quickly.
I'm still getting used to the other side of the river. As you can see here, you can have both. How cool is that?
Thanks for reading, don't miss day 5





5 comments
How are you pitching NinjaBoard to people familiar with Kunena, phpBB, and other popular forums used with Joomla? How do they stack up, in your view?
THe only reason Joomla! 1.5 doesn't have it turned on by default is its PHP 4 support.
Neither we (since pre summer) nor the Nooku Framework supports PHP 4 any longer, so MySQLi isn't really an issue.
Again, if you got PHP 5, you got MySQLi. Turning it on is as simple as adding the "i" in your global config database type setting ;)
It's difficult to compare NinjaBoard with other Joomla boards as it's so very different from them. The others still got php 4 support, so they can't take advantage of what php 5.2 got to offer.
Since NinjaBoard is using Nooku Framework, it's the most secure version of NinjaBoard. Thanks to auto filtering and escaping, partly because of MySQLi, you don't have to fear for SQL injections or other security issues that could compromise your database.
NinjaBoard is also incredibly easy to extend, hook into, or override for that matter, also as an direct result of using Nooku.
And finally, unlike Kunena and Agore, we're not using jQuery. We're using Mootools, meaning you'll get no potential script conflicts or two javascript frameworks loading. So NinjaBoard is because of things like this, also the fastest and most lightweight board.
Next monday you wont have to take my word for it, you'll get to try it yourself and see how it stack up ;)
In extreme cases, like here, Nooku framework can indeed reduce your code by that much.
The Nooku Framework by itself alone could have more lines of code than joomla for that matter. The important thing to notice here is that it reduce the extension code the most.
So if you got just one extension using Nooku on your site, the combined lines of code in the component + the nooku framework might be more than if you used joomlas framework. But since the code in Nooku is much smarter, the code in the actual extension is very little.
And the lesser code you need to get the job done, the fewer bugs, issues, bottlenecks and security leaks ;)
Thanks for posting this comparison.
James
Mango Tree Media
Learning Nooku only took me a couple of days actually. It's very easy to learn.
Two reasons why:
1. Nooku fw is very intelligent, so things like pagination all works out of the box with 1-2 lines of code. Lesser code to write is lesser code to learn :).
2. It's compatible with Joomla apis, and share similarities like MVC and such. So you're coding much in the same way as before, only fewer lines of code, and easier to use apis.
So for someone comfortable with the core joomla! framework, learning nooku fw is more about forgetting than relearning ;)
The documentation is constantly improving as there's now an wiki available, there's an API site similar to Joomlas and developers using NFW are encouraged to write blog posts and more helping others in how to use NFW :)
We got code samples on the wiki, and every time an api is added or updated/changed, the mailing list is notified of it and you're given code examples showing how to use it.
The B.E.E.R extension is also always up to date with the latest code changes making it easy for you to stay current.
I highly encourage you to request code access so you get access to the wiki and mailing list in order to find out more about NFW. Also worth mentioning that the developers on the mailing list are very helpful when you get stuck, always very patient with you and supportive :)
http://www.nooku.org/en/framework/request.html
Cheers,
Stian
Leave a comment