News for hackers. Stuff that matters.

Ask HN: How do you design/refactor your web app code (not frontend/UI design)

When I took CS software eng. class back in the day, we used to get assignments where the first part would be to just submit a design. In other words, just a skeleton of the classes, methods etc (primarily did Java/C++ back then).

We were taught that anything that is a "noun" would usually be a class and anything that is a verb would be its methods. More or less. Of course, it is just a guideline and not carved in stone.

When creating web apps, do you use this methodology at all ? I like to do a skeleton design first and then put the actual code later. For example, the easiest one would be the "User" object. User is a noun, a user has username,password etc. What else ?

( 2 comments | on HN )
Re:Ask HN: How do you design/refactor your web app code (not... by jeremyx on Wednesday December 12, 2012 @11:34AM (#4910939)
If you are using a good web application framework, you'll be creating classes and engaging in standard OOP. The framework should abstract away the "webness" of the application.

See ASP.NET, GWT, RoR, etc.

Re:Ask HN: How do you design/refactor your web app code (not... by codegeek on Wednesday December 12, 2012 @11:37AM (#4910959)
Certainly. I should have mentioned earlier about frameworks. I am using Python Flask framework already.