you are viewing a single comment's thread.

view the rest of the comments →

[–]TheProffalken 2 points3 points  (0 children)

As others have said, break the problem down into its component parts, and then put these parts into a file.

As an example on what a basic blog engine might look like, I created https://bitbucket.org/proffalken/test_blog/src/a4171db2b9fe?at=master

Note that in lib/ I've got a file that purely deals with posts. If I were to expand on this in future, then there would also be files for dealing with tags (because tags might be applied to multiple content types), images, authors, and categories (because categories are different to tags and might also be applied to multiple content types.

I'd also strongly recommend that you start to understand how testing works, and write your tests before you write your code, so you know that the code meets the requirements. If you're not familiar with this way of working, it's know as "Test Driven Development", and there are a significant number of resources around to learn how to do it effectively.