Jump to content
Larry Ullman's Book Forums

Recommended Posts

Just a quick question,


When you finish part 2 of the book, would you say that there is the point where everything you are going to cover regarding the creation of a fully functional website with yii is finished. Much as I want to read the whole book first the practice website i've been building has been great through these chapters. But i'd like to maybe start a more production version. I just don't want to start it prematurely and find that I've been doing something wrong and have to redo everything. 


For instance, had I started a couple of chapters ago, I'd have been doing all the $dataProvider stuff wrong and lost all the built in functionality.


Looking at the TOC I only really see as Chapter 17: Internationalization and maybe Chapter 19: Advanced Database Issues as a possible area that I may approach wrongly. However i'm not sure how easy it would be to undo any areas that i've approached poorly by Yii standards.





Link to post
Share on other sites

I'd say by the end of Part 2, you'll have about 75% of the information you need. For some sites, that aren't too complicated, it might be closer to 100%. There's a chapter in Part 4 that's good "get it out the door" information, but that shouldn't affect the early process. Caching and improving performance will be important, too. 

Link to post
Share on other sites

I would start building. Get the framework under the skin. No matter how much you read and understand, you need to code to make it all stick. Progressively improving your projects will help you understand the framework. You'll get realizations along the way you would not get otherwise.


CodeIgniter is a very simple framework in comparrason to YII. However, there's no doubt I utilize it better and write cleaner code after half a year of utilizing it. I have a better understanding of where to place my code, how to write modular and framework-independent components (that I could utilize in YII later on for example) and structures. As an example, I have components for things like Image uploading, file conversion, thumbnail creation, random generators, date conversion and other stuff I could use in other projects later on.


You'll never do anything 100% the first time anyway. I would read up on things like agile development and Scrum. It'll help you to understand how to incrementally set goals for yourself and build applications one block at the time. Such theory is also very important in the business if you want to do that.


Good luck, Jonathon. Keep us posted.

Link to post
Share on other sites

Hi Thomas,


I'll definitely keep building. This practice one has been so much help in terms of putting ideas into practice and expanding them. It's also made me write processes that haven't been explicitly covered in the book. So I'll keep with this one for a while, then look to start a fresh.

Link to post
Share on other sites

I can't really make an deep judgment on that, but I'll provide you with some thoughts.


CodeIgniter: Simplicity has obviously been a priority during the development of the framework. It's very easy to get started utilizing the framework, and general functionality is easy to implement. The framework has a lot of helpful components and helper classes that will make your development cycle easier. The framework is extremely fast, even without caching.


You can alter the framework's core by extending it, and it's easy to add helpers and components to controllers that need it. If you want something up and running quite fast, CodeIgniter can surely be a good choice. I would say it can be a good match for smaller projects.


However, it's really starting to show it's age. CodeIgniter is compatible with versions of PHP 4, and not really object-oriented in itself. Important parts of the utility classes (validators, filters, sanitation) does not support Unicode. The MVC pattern is very loosely practiced. While that may sound nice, it can lead to clutter for inexperienced developers as they place code the wrong places. It's also really bad as you can't depend on an interface (like YII's validate, rules, etc) in most cases.


The framework has also some weird quirks, such as instantiating objects from components when including the classes. They really like to do a lot via the application object. This requires you to look at the User Guides more frequently than you should need to, as you need to pass a lot of arguments you can't remember from time to time. Most is passed around using arrays, and methods often return false on errors. Exceptions is non-existing. This leads to a lot of type checking logic that is not really needed. This is huge problem in my personal opinion.


Laravel is supposedly a framework developed by the core team behind CodeIgniter. It tries to solve some of the problems listed above. I've yet to try it myself, but that they felt a need to build a new framework is proof enough for me that CodeIgniter has some obvious flaws. I would not hesitate to recommend CodeIgniter to a friend, but I would really encourage them look around a bit first. There's obviously newer and better things out there, YII being one of them. That's my semi-conclusion.


The reason I chose CodeIgniter was that I knew it. I had one semester at school to develop something as a one-man team. I did not really feel I had the time to learn a new framework. Doing everything from server administration, designing, front- and back-end development and releasing the website in four months left me without time for that. I will definitely look at other frameworks when a new project arises.

Link to post
Share on other sites

Thanks for the info on CI. The PHP 4 compatibility is the reason I never touched it. 


I had not heard that Laravel came from (or by the same people as) CI. I've heard nothing but greats things about Laravel but haven't touched it myself.


FWIW, Yii is by a core developer of the Prado framework. Seems to be a lot to be said for getting it right the second time around!

Link to post
Share on other sites

Yes, I really see that. It's also the reason why I won't consider building something new in it.


Please don't quote me on that btw. I tried searching to provide some proof of that claim, but I couldn't find any. However, information like that sticks to my brain like glue, so I'm sure I've heard it from a source I trust. That does not mean it's true however, although I think it is.


Thanks, Edward. I don't care so much as long as I'm understandable, but I try my best to write decent when convening a point objectively is important. I think my written language generally suffer a bit in quality as quantity is a more important factor. I don't always take the time to ensure the language is perfect as long as it's acceptable, and therefor I like to keep it simple. Cool that you notice when I make an effort. :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...