Development Cost of Procedural Programming vs. OOP

2019-03-15 13:45发布

I come from a fairly strong OO background, the benefits of OOD & OOP are second nature to me, but recently I've found myself in a development shop tied to a procedural programming habits. The implementation language has some OOP features, they are not used in optimal ways.

Update: everyone seems to have an opinion about this topic, as do I, but the question was:

Have there been any good comparative studies contrasting the cost of software development using procedural programming languages versus Object Oriented languages?

Some commenters have pointed out the dubious nature of trying to compare apples to oranges, and I agree that it would be very difficult to accurately measure, however not entirely impossible perhaps.

9条回答
混吃等死
2楼-- · 2019-03-15 14:43

Good idea. A head-to-head comparison. Write application X in a procedural style, and in an OO style and measure something. Cost to develop. Return on Investment.

What does it mean to write the same application in two styles? It would be a different application, wouldn't it? The procedural people would balk that the OO folks were cheating when they used inheritance or messaging or encapsulation.

There can't be such a comparison. There's no basis for comparing two "versions" of an application. It's like asking if apples or oranges are more cost-effective at being fruit.

Having said that, you have to focus on things other folks can actually see.

  1. Time to build something that works.

  2. Rate of bugs and problems.

If your approach is better, you'll be successful, and people will want to know why.

When you explain that OO leads to your success... well... you've won the argument.

查看更多
冷血范
3楼-- · 2019-03-15 14:47

The key is time. How long does it take the company to change the design to add new features or fix existing ones. Any study you make should focus on that area.

My company had a event driven procedure oriented design for a CAM software in the mid 90's created using VB3. It was taking a long time to adapt the software to new machines. A long time to test the effects of bug fixes and new features.

With VB6 came along I was able to graph out the current design and a new design that fixed the testing and adaptation problem. The non-technical boss grasped what I was trying doing right away.

The key is to explain WHY OOP will benefit the project. Use things like Refactoring by Fowler and Design Patterns to show how a new design will lower the time to do things. Also include how you get from Point A to Point B. Refactoring will help with showing how you can have working intermediate stages that can be shipped.

查看更多
We Are One
4楼-- · 2019-03-15 14:48

Most all of these questions are confounded by the problem that individual programmer productivity varies by an order of magnitude or more; if you happen to have an OO programmer who is one of the gruop at productivity x, and a "procedural" programmer who is a 10x programmer, the procedural programmer is liable to win even if OO is faster in some sense.

There's also the problem that coding productivity is usually only 10-20 percent of the total effort in a realistic project, so higher productivity doesn't have much impact; even that hypothetical 10x programmer, or an infinitely fast programmer, can't cut the overall effort by more that 10-20 percent.

You might have a look at Fred Brooks' paper "No Silver Bullet".

查看更多
登录 后发表回答