Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialandy parker
1,398 PointsWouldn't it be better practice to create an entirely new class for date formatting?
It would seem to me that the need for format dates is something you are going to do an awful lot of. With that in mind would it not be better to abstract this further into its own class instead of adding it to BlogPost? then you could use it over and over and possibly in other projects?
1 Answer
kerdeseverin
9,688 PointsYes thats a good approach and you could possibly have other methods in that class. Remember that treehouse is supposed to teach persons of all skills, so they won't tell you all these things. They try to keep it simple. Its up to you when you start coding to notice these things and make your own efficient implementation.
andy parker
1,398 Pointsandy parker
1,398 PointsI understand the point of training people will all levels but surely if you teach somebody how to write efficient code from the off, they wont be having to untangle bad habits once they start doing it full-time?
kerdeseverin
9,688 Pointskerdeseverin
9,688 PointsI agree with you, but it happens. Even in many books you read, when you get more advanced and experienced you realize most of the way they explain things could be done a lot better. I think its a challenge for them to keep it simple while not confusing beginners.