A Highly Maintainable Design is a Key for coding

原创
2015/08/02 11:00
阅读数 77

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

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部