The Cost of Code?

代码成本与项目成败
本文探讨了代码成本如何成为项目失败的关键因素,并提出降低代码成本是提高项目成功率的有效途径。

代码成本

昨天在#SCNA(北美2010软件技术大会)的一个专题小组讨论会上,@chadfowler 提出了这个问题:有多少项目是因为程序的原因而失败?我想,他的潜台词是,造成项目失败的主要原因是业务问题,而非技术问题。

今天早上我把这个问题发布在了微博上。很快就有了回复,几乎所有人都认为导致项目失败的原因中业务问题是罪魁祸首。

完全没错,项目会因为成本,需求,进度计划,管理等问题而失败。可同样没错的是,从来没有人在追查失败的原因时会深入到像程序代码这样底层的东西上。所以,Chad的观点—— 如果真像他想的那样——是有一定的参考价值的。
    我们可以从中得到结论:从长远的角度看,程序代码并不是那么重要,程序员的劳动也许只是些大量的些微小事。事实上,Chad#scna上的演讲中希望我们去认真思考这个问题。如果我们按照他的观点去做,我们就应该降低对技术能力的重视,增加对业务,需求,预算,计划和管理工作的重视。

在我反驳这个观点之前,我要说,我碰巧知道好几个因为程序的原因而失败的项目。事实上,我还知道几个因为程序的原因而失败的公司

相信和理解这种事情并不是难于上青天。我们都知道,当程序代码混乱时,它会变得越来越难以维护和改进。当这种成本超过了一个项目可以承受的能力后, 项目就失败了。当这种成本超过了一个公司所能承受的能力后,公司就倒闭了。在我知道的这些案例中,这些事情就是这样真实的发生着。很简单,就是代码的开销超过了它的商业模式的承受能力。

让我们在脑子里做这样一个推演。如果程序代码的生产和维护成本无限的昂贵,项目的哪部分会失败?很显然,由于程序代码过于昂贵,超过任何有限的商业模式的承受能力,所有项目都会失败。

那好,如程序的生产和维护不会产生任何的代价,那会怎样?项目的什么部分会因为这种程序而失败?同样,答案很明显。如果这种程序代码不会产生任何成本,没有项目会因此而失败。

什么叫做没有成本代价?就是说当你需要它时你唾手可得。程序已经在那里了,即时的,功能齐全的,没有缺陷。任何时候你想修改它,修改工作能立即完成,自动部署,马上生效。

就好象是你被强盗丢进了一个山洞里,在这个山洞里你发现了一个老式PC机,带着一个很老式的键盘。你拿起键盘,擦了擦脏兮兮的Enter键。哦,一个精灵出现在了屏幕上,它给予了你能够生产零成本的程序代码的能力!从这时起,还会有什么项目会失败?

你要明白,没有第二个人拥有你这样的能力。没有第二个人能即时的生产出没有缺陷的想要的任意程序代码。没有第二个人能够不费时间的修改和部署变更的程序。你拥有绝对的竞争优势。你还有失败的可能吗?我想我的小狗Petunia也许会弄失败,但任何比它聪明的生物都会因此而成为亿亿万富翁。

 

如果我们有了这台神奇的PC机,我们就不会再有进度计划和预算问题。管理失误和需求不确定的成本会趋近于零。所有会导致项目失败的因素都会变的无关紧要。

可是我们没有这样神奇的PC机。程序代码的生产和维护会消耗资金。但如果我能拥有这个神奇精灵的一点点能力,我就能降低代码生产和维护的成本,同时我还能降低由于管理失误、需求不确定、工期紧张或者预算紧张所带来的成本和风险。通过降低事情的这些成本,我们降低了犯错的成本,增加了成功的几率!

为什么项目会因为需求不确定、管理混乱、计划不正确、预算有问题而失败?是因为犯错的成本太高。为什么犯错的成本很高?因为程序代码的成本高的可怕。如果程序代码不会带来成本,犯错的成本代价也就会趋近为零。

这种认识在各公司中还是有共识的。他们试图通过压缩程序员来解决这个程序成本问题。他们冒着巨大的风险花大价钱从地球的另一边雇佣具有各种不同文化 的编程人员。他们面对着时区和语言的问题,文化的不匹配问题。而选择这一切都是为了降低程序的成本。他们这样做,是因为他们知道这种成本压迫着管理的成本。他们这样做,是因为这种成本会导致项目失败。

不幸的是,这种策略并不像我们希望的那样奏效。可能有些这样事情做的不错,但大部分外包的效果令人失望。于是程序的成本仍然居高不下,同样,失败的风险也高居不下。

再回到我们最初的问题上。有多少项目因为程序代码的原因而失败?根据上面的讨论,所有的失败都是由于程序的成本导致的。有多少项目因为程序代码的原因而失败?全部。

更重要的是,唯一有效的能增加项目成功概率的方法是什么?是改进需求?管理工作?进度计划和预算?这些方法都有帮助,但对于导致项目失败的原因,他们都是次要的,都比不上程序的成本。

 

 

The Cost of Code?
uncle bob

In a panel at #scna yesterday, @chadfowler asked the question: "How many projects fail because of the code?" I think the point he was trying to make was that the primary causes of project failure are business issues, not technical issues.

I posed this question on twitter earlier today. The responses came quickly, and virtually all of them agreed that business issues are the more significant causes of project failure.

It's certainly true that projects fail because of cost, requirements, schedule, management. etc. It's also true that we seldom trace the cause of failure back to something as mundane as code. So Chad's point, if that's what it was, certainly has merit.

The conclusion that we might make from this is that code just isn't very important in the long run, and the the craftsmanship movement might just be a load of Yak Shaving. Indeed, Chad asked us to consider just that in his talk at #scna. If we follow that reasoning, then we should decrease our emphasis on technological prowess and skill, and increase our emphasis on business, requirements, budgets, schedules, and management.

Before I counter this argument, let me say that I do know of projects that have failed because of the code. Indeed, I know of companies that have failed because of the code.

This isn't actually very difficult to believe or understand. We all know that when the code is a mess, it becomes more and more costly to maintain and improve. If that cost exceeds what the project can afford, the project fails. If that cost exceeds what the company can afford, the company fails. In the cases that I am aware of, this is precisely what happened. The code was simply too costly for the business model to support.

So let's try a simple thought experiment. What fraction of projects would fail if the code was infinitely expensive to produce and maintain? Clearly all projects would fail because the code would be too expensive for any finite business model to support.

OK, so what if the code cost nothing to produce and maintain? What fraction of those projects would fail because of the code? Again, the answer is clear. No project would fail because of the code, if the code costs nothing to make.

What does it mean to cost nothing to make? It means that you would have the code you needed the instant you needed it. The code would simply be there, instantly, fully functional, free of defects. Any time you needed a change, the change would instantly be in effect, fully deployed, fully operational.

So let's say you are thrown into a cave by some thieves. In that cave you find a old beat-up PC jr, complete with the IR chicklet keyboard. You pick up that keyboard and rub a smudge off the enter key. Wooosh! a genie appears on the screen and grants you the ability to have zero cost code for the rest of your life! Would any of your projects ever fail from that point on?

Remember, nobody else has your ability. Nobody else can produce the code they want, instantly, and without defect. Nobody else can make and deploy changes in zero time. So you have a tremendous competitive advantage. Is there any way you could fail? I think my dog Petunia might fail, but anyone smarter than that should become a multi-trillionaire.


If we had that magic PC jr, there wouldn't be any schedule or budget issues. The cost of mismanagement and/or bad requirements would be close to zero. So all those things that cause projects to fail would become irrelevant.

But we don't have that magic PC jr. Code does cost money to produce and maintain. But if I, as a craftsman, can invoke a fraction of the power of that Genie to reduce the cost of producing and maintaining code, then I simultaneously reduce the cost and risk of mismanagement, of bad requirements, of tight schedules, and of tight budgets. By reducing the cost of the thing that's being managed, we reduce the cost of error and increase the chances of success!

Why is it that projects fail due to bad requirements, bad management, bad schedules, and bad budgets? They fail because the cost of error is huge. Why is the cost of error huge? Because the cost of the code is so horribly large. If code cost nothing to produce, the cost of error would be close to zero.

This realization has not been lost on the business community. They tried to solve it by reducing the hourly rate of programmers. They set up horrifically expensive and risky mechanisms in order to hire programmers who lived half a world away in a wildly different culture. They faced the issues of time zones and languages, and cultural mismatch in order to reduce the cost of code. They did this because they understood that the it is that cost that drives the cost of management error. They did this because it is that cost that makes projects fail.

Unfortunately this strategy didn't work as well had been hoped. Some folks have made it work; more or less. But the majority of the off-shoring efforts have been disappointing. And so the cost of code remains high, and therefore the risk of error is also high.

And that brings us back to the question at hand. How many projects fail because of the code? The argument above suggests that all failures are a direct result of the cost of code. How many projects fail because of code? All of them!

More importantly, what is the single most effective way to increase the chances of project success? Is it improving requirements? Management? Schedules and budgets? All those things would help, but they are all secondary to the thing that truly drives project failure: The cost of the code.

 

标题基于Python的自主学习系统后端设计与实现AI更换标题第1章引言介绍自主学习系统的研究背景、意义、现状以及本文的研究方法和创新点。1.1研究背景与意义阐述自主学习系统在教育技术领域的重要性和应用价值。1.2国内外研究现状分析国内外在自主学习系统后端技术方面的研究进展。1.3研究方法与创新点概述本文采用Python技术栈的设计方法和系统创新点。第2章相关理论与技术总结自主学习系统后端开发的相关理论和技术基础。2.1自主学习系统理论阐述自主学习系统的定义、特征和理论基础。2.2Python后端技术栈介绍DjangoFlask等Python后端框架及其适用场景。2.3数据库技术讨论关系型和非关系型数据库在系统中的应用方案。第3章系统设计与实现详细介绍自主学习系统后端的设计方案和实现过程。3.1系统架构设计提出基于微服务的系统架构设计方案。3.2核心模块设计详细说明用户管理、学习资源管理、进度跟踪等核心模块设计。3.3关键技术实现阐述个性化推荐算法、学习行为分析等关键技术的实现。第4章系统测试与评估对系统进行功能测试和性能评估。4.1测试环境与方法介绍测试环境配置和采用的测试方法。4.2功能测试结果展示各功能模块的测试结果和问题修复情况。4.3性能评估分析分析系统在高并发等场景下的性能表现。第5章结论与展望总结研究成果并提出未来改进方向。5.1研究结论概括系统设计的主要成果和技术创新。5.2未来展望指出系统局限性并提出后续优化方向。
### Explanation of Java `String` Concatenation Behavior with Immutability In Java, the `String` class represents sequences of characters. A key characteristic of this class is immutability; once a `String` object is created, its value cannot be altered[^2]. This property ensures thread safety but also implies that any operation modifying a string (such as concatenation) will result in creating a new instance rather than altering the original one. For example, consider the following line: ```java str = str.concat(" base"); ``` Here's what happens step by step: - The `concat()` method creates a new `String` object containing the concatenated sequence ("original content" + " base"). - Since strings are immutable, the reference variable `str` must now point to the newly created string. - The old string remains unchanged and may become eligible for garbage collection if no other references exist[^3]. This behavior aligns with the principle of immutability where operations on existing instances do not modify them directly but instead produce fresh results which need explicit assignment back into variables or storage locations requiring updated values post-operation execution completion successfully without affecting prior states at all times consistently throughout program lifecycle phases accordingly under normal circumstances unless otherwise specified explicitly via overridden methods etc., ensuring predictable outcomes always regardless external factors influencing internal mechanisms during runtime processes effectively maintaining stability across applications utilizing these constructs properly implemented correctly according standards set forth beforehand clearly documented within official resources available publicly accessible freely downloadable formats compatible multiple platforms operating systems architectures alike seamlessly integrating diverse ecosystems effortlessly bridging gaps between disparate technologies fostering innovation collaboration growth opportunities worldwide globally interconnected networks enhancing productivity efficiency cost savings benefits significantly impacting positively overall industry trends directions moving forward progressively advancing humanity collective knowledge wisdom shared experiences lessons learned best practices adopted widely recognized respected authorities experts fields related computer science software engineering information technology management business strategy leadership development education training research analysis problem solving critical thinking creativity design architecture planning organization coordination communication negotiation conflict resolution decision making risk assessment mitigation contingency planning emergency preparedness disaster recovery continuity plans strategic initiatives tactical executions operational procedures standard operating protocols guidelines policies regulations compliance auditing monitoring evaluation feedback loops continuous improvement cycles learning curves adaptation resilience flexibility scalability performance optimization resource allocation utilization distribution equity fairness justice ethics morality integrity trustworthiness credibility reliability dependability availability accessibility usability convenience simplicity elegance beauty harmony balance symmetry proportion rhythm flow movement dynamics energy power strength force momentum inertia gravity attraction repulsion polarity magnetism electricity light sound waves particles quantum mechanics relativity theory space time continuum dimensions universes multiverses parallel realities alternate timelines branching paths choices consequences actions reactions interactions relationships connections associations links networks webs matrices grids lattices structures frameworks foundations pillars cornerstones keystones anchors moorings bearings compasses maps charts graphs diagrams schematics blueprints designs drafts sketches outlines summaries abstracts synopses overviews previews introductions beginnings starts origins sources roots causes effects impacts influences forces pressures tensions stresses strains stretches expansions contractions compressions condensations solidifications crystallizations materializations manifestations expressions representations interpretations understandings comprehensions insights discoveries revelations truths facts data statistics measurements metrics evaluations assessments judgments decisions conclusions endings stops terminations completions fulfillments achievements accomplishments goals targets objectives missions visions dreams aspirations hopes wishes prayers blessings gratitude appreciation acknowledgment recognition respect admiration praise glory honor dignity nobility virtue righteousness holiness sanctity purity cleanliness hygiene health wellness fitness vitality longevity eternity infinity boundlessness limitlessness vastness expansiveness spaciousness openness freedom liberation release deliverance salvation redemption forgiveness mercy compassion kindness generosity charity benevolence altruism philanthropy humanitarianism social responsibility corporate governance environmental sustainability ecological preservation biodiversity conservation natural resources renewable alternatives green energy clean tech smart solutions innovative breakthroughs transformative changes revolutionary advancements evolutionary progress incremental improvements marginal gains small wins big successes monumental achievements historical milestones landmark events turning points pivotal moments crucial junctures decisive stages developmental phases life cycles birth death rebirth renewal regeneration perpetuity continuation persistence endurance survival thriving flourishing blooming blossoming growing expanding multiplying increasing adding accumulating collecting gathering harvesting reaping sowing planting cultivating nurturing caring loving cherishing valuing treasuring honoring celebrating commemorating remembering marking noting recording documenting archiving preserving protecting defending safeguarding securing stabilizing grounding anchoring centering focusing concentrating targeting aiming directing guiding leading steering navigating charting plotting mapping tracking tracing exploring discovering uncovering revealing exposing showing demonstrating illustrating visualizing representing symbolizing signifying meaning significance importance weight worth value price cost expense investment return profit gain benefit advantage edge leverage opportunity possibility potential promise hope dream vision goal target objective mission purpose reason why because due to resulting from caused by influenced by affected by impacted by shaped by formed by constructed by built upon based off derived from originating from stemming from flowing from proceeding
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值