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

[eluser]John Fuller[/eluser]
That is good that you found all those bugs. I get nervous if the system I am using is too clean. And anyways, if I were given a perfect framework I would just add a boatload more bugs with my own code. I'm silly like that though, you give me cologne and I will pee in the bottle before I actually wear it anywhere.

I'm glad you got paid to find problems. That is a much better story than getting paid for three months just to tell your employer that CodeIgniter is great and you didn't make any changes. With three months of paid time to do something you can find problems with anything. Hell, with that much time I could probably find a pimple on the a** of Angelina Joe Lee (or insert the name of any other chick you might think is perfect.) I don't even think Rick took that long to build the thing and he wasn't even paid for it!

There is one thing I don't agree with though...

Quote:If your sites are using PHP 4, that’s fine, no need to upgrade, move to a different server or refactor the code. But if you are still developing using version 4, that’s very irresponsible and unprofessional, considering that you are selling to your clients a software developed using an obsolete technology.

That logic suggests that the business practices of EllisLab is irresponsible and unprofessional. Of course we know that statement to be untrue because no argument is greater than that of success. And I think even the greatest of pessimists (the cup is half full types of dudes) can agree that EllisLab is a success. But that is why they paid you to write the code rather than run the company, we developers often get our heads too much into the code and can't see the larger picture.

My biggest question is, why didn't you just use the Zend Framework? The unit tests are already written, the framework is basically ready to be molded into whatever you want it to be and at least you might have had components that were untouched which could be upgraded somewhat independently without having to go through the entire system again with a fine tooth comb. I imagine going through an update of CodeIgniter will be much easier now but the Zend Framework is much more modular out of the box.

In any case, thanks for posting the info. We love CodeIgniter, we love our community and by extension we love you too. :kiss:

As has already been mentioned, the system is young. Both CodeIgniter and ExpressionEngine are in their first versions. ExpressionEngine 2.0 actually appears that it will be released on a stock version of CI so no big rewrite for the framework there. Maybe your concerns will not even be addressed in the next version. I do think we can all agree that having a better system to talk about problems, extensions, bugs and hurt feelings would be groovy though.

Good stuff.
#32

[eluser]Sarfaraz Momin[/eluser]
Trust me I migrated to CI just because it supported PHP 4. There are so many frameworks which have been existing much before CI was even thought about. They all support PHP5 only from their roots. This makes the life of developers who cannot migrate to PHP4 a little difficult. My clients were not in any sort of mood of migrating to PHP5 any sooner. They wanted me to write the most optimized code with better managebility but it had to be with whatever is available. PHP4 was in picture and I have lack of options. Luckily I found CI and today even if I get to work with the most recent version of PHP and Mysql I would go with CI as the first option until the client thinks otherwise. I do not understand people thinking what they want for themselves when they should think what the community wants since the framework is for the entire community.

Please contribute to make this better instead of just asking for things which would force many developers to think differently.

I am sure with CI 2.0 the coolest guys at Ellislab would come up with something which would make CI another language to select rather than just a framework.

I just cannot think writing PHP code with CI in picture (ofcourse until situation demands one).

Good Day !!!
#33

[eluser]Pygon[/eluser]
son of a .... I had quite the reply written out here, and apparently the forum decided it didn't want it (or it was too long?)

So I'm going to start of with just my answers for your list:
#34

[eluser]Pygon[/eluser]
Just a note Buda -- I hope you're aware that these are your opinions of shortfalls in the framework. I have opinions too.

Quote:1. 90% of the system is written in PHP 4, a deprecated version of the language.
As discussed, PHP5 is not the only version of PHP in use by companies. Claims that anyone developing in PHP4 are irresponsible is a complete falacy. I guess you just turn away any clients that come your way REQUESTING something written in PHP4 because they aren't in a place to update their systems to make *you* happy (though TBH I wouldn't be suprised if you said you did).

Quote:2. The framework doesn’t have a Front Controller. Strangely, the application controller becomes the Front Controller, this means that the framework can only load one controller at a time (per request).
I think this is what it should be. A user takes ONE action, which is mapped to ONE controller, which is provided by ONE request. The perception of multiple actions doesn't translate to HTTP.

Quote:3. The CodeIgniter/CodeIgniter.php file is not a class, it should be part of the bootstrapper file, index.php.
I'm not really sure how you want to weigh heavily upon code maintenance and re-usability, yet are just fine with having multiple copies of the same code thrown into seperate bootstrap files. You do realize that you can use multiple applications on the same CI codebase and only need to lightly modify the bootstrap which will in turn re-use this code, right?

Quote:4. MyController > Controller > CI_Base. There’s no point of having 3 levels of inheritance. The only purpose of CI_Base is to return a single instance of the Controller, so it should be part of the Controller.
This falls back to your issues with people using PHP4; multiple CI_Base objects are required because multiple versions of PHP are supported. This is necessary, unless you want more wasteful code like you do in #3.

Quote:5. Namespaces: The Controller class doesn’t follow the naming convention, it’s not prefixed with CI_ like the rest of the core classes. This makes CI’s namespace support very unreliable.
This is debateable. I understand your opinion on this, but I also realize that models and controllers are *products* of the framework, not part of the framework.

Quote:6. The application controller acts as a Front Controller and Registry, it’s used to stores all the objects the framework needs.
This is just utterly wrong. The CI global object does this.

Quote:7. Circular reference: When the Front Controller (App. Controller) loads a model, the framework assigns to the model all the object properties of the Front Controller. This is the most obscure behaviour I found in CI.
Wrong again. Seriously? When a model is loaded, it inherits a reference to each of the CI global objects loaded libraries, allowing the framework objects and methods to appear locally in both models and controllers and allowing us to use $this->object->method rather than declaring "global $CI" everywhere and calling $CI->object->method.

Quote:8. The router.php file contains an array that uses the keys to store data and define regular expressions. If you define 100 elements, the Router class will loop through the entire array, extract the keys and execute 100 regular expressions.
I can't really argue with this one, and most of us are probably in agreement that there should be a better way.

Quote:9. Common.php is not a class, it should be moved to the helpers/ directory and renamed to something more appropriate, like mvc_helper.php for example.
Common functions are required for the framework to operate, "helpers" are not.

Quote:10. Very poor OOP and almost no design patterns makes this framework very difficult to extend and maintain.
I've seen some bastardized implementations of Zend and other frameworks too -- it doesn't mean that they were any more or less "MVC" or pattern-friendly.


Honestly, it really doesn't sound like you took an *objective* approach to this framework. Your pre-conceived notions as to how things should work and some of the response have the air of the elitest programmer mentality ("What I think is right, period" type of view). Statements like "but if you are still developing using version 4, that’s very irresponsible and unprofessional" are themselves irresponsible and unprofessional. I might *suggest* that a business owner consider an upgrade to PHP5, but that's the end of it. If they aren't in a position, far be it from me to be an elitest prick of a programmer and tell them, "then you're shit out of luck and need to find someone else". Is this what you do, or are you "irresponsible and unprofessional" when the job calls for it?

Seriously and not to be an ass in any way, it sounds to me like you're the type of person who only thinks *your* opinion is the right way to do something. I'm also going to go out on a limb and say that you're probably of the opinion that PHP wasn't a "real" language until it got the object polishing of version 5..

I hope you're not like that, but just so you know, that's how you sound (in my opinion).
#35

[eluser]John Fuller[/eluser]
Pygon, I am glad you figured out the forum.

I agree there are things that can be done better.

But many of those things really don't fit a statement such as "abnormalities which we must all know about." I think others were just piling on before they had their morning coffee.

#1 is beating a dead horse. We have had this discussion countless times in this forum and it is a non point. The PHP developers can deprecate PHP4 but that means jack in the real world. Thank you for pointing out that CI uses PHP4 by the way, I'm sure most people here have not figured it out already.

#3 is nitpicking. Did you throw this one in just to make a round number?

#9 See #3 (or maybe you are misunderstanding what helpers are meant for in CI)

#10 PHP4 itself is poor for OOP. And some of your other points are related to the problems in PHP4 forcing design decisions which are probably not ideal. Oh well, it is not my job to maintain the framework. Wink

Again, I think we can all agree there are things which are not ideal and I'm sure there are plenty of bugs which have not been fixed (in every piece of software on this solar system.*) Show me a framework which has 100% agreement on all decisions for the user base. This is what makes the Zend Framework a great option. You take what you want and leave the rest.

*Leaves open the possibility of an alien race on another galaxy which has figured out how to write bug free code. This would be great because I would hate for a bug to botch up a good anal probing. That's something you hope just goes smooth the first time. You don't want for them to have to call in the engineering team right in the middle of the process.
#36

[eluser]wiredesignz[/eluser]
This discussion is getting rather absurd and far too emotional.

Any decent developer who has studied the CI core will realise it's shortcomings, but the fact remains that CI works, it is fast, easy to learn, and easy to use.

I wonder why the OP felt the need to start this thread, it serves no real purpose for this community. (regardless of wether he/she thinks so)

I would rather see him/her post some positive contribution for CI instead.
#37

[eluser]xwero[/eluser]
To make the best of this thread. What would be a better way to have custom routes?

edit : Wiredesignz did you read my answer before i send it Wink
#38

[eluser]wiredesignz[/eluser]
Great minds think alike xwero :lol:
#39

[eluser]John Fuller[/eluser]
[quote author="wiredesignz" date="1205808775"]This discussion is getting rather absurd and far too emotional.

Any decent developer who has studied the CI core will realise it's shorcomings, but the fact remains that CI works, it is fast, easy to learn, and easy to use.

I wonder why the OP felt the need to start this thread, it serves no real purpose for this community. (regardless of wether he/she thinks so)

I would rather see him/her post some positive contribution for CI instead.[/quote]

Wha? What would a thread be without emotion! You are talking about developers, a very opinionated bunch of people. And anyways, it gives me a chance to pull out my adolescent jokes.

Pointing out bugs is... if you can share them. To start a thread saying you found a long list of bugs but you can't say what they are because the bug fixes belong to your employer is a bit ridiculous. Why bring them up in the first place? The bugs are important, everything else is just commentary.
#40

[eluser]wiredesignz[/eluser]
Quote:The bugs are important, everything else is just commentary.

Absolutely agree, I could not have said it better Wink




Theme © iAndrew 2016 - Forum software by © MyBB