码迷,mamicode.com
首页 > 其他好文 > 详细

A Highly Maintainable Design is a Key for coding

时间:2015-08-02 11:58:06      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:

If we get used to the OOP, we know that it often mentioned the concept about "Reusable", actually that bring different layers of meanings about software design, one could be, if it‘s reusable, then we will be able to use it in new software with less effort.

I think the real problem for a coder, is that, we have developed some software, and changes always happened, whatever it‘s a upgrade, a new feature request, or sometimes we move it for another use, we will have to change it for that case.

To change existing codebase, could be a nightmare, if it‘s complex due to a large amount of code, or bad design. The reason is quite simple, if the code isn‘t well designed for maintenance or flexible enough for different use, then changing the codebase, could break the logic of the system design, thus it will bring more uncertainty of it, usually means more bugs. Because of the uncertainty, we could trap in the bug loop, fixed one, brought another, and forever, the worst is, the whole changes bring the software to a wrong direction, eventually to fix it isn‘t an option for cost.

As a coder, I really dislike to waste time on maintain codebase when it‘s bad for maintenance, it‘s like someone is pushing you into a puzzle map, you just see a bit clue around you, but never get to know the whole picture of it, the long time lonely walk certainly will kill our patience, especially when someone is there call us out, and whipping us into a stressful state for reporting progress. Unfortunately, that usually happened as what a project owner cared is the progress, progress means cost, cost means money, now we know why.

But as a coder, to write a software, we take the maintainability to be the first case of all, could help us to write better software, maintainability isn‘t really as same as "Reusability", as maintainability is all about the caring of ourselves, its more like a special healthy care insurance for coders, if we have it done, we will be benefit on it for a long time.

Also to write a better maintainable software, is also pushing you to think it more, and choose a better solution, could forcibly bring your speeding race slow down, having a cup of tea, ease your mind, and then focusing on the problem, get the solution, it will increase your lifespan, seriously, we all know a high speed spinning gear will be less lifespan, so do our organs.

There could be a lot different ways to write a better maintainable software, whatever its OO, or not OO, the key is, thinking more about it.

To have fun with it, I considered how to maintain a database design more easily, and I wrote a small NodeJs code to generate SQL from OOD style description of database design. Take a look, it might still work or not.

The idea is to use plain text to describe the database table and its relationship by OO methodology, and generate different SQL create scripts for different SQL server.

https://github.com/hellomaya/db-test/tree/master/oosql

A Highly Maintainable Design is a Key for coding

标签:

原文地址:http://my.oschina.net/hellomaya/blog/486605

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!