Welcome Guest, Not a member yet? Register   Sign In
10 abnormalities in CodeIgniter that everyone should know
#11

[eluser]Référencement Google[/eluser]
There is too much Bla bla bla here. If you really make improvements, then post the code that you said you have improved or open a CI's fork website so you can post there your full remastered CI. Once we see code then we also can discuss better.
#12

[eluser]Buda[/eluser]
[quote author="elitemedia" date="1205595570"]There is too much Bla bla bla here. If you really make improvements, then post the code that you said you have improved or open a CI's fork website so you can post there your full remastered CI. Once we see code then we also can discuss better.[/quote]

If you want to see the code, download the framework, it's all there. The info I posted will help you find this issues. For example:

Design errors

Loader.php, line 177
Code:
$CI->$name = new $model();
$CI->$name->_assign_libraries();

That's when all the core libraries are assigned to a model, one of the most obscures behaviours I've seen so far.

CodeIgniter.php, line 97
Code:
if ($EXT->_call_hook('cache_override') === FALSE)

Some methods are prefixed with the private/protected underscore, but called as if they where public methods from anywhere. By doing this, developers cannot relay on the naming convention of the system, making the API almost useless.

Base5.php, line 55
Code:
function &get;_instance()

This file mixes a class with a function. That's is wrong, but worst is Base4.php:

Base4.php, line 41
Code:
class CI_Base extends CI_Loader {

The Application Controller extends the Controller class, which extends the CI_Base class. Now, normally applications don't have 3 levels of inheritance, but Base4.php goes a step further and extends a 3rd class, CI_Loader, that has nothing to do with the Application Controller itself.

Coding errors

Code:
class_exists('CI_DB')

I found a lot of coding errors, for example, the use of class_exists() function, where the second parameter is missing. This is a mayor bug in CI. Then, the unnecessary use of inlcude() instead of inlcude_once(), and more.

I hope that helps, good luck.

Buda
#13

[eluser]Buda[/eluser]
[quote author="elitemedia" date="1205595570"]If you really make improvements, then post the code[/quote]

I was hired by a company to perform a code review and refactor the framework. Everything I did with CI belongs to my employer and I'm not planning to post any of my employers code, that goes against my legal responsibilities.

I'm not here to talk about other frameworks or to debate about architectural or software development issues. I'm here to post some CI related issues, some people might find it useful.
#14

[eluser]xwero[/eluser]
@Buda : I like your look at the framework but i found thurtings answer a bit condescending. that's why a reacted a bit sharper than i normally do. i think your analysis could open the eyes of the people at Ellislab because you really took the time to find out if CI is a good framework to base all other code on. I can only applaud you for sharing your knowledge.
#15

[eluser]ScottR[/eluser]
Buda is spot on across all 10 points. I experienced the exact same limitations and had to code in my own solutions whilst trying to leave as much of the core in-tact. I wasn't aware of Kohana, does Kohana allow more modular controllers as buda mentioned as that was the main issue I had to solve.

Also will kohana last, CI is after all backed by a company entity.
#16

[eluser]nmweb[/eluser]
Buda, can you give us pseudocode or an outline of how you handled the Frontcontroller? I'd be interested in seeing your approach. On the ten points you raise, I must say I agree with you on basically all of them.

I must admit that I enjoy Kohana a lot nowadays and I'm confident it will last. CI might be backed by a company but I don't think this has reflected on the codebase the last year or so. The last two releases didn't solve the major issues I had with CI and when I look at the recent SVN history it's mostly typofixes in the documentation. Compare that to the Unit Testing module added to Kohana only days ago. I'm confident though that with the release of ExpressionEngine2.0, development for CI will pick up.

CI for me has certainly opened up my eyes for proper web development but honestly I have moved on to more advanced code and CI held me back. However, I could not have done it without CI and I wish it all the best in the future (the jQuery library Derek showed off somewhere looks really neat)
#17

[eluser]ScottR[/eluser]
So i'm guessing (from your post nmweb) that kohana doesn't solve the frontcontroller issue either then?
#18

[eluser]nmweb[/eluser]
The frontcontroller stuff and thus dispatching is handled by the Kohana object. This object cannot be extended but you could override the initiating of the 'frontcontroller' by changing the event that calls it and thus use a front controller you wrote. Also, it's easier than in CI to call another controller's method. It would be my preference to move dispatching out the core, though.
#19

[eluser]Michael Ekoka[/eluser]
Buda, thank you for the time you took to share your analysis. CI is a fine project and it has helped a lot of budding developers to get acquainted with best practice, me included.

However, after the original dazzle has settled, we get comfortable with the framework and start pushing it to do fancy stuff and hence begins the real stress test. I have to agree with all 10 points that you made, although for political or commercial reasons the first can be argued.

I have learned to appreciate the elegance and simplicity of CI's approach to solve some problems, but I have also had my share of concerns with its limitations and some of its architectural choices. Your points about the Front Controller and the Registry are amongst the most valid.

Some additional personal grips that I've had include:
- the lack of modularity (please make Zacharias Knudsen's library either official or obsolete).
- the validation callbacks inside controllers rather than inside a third party class. Each time I have to copy/paste a callback method from one controller to another I cringe.

The choice to build ExpressionEngine 2.0 on top of CI is an awesome step. It would also have been a great opportunity to depart from php4, but I have the feeling that it will not be so. I intend to keep using CI because it has a lot of potential in the future, but I need to keep some reserve. In the recent weeks, I have been looking at other frameworks that can better suit my needs (Zend is looking very good to me at the moment). As much as many of my CI brethren are taking an antagonistic position toward your post, lets not fool ourselves. CI, just like its community, is relatively young and the best way to improve it is through input from tried and tested alternative approaches.

Your analysis seems based on first hand experience with other projects that have an architecture closer to your ideal. I'm curious as to which framework you would consider to build on top of if you were given the choice.
#20

[eluser]sikkle[/eluser]
Buda :

To keep it short, don't blame Codeigniter to stay at php4 just because you don't appreciate that. This is a choice, i'll also say that you will find a lot of framework on the web who handle php5 just right, more than some handling php4.

So let's be honest, they write [ requirement : PHP version 4.3.2 ] or newer. so don't be surprise.

I also not turn this thread on kohana stuff, but mostly on php5 stuff, i also use symfony, and when you'll be honest and objective you'll see that you will prolly have to re-build a part of ALL framework to make you happy with them.

This is part of the cycle of programming world. The same damn process will explode when php6 will become a "50% standard".

btw my wife is not perfect either.

see ya around




Theme © iAndrew 2016 - Forum software by © MyBB