Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Does anyone know of a good primer on (oo) software design?
5 points by haliax on Oct 22, 2009 | hide | past | favorite | 2 comments
Hi HN,

I've been programming for quite some time now, and like to think I'm pretty decent at it, but of late I find myself having trouble with creating classes, it's not that I can't break a problem down into classes/methods, it's that the result doesn't seem...elegant at all, and I often have trouble finding clean ways to express interfaces for the groups of functionality I need. Does anyone know of a good set of principles on the subject? Am I just being OCD?



It is quite likely that you're hitting the boundaries of what straightforward class-based OO alone can do to help you structure the program. Design patterns help if you don't know about them, but even better is to look at a wider range of concepts(examples: functional programming, logic programming, message passing, formalized finite state, and my current subject of interest, relational data structures) and attempt to mix some aspects of them into your code.

If computer science is at heart a mathematical subject, then mathematics informs us that the best way to make a solution more elegant is to restate the problem in a more suitable form.


Maybe the problem you've struck is that of the limitations of OO itself. Objects and methods only work up to a point. You often also need to implement behaviors/processes/algorithms. In a multi-paradigm language, such as Python, you'd implement the objects with their behaviors using OOP paradigm and then tie it all together using FP paradigm.

Lots more details: http://www.artima.com/articles/dci_visionP.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: