赞
踩
初级开发人员的缺点
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.
我已经用最重要的技巧编写了本指南,不仅可以生存,还可以在您成为初级开发人员的第一年努力。
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:
然而,事实是,在软件开发的现实世界中,除了编写代码之外,还有很多其他事情。 您必须了解:
…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.
实际上,成为软件开发人员的好处之一就是技术总是在变化。 无论我们处于什么水平,我们将始终在学习。
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.
同样,如果您不懂某事,请提出问题。 我仍然每天都在问很多问题! 没有愚蠢的问题。 您的团队宁愿为您提供帮助,也不希望您在一整天的时间里困惑地盯着屏幕。
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!
同样,当您查看其他人的代码时,您将能够看到不同的人如何处理不同的问题。 您甚至可以通过提出自己的建议来帮助他们改进!
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
普通的英语方法是
By writing out the steps, it is easier to visualize each part of the problem and come up with a solution for each step.
通过写出步骤,可以更轻松地可视化问题的每个部分并为每个步骤提出解决方案。
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:
但这会导致其他问题:
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.
奖金提示。 在编写任何代码之前,请考虑编写一些失败的测试。 这称为测试驱动开发 。 这不仅可以为您提供良好的测试覆盖范围,而且可以帮助您考虑代码的结构。
Mastering clean code will make you stand out as a software developer.
掌握干净的代码将使您成为软件开发人员。
So what exactly do we mean by Clean Code?
那么,清洁代码到底是什么意思?
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.
编写干净的代码表明您对所做的事情充满热情,并且可以创建可维护的可靠软件。 更不用说您将使下一位来添加您的代码的人的工作更加轻松。
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:
您可以通过以下方式做到这一点:
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.
放在那里! 这不会让您随意地复制和粘贴代码。 如果使用的是别人的代码为例,它是重要的,你了解他们的代码在做什么, 为什么 。
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!
这不仅表明您很主动,而且还会引起团队的一些对话/辩论。 您可能已经发现了其他人所不知道的棒极了!
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:
需要注意的事情:
So where do you find code to read?
那么,您在哪里找到要读取的代码?
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!
如果您从本文中删除一件事,那就顺其自然吧–获得乐趣很重要。 享受编写代码,解决问题并继续学习的乐趣。 您正处于令人兴奋的职业生涯的开始,所以请坐下来享受旅程!
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加入邮件列表!
初级开发人员的缺点
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。