Friday, April 13, 2012

Day #5 of a #30 day startup


Lesson learnt today: Coding involves learning something new on a regular basis. Again this is something we constantly re-learn, it's what makes coding so fulfilling. The downside is spending hours finding out how to achieve something, that should really only take a few minutes to accomplish. At least the next time, the task is done quickly and effectively.
The functionality of the site is getting better - but there is a lot yet to be done. I won't be posting here over the weekend, but no doubt I'll be looking at the code at some point.
Cakephp finding: Here's something I didn't previously know and has re-kindled my love for the cakephp platform - the counterCache behaviour. In my case it automatically updates the comment_count field in the parent table with the aggregated sum of related comments in the child table. This will save a lot of database calls to bring back number of comments against a posting. And the only code to implement this goes in the Comment model - 'counterCache' => true . Fantastic! (it's described in the Cakephp cookbook )

No comments:

Post a Comment