電子工程師自學成才pdf
by Ali Spittel
通過Ali Spittel
給新開發人員的最佳建議:自學成才的軟件工程師的建議 (My best tips for new developers: advice from a (mostly) self-taught software engineer)
The most common question I get from blog readers is “What is your advice for new programmers?” So, I thought it was time to write up my thoughts.
我從博客讀者那里得到的最常見問題是“您對新程序員有何建議?” 因此,我認為是時候寫下我的想法了。
I will write up my full story in the future, but I took two computer science classes in college. Then, I got a software engineering internship shortly after. I started doing web development work. Initially, I worked on the backend and then eventually on the frontend. My college definitely did not teach web development in those first few computer science classes, so I taught myself.
將來我會寫完整的故事,但是我在大學上了兩門計算機科學課。 然后,不久之后我獲得了軟件工程實習機會。 我開始進行Web開發工作。 最初,我在后端工作,然后在前端工作。 我的大學在最初的幾門計算機科學課程中絕對沒有教授Web開發,所以我自學了。
I don’t think my story is unique. All programmers are self-taught to some degree, whether they’re fully self-taught or have a masters in computer science. Everyone has taught themselves something like RegEx along the way. In fact, self-teaching may be one of the most important skills you can have as a developer.
我認為我的故事不是獨一無二的。 無論是完全自學還是擁有計算機科學碩士學位,所有程序員在某種程度上都是自學成才的。 在此過程中,每個人都自學了諸如RegEx之類的東西。 實際上,自我教學可能是您作為開發人員可以擁有的最重要的技能之一。
In addition to my own experience, I also teach people to code as my primary job and for organizations I volunteer with. So this article is drawing on that experience as well.
除了我自己的經驗之外,我還教人們將編碼作為我的主要工作以及與志愿服務的組織的代碼。 因此,本文也借鑒了這種經驗。
So here are my tips for getting started.
因此,這是我的入門提示。
給新程序員的提示 (My Tips for New Programmers)
1.有你的理由,并記住它 (1. Have your reason, and remember it)
If you want to start programming, there has to be a reason for that. That reason can be you love writing code or that you want to have a more lucrative career. It could be that you are doing a bunch of Excel work and you want to make that more efficient.
如果要開始編程,則必須這樣做。 原因可能是您喜歡編寫代碼,還是想要擁有一個更有利可圖的職業。 可能是您正在做大量的Excel工作,而您想提高效率。
Keep track of that reason. Programming is hard, and you will get frustrated sometimes. It is essential to keep that reason in mind and to stick with it. You could put a sticky note on your computer or a note on your home screen. Or (like me) write it on your mirror with a dry erase marker.
跟蹤該原因。 編程很難,有時您會感到沮喪。 必須牢記這一理由并堅持下去。 您可以在計算機上貼便利貼,也可以在主屏幕上貼便利貼。 或者(像我一樣)用干擦標記筆將其寫在鏡子上。
2.夯實基礎 (2. Build a solid foundation)
This may be a less common piece of advice, but I think its really helpful. Before you start writing code, if you haven’t looked at math in a while, I would revisit the concepts from Algebra 1. Programming is built on Algebra 1 math, like functions and variables. Understanding these concepts outside of programming will be super valuable in the future. I recommend Khan Academy’s Algebra 1 course!
這可能是一條不太常見的建議,但我認為它確實很有幫助。 在開始編寫代碼之前,如果您有一段時間沒有看過數學了,那么我將重溫Algebra 1的概念。編程基于Algebra 1數學,例如函數和變量。 在編程之外理解這些概念將在將來變得非常有價值。 我推薦可汗學院的代數1課程!
let x = 1; // conceptually the same as algebraic variables!
function add (x, y) { // the same as algebraic functions! return x + y}
3.尋找一個社區 (3. Find a community)
Finding a community to support you as you start writing code will be helpful. This community will be valuable, because other people will be in the same place as you. They can offer resources that helped them and offer encouragement.
在開始編寫代碼時,找到一個可以支持您的社區會很有幫助。 這個社區將很有價值,因為其他人將與您同在一個地方。 他們可以提供幫助他們的資源并提供鼓勵。
I would suggest finding a meetup in your area as the top solution here. Even small cities tend to have a group somewhat nearby. If there isn’t one, I would suggest dev.to and the CodeNewbie community as two excellent alternatives. CodeNewbie has a weekly Twitter chat, a Slack group, and podcasts to listen to. Dev.to has a bunch of blog posts and a #discuss tag where you can post your questions.
我建議在您所在的地區找到一個聚會,作為這里的最佳解決方案。 即使是小城市,附近也會有一群人。 如果沒有,我建議將dev.to和CodeNewbie社區作為兩個很好的選擇。 CodeNewbie每周進行一次Twitter聊天,一個Slack組和要收聽的播客。 Dev.to有很多博客文章和#discuss標簽,您可以在其中發布問題。
4.將問題分解為較小的問題 (4. Break down problems into smaller ones)
One of the most important parts of programming is taking a large problem and breaking it into smaller and smaller pieces until those pieces are solvable. If you are looking at a blank text editor not knowing where to start, it may be because you haven’t broken down the problem enough!
編程中最重要的部分之一是解決一個大問題,并將其分解為越來越小的部分,直到這些部分可以解決為止。 如果您正在查看空白的文本編輯器,而該文本編輯器不知道從哪里開始,則可能是因為您沒有充分解決問題!
5.偽代碼 (5. Pseudocode)
Related to the previous point, a lot of times it is beneficial to write down in detail what you are trying to do in plain words before even trying to write code. This process is called pseudocoding, and it can take whatever form you want it to. It can also be helpful to solve a problem really slowly on paper first. You think about or even write down the individual steps you are going to take to solve that problem.
與上一點有關,很多時候,甚至在嘗試編寫代碼之前,用純文字詳細記錄您想做的事情都是有益的。 此過程稱為偽編碼,它可以采用您想要的任何形式。 首先在紙上慢慢地解決問題也有幫助。 您考慮甚至寫下解決該問題要采取的各個步驟。
// if the user has more than ten points// display "winner" on the page// else// keep playing
6.擁抱學習周期 (6. Embrace the cycle of learning)
If you’re learning to code as a second career, especially if you’ve been away from the classroom for a while, learning how to learn is going to be a big part of your process. There are lots of ups and downs involved, which is very natural! I would brace yourself for that rollercoaster before starting out.
如果您正在學習編碼作為第二職業,特別是如果您離開教室已有一段時間,那么學習如何學習將成為您工作的重要組成部分。 這涉及很多起伏,這很自然! 在開始之前,我會為過山車做好準備。
7.從免費資源開始 (7. Start with free resources)
There are a million and one resources for learning how to code. Some are free, and some are paid. I would start with the free resources. Make sure you like writing code first. Then after that, you could think about moving onto paid resources or even a bootcamp.
有上百萬種資源可用來學習編碼。 有些是免費的,有些是付費的。 我將從免費資源開始。 確保您喜歡先編寫代碼。 然后,您可以考慮遷移到付費資源甚至是訓練營。
8.找到你的利基 (8. Find your niche)
There are a lot of worlds within programming, so try to find one world that you love and focus on that. Instead of trying to learn 8 programming languages, frontend and backend, compiled and interpreted languages, all the text editors, developer tools, and so on, find a few things you are really interested in and get good at them.
編程中有很多世界,因此請嘗試找到您喜歡的世界,并專注于此。 不用嘗試學習8種編程語言,前端和后端,編譯和解釋語言,所有文本編輯器,開發人員工具等,而是找一些您真正感興趣并精通它們的東西。
9.善于模式識別 (9. Get good at pattern recognition)
Recognizing patterns in code is one of the most important skills you can have. When people talk about writing “DRY” code (i.e., Don’t Repeat Yourself) they are talking about reducing the patterns in your code. I recommend the game Set for pattern recognition — you can even play online each day on the New York Times’ website!
識別代碼模式是您可以擁有的最重要的技能之一。 當人們談論編寫“ DRY”代碼(即,不要重復自己)時,他們談論的是減少代碼中的模式。 我建議您使用Set Set模式識別游戲-您甚至每天都可以在《紐約時報》的網站上在線玩 !
// not DRY codelet reversedString = string.split("").reverse().join("")let reversedString2 = string2.split("").reverse().join("")
// cleaner code
const reverse = string => string.split("").reverse().join("")let reversedString = reverse(string)let reversedString2 = reverse(string2)
10.早點養成好習慣 (10. Make good habits early)
It will be easier to write clean code in the future if you get into the habit early. Bad habits can be hard to break. Here are my tips for writing cleaner code. If you are doing web development, running HTML and CSS validators on your code can tell you exactly what to fix!
如果您早日習慣,將來編寫干凈的代碼會更容易。 不良習慣很難克服。 這是我編寫簡潔代碼的技巧。 如果您正在進行Web開發,則在代碼上運行HTML和CSS驗證器可以確切告訴您要解決的問題!
// Not great
function avg (a) { let s = a.reduce((x, y) => x + y) return s / a.length}
// Much better!
function sumArray(array) { return array.reduce((number, currentSum) => number + currentSum)}function averageArray(array) { return sumArray(array) / array.length}
11.確定你的學習方式 (11. Identify your learning style)
Everybody learns differently. Whether you are a visual, audio, or kinesthetic learner, you learn differently than the next person. Identify how you learn best, and rely on resources that fit that style well. For example, I learn best from reading the documentation and its code examples. I lose focus easily in tutorials.
每個人的學習方式都不一樣。 無論您是視覺,聽覺還是動覺學習者,與下一個人的學習方式都不同。 確定您的最佳學習方式,并依靠適合該風格的資源。 例如,通過閱讀文檔及其代碼示例,我會學得最好。 我在教程中容易失去重點。
12.奮斗,但不要太多 (12. Struggle, but not too much)
Struggling a little bit when you are learning is really important. You want to solve the problem yourself and find an answer using resources that exist. That said, it is unproductive and demotivating to struggle with a problem for too long. After a few hours, reach out to someone for help!
在學習時奮斗一點很重要。 您想自己解決問題,并使用現有資源找到答案。 話雖如此,與問題作斗爭太長時間是無濟于事的。 幾個小時后,請與他人聯系!
13.適應失敗 (13. Get comfortable with failure)
Programming is hard, and finding the right answer won’t be immediate. One of the most pivotal moments in my programming journey was failing at writing a Sudoku solver. It can be challenging to adjust to not getting everything right away and seeing those error messages. But that is a huge part of programming.
編程很困難,而且找到正確答案并不是立竿見影的。 在我的編程旅程中最關鍵的時刻之一是未能編寫Sudoku求解器 。 進行調整以使其無法立即獲得所有內容并查看這些錯誤消息可能會具有挑戰性。 但這是編程的重要部分。
14.喜歡你的錯誤信息 (14. Love your error messages)
Error messages are super helpful! When you are starting out, that red error message can be terrifying! One huge step to take is to read through those messages, understand them, and then use them to solve the problem. In fact, you will get to a point where a program silently failing will be far more annoying than a useful error message.
錯誤消息超級有幫助! 當您剛入門時,紅色錯誤消息可能會令人恐懼! 邁出的重要一步是通讀這些消息,理解它們,然后使用它們來解決問題。 實際上,您將到達一個程序無聲失敗的地步,而不是有用的錯誤消息。
15.一些編程語言比其他編程語言容易 (15. Some programming languages are easier than others)
There isn’t a right answer for what programming language to learn first. Some will be easier to pick up. My top three are Python, Ruby, and JavaScript. I like them because they have a large community behind them, have more straightforward syntax, and are interpreted, so you don’t need to go through a compiling process.
對于首先要學習哪種編程語言,沒有正確的答案。 有些會更容易拿起。 我的前三名是Python,Ruby和JavaScript。 我喜歡它們,因為它們背后有一個龐大的社區,語法更直接,而且可以被解釋,因此您無需經過編譯過程。
16.您不需要了解所有 (16. You don’t need to know everything)
It is straight up 100% impossible to know everything about programming. Nobody knows every programming language, every single method that’s out there, every library and framework, or the perfect solution to every problem. Don’t worry about learning everything, just focus on what you do know and extend that.
完全不可能了解編程的全部知識,這是100%不可能的。 沒有人知道每種編程語言,那里的每種方法,每種庫和框架,或者對每個問題的完美解決方案。 不必擔心學習所有內容,只需專注于您所知道的知識并加以擴展即可。
17.在深度上注重深度 (17. Focus on depth over breadth)
Learning one thing in depth is better than learning a tiny bit about a lot of things, especially at first. That in-depth knowledge will carry over and make learning that next thing easier. Put the blinders on, so you don’t get tempted to drop what you’re learning and move to something new.
深入學習一件事比學習一點點很多事情要好,尤其是剛開始時。 深入的知識將延續并讓學習下一件事變得容易。 戴上遮光罩,這樣您就不會迷失掉所學的內容,而轉向新的東西。
18.首先關注基礎 (18. Focus on the fundamentals first)
The fundamentals of programming are invaluable. You will use them no matter what you end up doing with programming. Focus on having a solid knowledge of loops, conditionals, functions, data types, and (in most languages) object-oriented programming before moving on to learning about that awesome library that everyone’s talking about.
編程的基礎是無價的。 無論您最終要做什么編程,都將使用它們。 在繼續學習每個人都在談論的很棒的庫之前,請專注于對循環,條件,函數,數據類型和(在大多數語言中)面向對象編程有扎實的知識。
It will be so much easier to learn that library once you know the fundamentals really well. They will also carry over from language to language, so you only have to really learn them once. After that it’s just syntax!
一旦您非常了解基礎知識,就會更容易學習該庫。 它們還將在語言之間延續,因此您只需真正學習一次即可。 之后,這只是語法!
19.善于解決問題 (19. Get good at Problem-solving)
Problem-solving is the basis of programming! Getting better at this is critical. Solving riddles, writing code on paper, and breaking down problems can really help with problem-solving.
解決問題是編程的基礎! 做到這一點至關重要。 解決謎題,在紙上寫代碼以及解決問題確實可以幫助解決問題。
Something I sometimes see with new developers is that they approach programming like a research problem instead of a problem-solving project. If they Google something well enough, then they’ll have a solution. Yes, Google and Stack Overflow are super helpful, but rely on yourself sometimes too. Try something out a few different ways before researching it. Or, research small parts of the problem instead of the problem itself — i.e. “turn a String into an array JavaScript” instead of “reverse string JavaScript.”
我有時與新開發人員一起看到的是,他們像研究問題一樣對待編程而不是解決問題的項目。 如果他們在Google方面做得足夠好,那么他們將提供解決方案。 是的,Google和Stack Overflow很有幫助,但有時也要依靠自己。 在研究之前,請嘗試幾種不同的方法。 或者,研究問題的一小部分而不是問題本身,即“將字符串轉換為數組JavaScript”而不是“反向字符串JavaScript”。
20.善于研究 (20. Get good at researching)
One of the biggest things to learn is how to find good answers to your questions or to learn new features of your language or library. Using Google is important, so is joining communities and subscribing to resources. The Google template I normally use is “problem language/framework/library” in as few words as possible and without filler. So, “sort array JavaScript”, “spin element CSS”, or “create router Vue.”
要學習的最大的事情之一是如何找到問題的良好答案或學習語言或庫的新功能。 使用Google很重要,因此加入社區和訂閱資源也很重要。 我通常使用的Google模板是“問題語言/框架/庫”,請盡量少用單詞,并且不帶填充符。 因此,“排序數組JavaScript”,“旋轉元素CSS”或“創建路由器Vue”。
21.構建您喜歡的項目 (21. Build projects you love)
When you’re learning, you will be building various projects to practice (and show off) your skills. Pick project ideas that are interesting to you — you will be much more likely to finish them and want to put work into them. Related: complete those projects. A few really good finished projects is way more impressive than a bunch of half-finished ones!
學習時,您將構建各種項目來練習(并炫耀)您的技能。 選擇您感興趣的項目構想-您將更有可能完成并想將其付諸實踐。 相關:完成那些項目。 一些真正好的完成項目比一堆半完成的項目更令人印象深刻!
22.只與自己比較 (22. Compare yourself only to yourself)
There are a lot of people learning to code out there. Don’t compare your progress to someone else’s. Instead, compare yourself to previous you and focus on your own growth.
有很多人在那里學習編碼。 不要將您的進度與他人的進度進行比較。 相反,將自己與以前的人進行比較,并專注于自己的成長。
23.做一堆代碼挑戰 (23. Do a bunch of code challenges)
Doing quick code challenges can really help solidify the fundamentals. They are great for problem-solving and practicing for interviews. I post one on Twitter every day with the hashtag #CodingPuzzle if you want someone else to solve them with!
快速編寫代碼挑戰確實可以幫助鞏固基礎知識。 他們非常適合解決問題和進行面試。 如果您希望其他人使用它們解決問題,我每天都會在Twitter上 貼上#CodingPuzzle標簽。
"""Find the element in an array that only occurs oncefrom https://www.hackerrank.com/challenges/ctci-lonely-integer""" from collections import Counter
def lonely_integer(a): a_counter = Counter(a) for l, count in a_counter.items(): if count == 1: return l
24.慶祝勝利 (24. Celebrate your wins)
Learning to program can be a really difficult process, so when you accomplish something, even if its small, celebrate it! I keep track of my wins in Google Keep so, if I have a bad day, I can come back to those wins and remember them.
學習編程可能是一個非常困難的過程,因此,當您完成某件事時,即使它很小,也要慶祝! 我會在Google Keep中跟蹤自己的獲勝情況,因此,如果我有糟糕的一天,我可以回到那些獲勝者并記住他們。
25.編程很棒 (25. Programming is awesome)
Programming is really cool because you get to build things. I always come back to this Sandi Metz quote:
編程真的很酷,因為您可以構建東西。 我總是回到Sandi Metz的話:
Those of us whose work is to write software are incredibly lucky. Building software is a guiltless pleasure because we get to use our creative energy to get things done. We have arranged our lives to have it both ways; we can enjoy the pure act of writing code in sure knowledge that the code we write has use. We produce things that matter. We are modern craftspeople, building structures that make up present-day reality, and no less than bricklayers or bridge builders, we take justifiable pride in our accomplishments.
我們中那些致力于編寫軟件的人非常幸運。 構建軟件是一種無罪的樂趣,因為我們可以利用自己的創造力來完成任務。 我們已經安排了生活,使兩者兼得。 確保我們所編寫的代碼已被使用,我們可以享受純粹的編寫代碼的樂趣。 我們生產重要的東西。 我們是現代手Craft.io人,他們構成了當今現實的建筑,而不僅僅是瓦工或橋梁建造者,我們為自己的成就感到無比自豪。
This all programmers share, from the most enthusiastic newbie to the apparently jaded elder, whether working at the lightest weight Internet startup or the most staid, long-entrenched enterprise. We want to do our best work. We want our work to have meaning. We want to have fun along the way.
從最熱情的新手到看上去疲憊不堪的長者,所有程序員都可以共享這些資源,無論是在重量最輕的Internet初創公司還是在最穩定,根深蒂固的企業中工作。 我們要盡力而為。 我們希望我們的工作具有意義。 我們希望在旅途中玩得開心。
Sandi Metz
桑迪·梅斯(Sandi Metz)
保持聯系! (Keep in Touch!)
If you liked this article, there’s a lot more where it came from! I send out a newsletter every week with my favorite links and what I’ve written that week. You can also follow me on Twitter to see my posts as they come out!
如果您喜歡這篇文章,那么它的來源還有很多! 我每周都會發送時事通訊,其中包含我最喜歡的鏈接以及該周我寫的內容。 您也可以在Twitter上關注我 ,以查看我發布的帖子!
Originally published at zen-of-programming.com.
最初發布于zen-of-programming.com 。
翻譯自: https://www.freecodecamp.org/news/my-best-tips-for-new-developers-advice-from-a-mostly-self-taught-software-engineer-9cb2f6238177/
電子工程師自學成才pdf