Every developer “develops” some bad habits throughout their career or even their learning experience. In this article we’ll take a look at some of the common bad habits that I have experienced myself and/or have seen over and over. My hope is that if your just starting out, you can avoid this stuff and if you are having these habits, your aware and you can start to work on changing them.
每个开发人员在他们的职业生涯甚至学习经历中都会“养成”一些坏习惯。在这篇文章中,我们将看看一些常见的坏习惯,我已经经历了自己和/或看到了一遍又一遍。我的希望是,如果你刚刚开始,你可以避免这些东西,如果你有这些习惯,你的意识和你可以开始改变他们的工作。
#1 Not Taking Enough Breaks
So the first one, I’m sure many or all of you are guilty of. I’m still guilty of it and that’s not taking breaks or not taking enough breaks. I’ve had periods of time where I’ve sat down at 6am and maybe only got up for lunch around 1 and then gone until 6 or 7 at night, and this was common, almost every day. I've done much more ridiculous things when I was on a time crunch. I think we we all have had those rare occasions when we need something done the very next day, that is not really what I’m talking about, I’m talking about your everyday habits.
I would suggest that each day you try and take frequent breaks. I can’t say a specific plan for everyone cause everyone's different, but in a general sense I’d say around every hour get up and stretch your legs walk around, get a coffee, get something to eat. A lot of times, if your stuck and you take a break and come back to it the solution will come easier after giving your brain a rest. So figure out what works for you. Even if you don’t think you need breaks, just try it, you may find that your more productive.
#1 休息时间不够
所以第一个,我相信你们很多人或所有人都有罪。我仍然对此感到内疚,那就是没有休息或者休息时间不够。我有一段时间早上6点坐下来,大概1点左右才起床吃午饭,然后一直到晚上6点或7点,这种情况很常见,几乎每天都有。在时间紧迫的时候,我做过很多可笑的事情。我想我们都曾有过这样的情况,当我们需要在第二天做一些事情的时候,这并不是我说的,我说的是你的日常习惯。
我建议你每天试着经常休息。我不能说每个人都有一个具体的计划,因为每个人都不一样,但总的来说,我会说,大约每小时起床,伸伸腿,四处走走,喝杯咖啡,吃点东西。很多时候,如果你的大脑被卡住了,你休息一下,然后又恢复过来,那么在你的大脑得到休息之后,解决问题的方法会变得更容易。所以,找出适合你的方法。即使你不认为你需要休息,只要尝试一下,你可能会发现你的工作效率更高。
#2 Refusing To Ask For Help
Number 2 applies to both learning and in the actual workplace. Many of us don’t ask for help. It could be for a number of reasons but I think a big one is pride and the fear of looking like you don’t know what your doing. Many of us have impostor syndrome where we don’t feel fully qualified in our positions. I’ve felt like this both in a company setting and dealing directly with clients. And even doing courses and tutorials. So asking for help just re-affirms that feeling. But in reality, its wasting a lot of time and hindering your growth. Other real developers are just as much of a resource as a video or book. I’d say even better than that stuff. They can directly answer your question and help you really understand it. The only people that would criticize you for asking for help would be a complete asshole and Id try to avoid those people anyway. If you don’t wanna ask for help because you want the experience of finding the answer on your own that’s fine, but give yourself a time limit. Don’t go days searching for a solution when you have peer right next to you that may know or can at least help you out.
#2 拒绝求助
第二条既适用于学习,也适用于实际工作场所。我们中的许多人不寻求帮助。这可能有很多原因,但我认为一个重要的原因是骄傲和害怕看起来你不知道自己在做什么。我们中的许多人都有冒名顶替综合症,在这种情况下,我们觉得自己的职位并不完全合格。无论是在公司环境还是直接与客户打交道,我都有这种感觉。甚至做课程和辅导。所以寻求帮助只是再次肯定了这种感觉。但实际上,它浪费了很多时间,阻碍了你的成长。其他真正的开发者就像一部视频或一本书一样是一种资源。我会说比那更好。他们可以直接回答你的问题,帮助你真正理解它。唯一会因为你请求帮助而批评你的人是个十足的混蛋,我无论如何都会尽量避开那些人。如果你不想寻求帮助,因为你想自己找到答案的经验,那很好,但给自己一个时间限制。当你身边的同伴可能知道或者至少可以帮你解决问题时,不要花上几天时间去寻找解决方案
#3 When You Stop Being A Student
I don’t care if you’ve been a senior developer for 20 years, you should always think of yourself as a student. More so than most professions because this one is always changing. No developer knows everything about anything. The minute they do, something changes and they still have to learn more. If you get complacent and you stop reading and learning, you'll fall behind. Even if you have a job that doesn't require you to learn anything new, like lets say you build the same type of projects with the same software, same version and everything, if you loose that job which is always a possibility, your gonna be way behind. So even with a job like that, id still suggest learning new stuff on the side. Stay up to date with whatever language, frameworks, libraries that your into. There are a lot of jobs like I just explained and its understandable because many team leaders at companies figure if it ain’t broke don’t fix it. So you still see teams using outdated and unsupported technologies because it seems to be working. If your learning new stuff on the side and you can show your team that its possible to make your projects faster and more efficient and easier, you may be able to sway them into updating their technology and bettering the company.
#3 当你不再是学生的时候
我不管你是否已经做了20年的高级开发人员,你应该一直把自己当成一个学生。比大多数职业更重要,因为这个职业总是在变化。没有一个开发人员对任何事情都了如指掌。一旦他们这样做了,一些事情就会改变,他们仍然需要学习更多。如果你自满,停止阅读和学习,你就会落在后面。即使你有一份不需要你学习任何新东西的工作,比如说你用相同的软件、相同的版本和所有东西来构建相同类型的项目,如果你失去了那份一直是可能的工作,你就会落后很多。所以即使有这样一份工作,我还是建议你边学习新东西。随时了解您所使用的任何语言、框架和库。有很多工作,就像我刚才解释的,这是可以理解的,因为许多公司的团队领导认为,如果没有破产,就不会解决它。因此,您仍然可以看到团队使用过时的和不受支持的技术,因为它似乎正在工作。如果你能一边学习新东西,一边向你的团队展示,让你的项目更快、更高效、更简单是可能的,那么你也许能说服他们更新技术,改善公司。
#4 Dirty Code
This is more of a technical habit and this could be a lot of things. You want to write your code in a way where its visually clean, efficient and secure. This is really hard when your self taught because a lot of the times in tutorials and courses, your not learning the best way to do something because the instructor is trying to make it easy to understand the core concept. So you have to kind of do some extra research and figure out the best way possible to clean up your code. Id definitely suggest always using the DRY principle which is don’t repeat yourself. If you see common blocks of code, create some kind of class or function to consolidate that piece of functionality rather than just repeating it. It makes it much cleaner, saves a bunch of lines and its easier for others to work with. You also wanna pay attention to performance. Do things like compress images, minify JavaScript and CSS. You can use a task runner like gulp or many other tools to do this automatically or if its a small project you can even do it manually with something like minifier.org. Also don’t make unnecessary api calls, structure your full stack app in a way where you can make as little requests as possible and still get the functionality you need. Also testing..This is one I’m a huge culprit of. I don’t do enough testing. As much as I know things like unit testing helps build a more robust app and saves you on potential issues, I just frigging hate it. Its probably one of my worst habits and something I need to work on to be a better developer. Sometimes we cut corners to save time but in reality, were making the application less performant, less efficient, less readable and it will probably cause more of a headache in the future than if you just did it the right way do begin with. So try and keep that in mind.
#4 垃圾代码
这更多的是一个技术习惯,这可能是很多事情。您希望以一种直观、高效和安全的方式编写代码。这真的很难。当你自学的时候,因为很多时候在辅导和课程中,你学不到最好的方法去做一些事情,因为老师试图让你很容易理解核心概念。所以你必须做一些额外的研究,找出最好的方法来清理你的代码。我绝对建议你永远使用 DRY 的原则,那就是不要重复你自己。
如果您看到常见的代码块,请创建某种类型的类或函数来整合该功能,而不仅仅是重复它。它使它更干净,节省了一堆线和它更容易为其他人工作。你也要注意表现。像压缩图像,缩小JavaScript和CSS。您可以使用gulp之类的任务运行程序或许多其他工具来自动执行此操作,或者如果是一个小项目,您甚至可以使用minifier.org.
另外,不要进行不必要的api调用,构建完整的堆栈应用程序时,您可以尽可能少地发出请求,并且仍然可以获得所需的功能。还有测试…这是我的罪魁祸首。我没有做足够的测试。据我所知,单元测试有助于构建一个更健壮的应用程序,并在潜在问题上为您节省时间,但我非常讨厌它。这可能是我最坏的习惯之一,也是我需要努力成为一名更好的开发人员的地方。有时我们为了节省时间而偷工减料,但实际上,我们正在降低应用程序的性能、效率和可读性,而且这可能会在将来引起更多的头痛,而不是从正确的方式开始。所以试着记住这一点。
#5 Bad Work/Life Balance
This is really important, especially if we have families at home and that’s work/life balance. Being a programmer of any kind takes up loads of time. There’s many reasons for this, things are always changing, we run into issues that can hold us up, we need to research and the list goes on. In turn, a lot of the time, we have to work late, work early, work on the weekends or all 3. This takes time away from everything else in your life including spending time with your loved ones as well as anything else you like to do. You may like sports, hiking, going out to eat, whatever it is, and if you’re constantly working you aren’t doing anything else that makes you happy. This is an area I have a lot of experience with. I have a wife and 2 kids, one with autism and I don’t spend the amount of time with them that I’d like to. I have kind of a double whammy because I have all of the issues of dealing with coding as well as the issues of a content creator and having to constantly come up with new ideas and recording and quality and so on. And if any of you guys are freelancers and work for yourself, you know your livelihood depends on getting work done. You only get paid if your getting shit done. As rewarding as working for yourself can be, it’s a constant worry about keeping up and getting things done. It’s really easy to fall off and I think that weighs on us and pushes other things out of our lives. Not to say that people that work for companies don’t go through this but its a whole new level when everything falls on you. So I really empathize with those of you that have your own businesses. But even with that said, you can’t let it control your life. You have to make time for your family and friends and quite frankly, for yourself. Life shouldn’t be just about writing lines of code. Do things you enjoy that bring a good balance to your life.
#5 糟糕的工作/生活平衡
这是非常重要的,尤其是如果我们有家庭在家,这是工作/生活的平衡。做一个任何类型的程序员都要花费大量的时间。这有很多原因,事情总是在变化,我们遇到的问题会阻碍我们,我们需要研究和列表继续。反过来,很多时候,我们不得不工作到很晚,工作到很早,周末工作或全部3。这会把时间从你生活中的其他事情中抽走,包括和你爱的人在一起以及你喜欢做的任何事情。你可能喜欢运动,远足,外出吃饭,不管是什么,如果你一直在工作,你就不会做任何让你快乐的事情。这是一个我有很多经验的领域。我有一个妻子和两个孩子,一个患有自闭症,我不想花太多时间和他们在一起。我有点双重打击,因为我有处理编码的所有问题,以及内容创造者的问题,必须不断地提出新的想法,录音和质量等等。如果你们中有人是自由职业者,为自己工作,你知道你的生计取决于完成工作。你只有完成任务才能得到报酬。尽管为自己工作是有回报的,但你总是担心自己能否跟上进度并完成任务。它真的很容易脱落,我认为这对我们来说很沉重,也会把其他事情从我们的生活中推出来。不是说为公司工作的人不会经历这种情况,而是当一切都落在你身上时,这是一个全新的层次。所以我真的很同情你们这些有自己生意的人。但即便如此,你也不能让它控制你的生活。你必须为你的家人和朋友腾出时间,坦率地说,也为你自己腾出时间。生活不应该只是写一行行代码。做一些你喜欢的事情,给你的生活带来一个很好的平衡。
#6 Bad Office Politics
This next one is for those of you working at a company. You work with other people which in turn can cause conflict, disagreement, arguments and so on. Many developers are arrogant and always wanna be right. Even if they know they made a mistake and they’re wrong, some of them would never admit it. I’m not saying that’s most developers but I think we’ve all met at least one of these guys. I hear from a lot of people that their team is great and they all get along and that’s really good but it’s not always the case. Many times you’re gonna clash on ideas and solutions. Try and be diplomatic and respectful but at the same time, don’t be a pushover, especially if you feel strong about whatever it is you’re proposing. Don’t resort to yelling or name calling or any of that. It doesn’t get you anywhere. If they start doing that to you, just walk away and be the bigger person. Unfortunately, if you have someone on your team that is just a complete dick and won’t listen to reason, there’s really nothing you can do aside from try to avoid them. There may be some cases where you have to talk to someone that is higher up. I would always suggest talking to the person first though.
#6糟糕的办公室政治
下一个是为你们这些在公司工作的人准备的。你和其他人一起工作,这反过来会引起冲突、分歧、争论等等。许多开发人员傲慢自大,总是希望自己是对的。即使他们知道自己犯了错误,他们中的一些人也不会承认。我不是说这是大多数开发人员,但我想我们都见过至少一个这样的人。我从很多人那里听说他们的球队很棒,他们都相处得很好,这真的很好,但事实并非总是如此。很多时候你会在想法和解决方案上产生冲突。试着表现出外交和尊重的态度,但同时,不要太过拘谨,尤其是当你对自己的提议感到强烈的时候。不要大喊大叫或骂人之类的。你哪儿也去不了。如果他们开始这样对你,就走开,做一个更大的人。不幸的是,如果你的团队中有一个人完全是个混蛋,不听道理,那么除了尽量避开他们,你真的什么也做不了。在某些情况下,你可能不得不和更高层的人交谈。不过,我还是建议先和那个人谈谈。
#7 Not Learning From Mistakes
So being a developer, you’re going to make a ton of mistakes. It’s inevitable and there’s nothing wrong with that. There is a problem if you keep making the same mistakes and you don’t learn from them. The process I would suggest when you make a mistake is to figure out what the ultimate cause of the mistake was, figure out if there could a process be put in place to prevent it from happening again and then figure out if the mistake had been found sooner could you have prevented the consequences? If you think about these 3 things when you make a fairly big mistake, chances are it won’t happen again or at least you’ll catch it sooner. Also, don’t be too hard on yourself for making mistakes. It happens to the best of us.
#7 没有从错误中吸取教训
所以作为一个开发者,你会犯很多错误。这是不可避免的,这没有错。如果你一直犯同样的错误,却没有从中吸取教训,那就有问题了。当你犯错误时,我建议的过程是找出错误的最终原因是什么,找出是否有一个过程可以防止它再次发生,然后找出错误是否被发现得更快你能阻止后果吗?当你犯了一个相当大的错误时,如果你想到这三件事,很有可能它不会再发生,或者至少你会更快地抓住它。另外,不要因为犯错误而对自己太苛刻。这发生在我们最好的人身上。
#8 Giving Up Too Soon
Frustration is a huge part of programming. I’ve made a couple videos on frustration and dealing with some of the issues that arise in both projects and learning. I’ve seen many people give up too soon in both specific projects and on programming in general due to frustration. Some projects are really difficult and it seems once you fix something it causes another thing to break and it just keeps happening. You may start to think you’re in over your head, you could be doing something else, you’re loosing money and many other negative thoughts. If you give up to soon though and you scrap the project or you quit your job, then everything you put into that project or job was for nothing. I’m not saying there aren’t projects that should be given up on but I’ve seen it many times where people have given up and from an outsiders point of view I could tell if they stuck with it for just a little longer, it probably would have been successful. So before you give up on anything, make sure you’ve exhausted all routes. You've searched up and down, asked for help, started over trying something different, maybe using a different technology, taken a long break to get your thoughts back in order, maybe even putting it to the side for a bit if possible. You want to do absolutely everything you can before quitting. If you still are failing, then maybe it is time to move on, but all avenues should be taken before that happens. Success could be right around the corner and it would be a shame if you gave up just before that turn.
#8 过早轻易放弃
挫折感是编程的重要组成部分。我制作了一些关于挫折感的视频,以及处理项目和学习中出现的一些问题。我看到很多人因为沮丧而过早地放弃了具体的项目和编程。有些项目真的很难,似乎一旦你修复了一些东西,它会导致另一件事打破,它只是不断发生。你可能会开始认为你是在你的头上,你可能在做其他事情,你正在失去金钱和许多其他消极的想法。如果你很快就放弃了,放弃了这个项目或者辞职了,那么你投入到这个项目或者工作中的一切都是徒劳的。我并不是说没有项目应该放弃,但我见过很多次人们放弃了,从局外人的角度看,我可以看出,如果他们坚持一段时间,可能会成功。所以在你放弃任何东西之前,确保你已经用尽了所有的路线。你上下搜索,寻求帮助,开始尝试一些不同的东西,也许使用不同的技术,休息很长时间让你的思想恢复正常,如果可能的话,甚至可以把它放到一边。你想在辞职之前尽你所能。如果你仍然在失败,那么也许是时候继续前进了,但在这之前,所有的途径都应该采取。成功就在眼前,如果你在转弯前就放弃了,那就太可惜了。
#9 Being A Know It All
So I talked a little about arrogant developers earlier and I think what makes many of them arrogant is that they think they know it all. They don’t listen to other developers because why would they, they already have all the answers. Being this way sucks for the people that are around you and it also hurts yourself because if you think you know it all, your not actively learning more and bettering yourself and I guarantee you’ll have a horrible wake up call someday when something goes really wrong because you failed to listen to anyone else and or do your research. Most of these guys are the trolls on Stack Overflow that will make fun of a new developer asking a question or make fun of someone else’s answer, down voting every chance they get. I have a deep annoyance for these people. I think many of them got picked on in school and they use their knowledge to now pick on other developers that may be having issues or aren’t getting something. They seem to forget how it felt for them to be picked on and want revenge. I could be wrong but that’s my theory. Regardless of why they do it, I think that if they were more open minded and welcomed in the ideas of others and respected others, they would be much happier than just always trying to be right. They could be the smartest person on a team but also the worst person on the team, because nobody wants to work with them and there’s no good communication going on. For a team to be successful, there needs to be communication and unity and being a know it all, just destroys that. So if this is you, try and take the stick out of your ass and be a bit more open minded and more respectful, you’ll go further in life.
#9 做一个无所不知的人
所以我之前谈到了一些傲慢的开发人员,我认为他们中的许多人之所以傲慢,是因为他们认为自己无所不知。他们不听其他开发人员的话,因为他们已经有了所有的答案。这样做对你周围的人来说很糟糕,也会伤害到你自己,因为如果你认为自己无所不知,你没有积极地学习更多知识,提高自己,我保证有一天,当你因为听不进别人的话或做不到自己的研究而出了问题的时候,你会被可怕的唤醒。他们中的大多数人都是栈溢出的巨魔,他们会取笑一个新开发人员问问题或者取笑其他人的答案,每有机会就投反对票。我很讨厌这些人。我认为他们中的许多人在学校里被人欺负,现在他们利用自己的知识来欺负其他可能有问题或没有得到什么东西的开发人员。他们似乎忘记了被人捉弄的感觉,想要报复。我可能错了,但那是我的理论。不管他们为什么这么做,我认为如果他们思想更开放、更受他人欢迎、更尊重他人,他们会比总是试图做正确的人快乐得多。他们可能是团队中最聪明的人,但也可能是团队中最糟糕的人,因为没有人愿意和他们一起工作,也没有良好的沟通。一个团队要想成功,需要沟通和团结,成为一个无所不知的人,只会毁掉这一切。所以,如果这是你,试着把棍子从你的屁股里拿出来,更开放一点,更尊重一点,你会在生活中走得更远。
#10 Not Taking Constructive Criticism
Ok, so number 10 is sort of related to the last one and it’s not being able to take constructive criticism. There’s a big difference between a know it all troll and someone that is genuinely trying to help you. Sometimes it’s hard to see the difference because having someone point something out to you that you did wrong or you could’ve done better, doesn’t feel good and may feel like an attack but a lot of the time it’s not, it’s just someone that is showing you a better way or just sharing an opinion. It took me a while as a content creator to figure out the difference of who is trolling and who is helping. At first I found myself being defensive to anyone that said anything about how I did something. But I realized that many of these people are legitimately just trying to help. If they aren’t being disrespectful or just nit picky over something that doesn’t really matter and is just preference, then I need to take it as something that can benefit me and my knowledge on whatever it is. Constructive criticism is a fantastic resource for learning, and the reason for that is because it’s targeted. It’s something that you are directly having issues with and someone is offering a specific solution. That’s invaluable. In fact code reviews are great because you get other peoples suggestions and influence on your code and how you can improve it and better yourself. So don’t take things personal unless you are actually being attacked or intentionally made fun of and disrespected. It’s hard to hear that you were wrong or you could do better but ultimately it’s going to make you a better developer.
I hope this advice helps some of you who are both new to development as well as seasoned developers.
#10 不接受建设性批评
好吧,那么第10个和最后一个有点关联,它不能接受建设性的批评。一个无所不知的巨魔和一个真心想帮助你的人之间有很大的区别。有时很难看出区别,因为有人向你指出你做错了什么,或者你本可以做得更好,感觉不好,可能感觉像是攻击,但很多时候不是,只是有人在向你展示更好的方式或只是分享意见。作为一个内容创造者,我花了一段时间才弄清楚谁在玩游戏,谁在帮我。一开始我发现自己对任何人说我是怎么做的都是防御性的。但我意识到,这些人中的许多人只是在试图帮助别人。如果他们不是不尊重或只是吹毛求疵的东西,其实并不重要,只是偏好,那么我需要把它作为一个东西,可以受益于我和我的知识,无论是什么。建设性批评是一种极好的学习资源,其原因在于它的针对性。这是你直接遇到的问题,有人提出了具体的解决方案。这是无价的。事实上,代码评审是很好的,因为你得到了其他人的建议和对你的代码的影响,以及你如何改进它和提高自己。所以,除非你真的受到攻击或故意取笑和不尊重,否则不要把事情放在个人身上。很难听到你错了,或者你可以做得更好,但最终它会让你成为一个更好的开发人员。
我希望这个建议能帮助你们中的一些人,他们既是开发新手,又是经验丰富的开发人员。