初級開發人員的缺點
Are you a junior developer embarking on your software development career?
您是從事軟件開發事業的初級開發人員嗎?
Or a recent computer science graduate who has recently started a new job?
還是最近剛開始從事新工作的計算機科學專業的畢業生?
Maybe a self-taught developer wondering what to do next?
也許一個自學成才的開發人員想知道下一步該怎么做?
Starting your software development career can be scary, but also very exciting.
開始您的軟件開發生涯可能會令人恐懼,但也非常令人興奮。
I know the feeling, having been there myself. Over the past 4 years, I have gone from junior developer to lead developer at a SaaS startup, learning lots along the way.
我自己去過那里就知道這種感覺。 在過去的四年中,我從初級開發人員轉到SaaS初創公司的首席開發人員,在此過程中學到了很多東西。
I have written this guide with my top tips, to not only survive but strive in your first year as a junior developer.
我已經用最重要的技巧編寫了本指南,不僅可以生存,還可以在您成為初級開發人員的第一年努力。
知識上的差距也可以 (It’s OK to have gaps in your knowledge)
University degrees, coding boot camps, and online courses do a great job at teaching you how to code.
大學學位,新手訓練營和在線課程在教您如何編碼方面做得很好。
Yet, the truth is that in the real world of software development there is a bit more to it than writing code. You’ll have to understand:
然而,事實是,在軟件開發的現實世界中,除了編寫代碼之外,還有很多其他事情。 您必須了解:
- Which technologies are best for different problems 哪種技術最適合不同問題
- Code written by other people 其他人編寫的代碼
- Design patterns and best practices 設計模式和最佳實踐
- How to test code 如何測試代碼
- CI/CD, source control, and branching strategies CI / CD,源代碼控制和分支策略
- The software development lifecycle and different methodologies 軟件開發生命周期和不同的方法
- Working not only with your team, but with other teams, management, and clients 不僅與您的團隊合作,而且與其他團隊,管理層和客戶合作
…to name a few things.
……僅舉幾例。
You may already know some of this stuff, or you may have never heard of any of it before. And that’s OK. You are there as a junior software developer, your manager and your teammates know this.
您可能已經知道其中一些內容,或者您??以前從未聽說過其中任何內容。 沒關系。 您是初級軟件開發人員,您的經理和您的隊友都知道這一點。
So there will be gaps in your knowledge. Every developer has them! Don’t feel overwhelmed if it all doesn’t make sense straight away.
因此,您的知識將存在空白。 每個開發人員都有! 如果這一切都沒有直接意義,請不要感到不知所措。
In fact, part of the beauty of being a software developer is that technology is always changing. We will always be learning, regardless of what level we are at.
實際上,成為軟件開發人員的好處之一就是技術總是在變化。 無論我們處于什么水平,我們將始終在學習。
問題很好,因此尋求幫助 (Questions are good — so is asking for help)
You have your first task, you get excited and dive straight in. But then…you’re stuck. Your code doesn’t work as expected, and all you have to go by is a strange, confusing error message.
您有第一個任務,就感到興奮并直接潛水。但是然后……您陷于困境。 您的代碼無法按預期運行,您所要做的只是一條奇怪的,令人困惑的錯誤消息。
Stumped, you think about asking one of the other developers on your team for help, but you think:
陷入困境,您考慮向團隊中的其他開發人員之一尋求幫助,但是您認為:
“What if they think I’m dumb? or that I can’t code? and laugh at me?!”
“如果他們認為我愚蠢怎么辦? 還是我無法編碼? 嘲笑我?!”
But in reality, that will never happen. What they will actually think is:
但實際上,這永遠不會發生。 他們實際上會想到的是:
“OK, I’ll take a quick look and see if I can help. Ah! Yes, I’ve encountered this issue before, you can use someMethod() from somePackage() to fix it.”
“好的,我會快速看一下,看看是否能幫上忙。 啊! 是的,我之前遇到過此問題,您可以使用somePackage()中的 someMethod() 對其進行修復。”
Which isn’t so bad right?
哪個還不錯吧?
Your team is there to support you, especially in the early parts of your career, so ask them for help.
您的團隊會在那里為您提供支持,尤其是在您職業生涯的早期階段,因此請尋求他們的幫助。
Likewise, if you don’t understand something, ask questions. I’m still asking loads of questions every day! There is no such thing as a stupid question. Your team would rather help you instead of having you stare at your screen with confusion for most of the day.
同樣,如果您不懂某事,請提出問題。 我仍然每天都在問很多問題! 沒有愚蠢的問題。 您的團隊寧愿為您提供幫助,也不希望您在一整天的時間里困惑地盯著屏幕。
代碼評論是您的朋友 (Code Reviews are your friend)
I’ll never forget my first code review as part of my first junior developer job. My code was being reviewed by an experienced senior developer. At the time I found this nerve-wracking. And, of course, there were more comments from him than I could count!
在我的第一個初級開發人員工作中,我永遠不會忘記第一次的代碼審查。 經驗豐富的高級開發人員正在審查我的代碼。 當時我發現了這種令人不安的東西。 而且,當然,來自他的評論超出了我的想象!
But in hindsight, this was a good thing.
但是事后看來,這是一件好事。
Code reviews are not a stage for criticism, but for learning and giving feedback on all sides.
代碼審查不是批評的舞臺,而是各個方面的學習和反饋。
The senior developer sat down with me and explained what each of the comments meant, and also why he had made them. Needless to say, I learned a lot. So when your code is being reviewed, remember that any feedback is to help you learn and improve as a software developer.
高級開發人員與我坐下來,解釋了每個評論的含義,以及他為什么要發表這些評論。 不用說,我學到了很多東西。 因此,在審查代碼時,請記住,任何反饋都將幫助您以軟件開發人員的身份學習和改進。
Likewise, when you come to review code for other people, you will be able to see how different people approach different problems. You will even help them improve by making suggestions of your own!
同樣,當您查看其他人的代碼時,您將能夠看到不同的人如何處理不同的問題。 您甚至可以通過提出自己的建議來幫助他們改進!
分解,再分解 (Break it down, and break it down some more)
Ok so you have your first real task, depending on the size of the task, you might feel a bit overwhelmed:
好的,因此您有自己的第一個實際任務,具體取決于任務的大小,您可能會覺得不知所措:
“Where do I start? I guess I’ll start with doing X, but what about Y? But then if I do Y there’s A, B, and C….what’s happening with X again?!”
“我從哪說起呢? 我想我先做X,但是Y呢? 但是,如果我做Y,則有A,B和C…。X又發生了什么?!
Don’t worry we’ve all been there. It’s easy to get lost in the proverbial rabbit hole when trying to solve a problem. The next time you have a large problem to solve, try remembering this quote,
不用擔心我們都去過那里。 嘗試解決問題時,很容易迷失在眾所周知的兔子洞中。 下次您遇到大問題要解決時,請記住該報價,
“How do you eat an elephant? One bite at a time.”
“你怎么吃大象? 一次咬一口。”
In other words, make a task which seems impossible more manageable by breaking it up into smaller tasks.
換句話說, 通過將任務分解為較小的任務 , 使似乎不可能完成的任務變得更易于管理。
So how do you do that?
那你該怎么做呢?
Before writing any code, try writing out the steps in plain English (or language of your choice). Let’s take an example.
在編寫任何代碼之前,請嘗試以簡明英語(或您選擇的語言)寫出這些步驟。 讓我們舉個例子。
How do you pour a glass of water?
您如何倒一杯水?
A plain English approach would be
普通的英語方法是
- Open the cupboard 打開櫥柜
- Get a glass 來一杯
- Place glass under the tap 將玻璃杯放在水龍頭下
- Turn on the tap 打開水龍頭
- When the glass is full, turn off the tap 玻璃裝滿后,關閉水龍頭
- Remove glass from under the tap 從水龍頭下方取下玻璃
By writing out the steps, it is easier to visualize each part of the problem and come up with a solution for each step.
通過寫出步驟,可以更輕松地可視化問題的每個部分并為每個步驟提出解決方案。
把事情簡單化 (Keep it simple)
A common mistake many junior developers make (myself included when I started) is to try and reinvent the wheel.
許多初級開發人員經常犯的一個錯誤(嘗試時包括我自己)是嘗試重新發明輪子。
It might look impressive to solve a problem by using a super-fancy technique within your code.
通過在代碼中使用超級技巧來解決問題可能看起來令人印象深刻。
But this causes other problems:
但這會導致其他問題:
- Code that is completely different from how similar parts of the system work is harder to maintain 與系統相似部分的工作方式完全不同的代碼更難維護
- Your code may become more verbose that it needs to be, and there will be an increased risk of bugs 您的代碼可能變得更加冗長,并且存在更大的錯誤風險。
- It may take you longer to complete your task 完成您的任務可能需要更長的時間
So how exactly do you keep it simple?
那么,如何使它保持簡單呢?
Make it work. Don’t overthink too much, and do whatever your gut says to get your code working
讓它起作用。 不要考慮太多,盡一切所能使代碼正常工作
Refactor. Now that your code is working, it’s time to refactor. Make your code easy to read by naming things well, and use of proper formatting. More on this in ‘Learn how to write clean code’ below
重構。 現在您的代碼可以正常工作了,該重構了。 通過適當地命名和使用正確的格式來使代碼易于閱讀。 有關更多信息,請參見下面的“學習如何編寫簡潔的代碼”
Speed it up. Once you have finished refactoring, you might notice bottlenecks in the performance of your code. Now is the time to optimize it. Be wary not to fall into the trap of over-optimizing too early! Only do this if you need to.
加快速度。 重構完成后,您可能會注意到代碼性能的瓶頸 。 現在是優化它的時候了。 注意不要過早陷入過度優化的陷阱! 僅在需要時這樣做。
BONUS TIP. Consider writing some failing tests before writing any code. This is called Test Driven Development. Not only will this give you good test coverage, but it will help you think about the structure of your code.
獎金提示。 在編寫任何代碼之前,請考慮編寫一些失敗的測試。 這稱為測試驅動開發 。 這不僅可以為您提供良好的測試覆蓋范圍,而且可以幫助您考慮代碼的結構。
了解如何編寫簡潔的代碼 (Learn how to write clean code)
Mastering clean code will make you stand out as a software developer.
掌握干凈的代碼將使您成為軟件開發人員。
So what exactly do we mean by Clean Code?
那么,清潔代碼到底是什么意思?
- Follows the S.O.L.I.D principles 遵循SOLID原則
- It is testable and maintainable 可測試且可維護
- It is easy to read and follow 易于閱讀和遵循
In other words:
換一種說法:
Any fool can write code that a computer can understand. Good programmers write code that humans can understand. — Martin Fowler
任何傻瓜都可以編寫計算機可以理解的代碼。 好的程序員編寫人類可以理解的代碼。 —馬丁·福勒(Martin Fowler)
I won’t go into too much detail here, like the book, Clean Code: A Handbook of Agile Software Craftsmanship by Robert C Martin will give a much deeper insight into this area. If you are serious about writing clean code and breaking out of the junior developer level, I highly recommend this book.
我將在這里不做過多介紹,例如Robert C Martin所著的《 干凈代碼:敏捷軟件技巧手冊 》一書將對該領域提供更深入的了解。 如果您真的想編寫干凈的代碼并突破初級開發人員的水平,我強烈推薦這本書。
Writing clean code shows that you are passionate about what you do, and can create maintainable reliable software. Not to mention that you will be making life a bit easier for the next person who comes along to add to your code.
編寫干凈的代碼表明您對所做的事情充滿熱情,并且可以創建可維護的可靠軟件。 更不用說您將使下一位來添加您的代碼的人的工作更加輕松。
“有一個圖書館” (“There’s a library for that”)
Have you ever told a friend about a problem you were having, and they respond with “Yeah, there’s an app for that”?
您是否曾經向朋友介紹過您遇到的問題,然后他們回答“是的,有一個適用的應用程序”?
Software development is a bit like this.
軟件開發有點像這樣。
There are already a lot of answers to the problems you are trying to solve. So when you are trying to complete a task, check to see if someone else has already solved the problem.
您正在嘗試解決的問題已經有了很多答案。 因此,當您嘗試完成任務時 ,請檢查是否有人已經解決了該問題。
You can do this by:
您可以通過以下方式做到這一點:
- Looking for existing packages and libraries 尋找現有的軟件包和庫
- Browsing sites such as GitHub and StackOverflow for similar solutions to your problem. 瀏覽類似GitHub和StackOverflow之類的網站來解決您的問題。
Hold it right there! This doesn’t give you free rein to copy and paste code without a thought. If you are using someone else’s code as an example, it is important that you understand what their code is doing and why.
放在那里! 這不會讓您隨意地復制和粘貼代碼。 如果使用的是別人的代碼為例,它是重要的,你了解他們的代碼在做什么, 為什么 。
- Why is it using a particular design pattern? 為什么使用特定的設計模式?
- Why is it written in a particular language? (Node.js vs Python for example) 為什么用特定語言編寫? (例如,Node.js與Python)
What are the drawbacks? Will it work with your current codebase?
有什么缺點? 它可以與您當前的代碼庫一起使用嗎?
If you’re not sure, you can ask someone on your team for some guidance. Searching Google for an answer is a common approach to solving coding tasks. So don’t be afraid to turn to your teammates and say:
如果不確定,可以向團隊中的某人尋求指導。 搜索Google的答案是解決編碼任務的常用方法。 因此,不要害怕轉向您的隊友說:
“I’m thinking about using this library X or this package Y, I have seen some examples on here, what do you think?”
“我正在考慮使用這個庫X或這個包Y,我在這里看到了一些示例,您對此有何看法?”
Not only will this show that you are proactive, but it’ll also spark some conversation/debate from the team. You might have discovered something awesome no one else knew about yet!
這不僅表明您很主動,而且還會引起團隊的一些對話/辯論。 您可能已經發現了其他人所不知道的棒極了!
了解如何閱讀代碼 (Learn how to read code)
We have all seen those movies. The ones where a hacker types rapidly as pages of code scroll down the monitors in front of them.
我們都看過那些電影。 當代碼頁被黑客滾動時,黑客會Swift鍵入這些信息。
In the real world, developers spend more time reading code than actually writing code.
在現實世界中,與實際編寫代碼相比,開發人員在閱讀代碼上花費的時間更多。
When adding new features or fixing defects, you will have to understand the current codebase you are working on. How do you do this? Read, read, read!
添加新功能或修復缺陷時,您將必須了解正在使用的當前代碼庫。 你怎么做到這一點? 閱讀,閱讀,閱讀!
Reading code is also a beneficial learning technique. Reading existing code lets you see how others have developed a certain feature.
閱讀代碼也是一種有益的學習技術。 閱讀現有代碼可讓您了解其他人如何開發特定功能。
Things to keep an eye out for:
需要注意的事情:
- The use of design patterns 設計模式的使用
- The naming of methods, classes, and variables 方法,類和變量的命名
- The use of comments 使用評論
- How to structure project files 如何構造項目文件
- The use of tests and how they are structured 測試的使用及其結構
So where do you find code to read?
那么,您在哪里找到要讀取的代碼?
- Repositories in your source control at work 您的源代碼管理中的存儲庫在工作
- Projects on GitHub GitHub上的項目
- Read answers/questions on StackOverflow 閱讀關于StackOverflow的答案/問題
- Code challenge websites such as codewars.com, which show the answers to challenges 代碼挑戰網站,例如codewars.com,可顯示挑戰的答案
玩得開心! (Have fun!)
If you take one thing away from this article, let it be this — is it important to have fun. Enjoy writing code, solving problems, and continuing to learn. You are at the start of an exciting career, so sit back and enjoy the ride!
如果您從本文中刪除一件事,那就順其自然吧–獲得樂趣很重要。 享受編寫代碼,解決問題并繼續學習的樂趣。 您正處于令人興奮的職業生涯的開始,所以請坐下來享受旅程!
獎金提示 (BONUS TIPS)
- Learn the lingo. We developers have our own funny language (“creating a branch” has nothing to do with trees!) so make sure you understand the key terms 學習行話。 我們的開發人員有我們自己的有趣語言(“創建分支”與樹木無關!),因此請確保您了解關鍵術語
- Get to know your IDE. Learn the hotkeys, shortcuts, and customize it until you are comfortable with it. This will increase your productivity. 了解您的IDE。 學習熱鍵,快捷方式并對其進行自定義,直到您習慣為止。 這將提高您的生產率。
- Working on bugs is a great way to learn about the codebase. So don’t be afraid to pick these up! 處理錯誤是學習代碼庫的好方法。 因此,不要害怕撿起來!
- Bring a notebook, listen with intent and write everything down. 帶上筆記本,專心聆聽并寫下所有內容。
- Take on some side projects in your spare time. It’s a great way to learn different technologies you don’t learn in your day job and will boost your CV. 在您的業余時間從事一些輔助項目。 這是學習日常工作中不會學到的各種技術的一種好方法,它將提高您的簡歷。
- Getting involved in work events is a great way to get to know your colleagues. Why not organize one yourself? 參與工作活動是認識同事的好方法。 為什么不自己組織一個人呢?
Thanks for reading!
謝謝閱讀!
I’m currently creating a bunch of guides, articles, and video courses to help you along your journey into web development. If you would like to be a part of it, make sure to join the mailing list over at chrisblakely.dev!
我目前正在創建大量指南,文章和視頻課程,以幫助您進行Web開發。 如果您想加入其中,請確保通過chrisblakely.dev加入郵件列表!
翻譯自: https://www.freecodecamp.org/news/ace-your-first-year-as-a-junior-developer-with-this-advice-bbc68b6fe2d9/
初級開發人員的缺點