管理員所有權代碼
Code ownership sucks.
代碼所有權糟透了。
It limits code and stunts your growth as a developer.
它限制了代碼并阻礙了您作為開發人員的成長。
Let’s look at what code ownership is and why it destroys individuals and organizations.
讓我們看看什么是代碼所有權以及為什么它破壞個人和組織。
什么是代碼所有權 (What is code ownership)
Code ownership is where one person in an organization owns a codebase.
代碼所有權是組織中的一個人擁有代碼庫的位置。
That means one person is responsible for the whole system. The individual is responsible for making changes to the code, taking the decisions about design, and for managing bugs.
這意味著一個人對整個系統負責。 個人負責更改代碼,做出有關設計的決定以及管理錯誤。
Let’s say the system is a web app. With code ownership, one person in the company owns that web app. If there’s a problem with the web app, the code owner is the person who has to fix it.
假設系統是一個Web應用程序。 使用代碼所有權,公司中的一個人擁有該Web應用程序。 如果網絡應用程序有問題,則代碼所有者是必須修復它的人。
為什么會吮吸? (Why does it suck?)
Code ownership is bad for code owners because it stunts their growth.
代碼所有權對代碼所有者不利,因為它阻礙了他們的成長。
As well, code ownership causes problems for the organization and for code owners.
同樣,代碼所有權也會給組織和代碼所有者帶來麻煩。
If no one knows how a system works, nobody can give effective code reviews. Worse, the code might not be reviewed at all.
如果沒人知道系統是如何工作的,那么沒人會進行有效的代碼審查。 更糟糕的是,該代碼可能根本不會被審查。
The owner of the code is then the only person who ever looks at the codebase. This stops code owners from learning from their colleagues, which is the best way to learn at work.
這樣,代碼的所有者便是唯一查看代碼庫的人。 這阻止了代碼所有者向同事學習,這是在工作中學習的最佳方法。
As a code owner, you could be making horrible design decisions and you wouldn’t know it.
作為代碼所有者,您可能會做出可怕的設計決策,而您卻一無所知。
代碼所有權扼殺了動力 (Code ownership kills motivation)
It’s easy to lose motivation when you own a codebase.
當您擁有一個代碼庫時,很容易失去動力。
People don’t care if you shave 10kb off the bundle size when they don’t even know how big the bundle was before.
人們甚至不在乎捆綁之前的大小時,不在乎是否將捆綁大小減少10kb。
There’s no one to get excited with you when you switch to a new framework, add webpack to the pipeline, or improve server performance by adding a cache.
當您切換到新框架,將Webpack添加到管道中或通過添加緩存來提高服務器性能時,沒有人會為您感到興奮。
This is demotivating.
這令人沮喪。
代碼所有權使您懶惰 (Code ownership makes you lazy)
When you own your code, you can get lazy.
擁有代碼后,您可能會變得懶惰。
No one is checking in on you. People don’t know that the bug only took you five minutes to fix, and that you spent the rest of the day on reddit.
沒有人在檢查您。 人們不知道該錯誤只花了五分鐘即可修復,而您余下的時間都花在了reddit上 。
You can coast by, doing the bare minimum. This is a waste.
您可以通過做最少的事情來做。 這是浪費。
I’ve seen 30-year-olds who have been in the same job for the last ten years, working on the same legacy codebase. And it shows. They’re behind on the latest technology, they’re not passionate about their work, and they spend hours every day browsing social media.
我見過30歲的人在過去十年中一直從事相同的工作,并在相同的舊版代碼庫中工作。 它顯示了。 他們落后于最新技術,對工作不滿,每天花數小時瀏覽社交媒體。
Don’t be like them.
不要像他們一樣。
代碼所有權產生關鍵人員依賴性 (Code ownership produces key man dependency)
Not only is code ownership bad for the individual but it’s also bad for the organization.
代碼所有權不僅對個人不利,對組織也不利。
If one person is responsible for a codebase, what happens when the code owner goes on vacation—or worse—leaves the company? Nobody in the organization will know how the code works.
如果一個人負責一個代碼庫,那么當代碼所有者去休假(或更糟糕的是)離開公司時會發生什么? 組織中沒有人會知道代碼是如何工作的。
This problem is known as key man dependency. Extreme code ownership produces key man dependency.
這個問題被稱為關鍵人物依賴 。 極端的代碼所有權產生關鍵人員依賴性。
代碼所有權導致壓力 (Code ownership causes stress)
Although it can make you complacent, code ownership also causes stress.
盡管它會讓您沾沾自喜,但代碼所有權也會帶來壓力。
If there’s a problem with the application, it’s your fault. You will be responsible, and you will have no one to help you fix the bug.
如果應用程序有問題,那是你的錯。 您將負責,并且沒有人可以幫助您修復錯誤。
有什么解決辦法? (What’s the solution?)
The solution is a culture of shared code.
解決方案是共享代碼的文化。
Shared code is where everyone in the team works on all parts of the codebase.
團隊中的每個人都可以在共享代碼中使用代碼庫的所有部分。
When the team owns the code, everyone can help make design decisions. Everyone can participate in the discussion of the system design, help bounce ideas around, and share in the responsibility of those decisions. Writing code becomes a magical experience.
當團隊擁有代碼時,每個人都可以幫助制定設計決策。 每個人都可以參與系統設計的討論,幫助反彈想法,并共同承擔這些決策的責任。 編寫代碼成為一種神奇的體驗。
With shared code, there isn’t key man dependency. Any team member can go on vacation and the team will continue to work as normal.
使用共享代碼,沒有關鍵人員依賴性。 任何團隊成員都可以休假,團隊將繼續正常工作。
With shared code, you’ll learn from your peers. Someone with knowledge of the system can provide quality feedback. Code will be scrutinized by many eyes, and it will flourish because of it.
使用共享代碼,您將向同行學習。 有系統知識的人可以提供質量反饋。 代碼將受到許多人的關注,因此它將蓬勃發展。
When multiple people work on the same codebase, they help to sculpt a code into perfection.
當多個人在同一個代碼庫上工作時,他們可以幫助您完美地雕刻代碼。
充分利用您的工作時間 (Making the most of your time at work)
You don’t need to work in an organization that stunts your growth. You should make the most of your time at work.
您無需在阻礙發展的組織中工作。 您應該充分利用工作時間。
Developers have the upper hand in the job market. We can choose where we work. If we’re not learning at our current job, we can change jobs.
開發人員在就業市場上占了上風。 我們可以選擇工作地點。 如果我們不學習當前的工作,我們可以換工作。
If you’re working at a place with code ownership, find a new job.
如果您在擁有代碼所有權的地方工作,請找到新工作。
Don’t make the mistake of working in a suboptimal environment. It will harm you in the long run.
不要犯在次優環境中工作的錯誤。 從長遠來看,它將傷害您。
You might not realize how badly it’s affecting your growth, but a place that has code ownership will stop you from reaching your full potential.
您可能沒有意識到它對您的成長有多嚴重的影響,但是擁有代碼所有權的地方將使您無法發揮全部潛力。
Learning from other developers is a great benefit of working on a team, so find a new job now.
向其他開發人員學習是團隊合作的一大好處,所以現在就找一份新工作。
翻譯自: https://www.freecodecamp.org/news/why-code-ownership-sucks-and-you-should-never-work-somewhere-that-practices-it-b8fc1c694074/
管理員所有權代碼