Learn your fundamentals, and never worry again.
了解您的基礎知識,再也不用擔心。
新工具讓我擔心 (New Tools Worry Me)
When JavaScript's shiny tool of the day comes out, I sometimes overreact.
當JavaScript一天一度的閃亮工具問世時,我有時React過度。
And after 15 minutes of my imagination running wild, the urge to explore it becomes unbearable.
經過15分鐘的想象力狂奔之后,去探索它的渴望變得難以忍受。
Doesn't matter what tool, it's all the same story.
不管使用哪種工具,都是一樣的故事。
- I must learn this technology! 我必須學習這項技術!
- I need every advantage in this competitive job market! 在這個競爭激烈的就業市場中,我需要一切優勢!
- I have to stay relevant, right?! 我必須保持相關性,對吧?
Well yes, but no.
是的,但是沒有。
我的前輩從不擔心 (My Seniors Never Worry)
Sometimes I'll share this sentiment with senior developers in the office, and get a standard reaction from them.
有時,我會與辦公室的高級開發人員分享這種想法,并從他們那里得到標準的回應。
After enough encounters like this, I began thinking...
經過如此多次的相遇之后,我開始思考...
為什么會有所不同? (Why the Difference?)
Why do I anxiously pounce on today's top tool, seemingly doomed to repeat this forever...
為什么我急切地挑戰今天的頂級工具,似乎注定要永遠重復下去……
While my seniors calmly let the JavaScript storms pass, picking tools up as needed?
當我的前輩冷靜地讓JavaScript風暴過去時,可以根據需要選擇工具嗎?
It's because they see common threads among these tools. To them, even after all these years, the landscape isn't so different.
這是因為他們看到了這些工具之間的共同點。 對于他們來說,即使經過了這些年,情況也沒有太大不同。
Where do these common threads come from? The fundamentals.
這些通用線程從何而來? 基本面。
一切都在基礎 (It's All in the Fundamentals)
The best developers I've met aren't phased by JavaScript's light-speed evolution. They aren't exhausted from JavaScript fatigue because they dropped out of that race.
我遇到的最好的開發人員并沒有被JavaScript的光速演進所分階段。 他們并沒有因為JavaScript疲勞而筋疲力盡,因為他們退出了比賽。
Instead of learning frameworks to boost their careers, they focused on the fundamentals and skyrocketed their careers.
他們沒有學習促進職業發展的框架,而是專注于基礎知識并推動了職業的飛速發展。
Your favorite framework can plummet one day, and you'll eventually have to pick up another one.
您最喜歡的框架可能會在一天內暴跌,最終您將不得不選擇另一框架。
But the fundamentals are evergreen. They date back to computer science resources from decades ago. No matter the age, these principles still make up the foundation of computing.
但是基本面是常綠的。 它們可以追溯到幾十年前的計算機科學資源。 無論年齡多大,這些原則仍然構成了計算的基礎。
This tweet I stumbled across sums it up perfectly.
我偶然發現的這個推文完美地總結了它。
Reading computing papers from the 50s, 60s, and 70s is like digging in an archeological site and finding a sonic screwdriver.
— -=fogus=- (@fogus)從50年代,60年代和70年代閱讀計算機論文,就像在考古現場中挖掘并找到聲音螺絲刀一樣。
--= fogus =-(@fogus)June 4, 2019
2019年6月4日
We're all just building on the groundwork established a long, long time ago.
我們都只是建立在很久以前建立的基礎上。
什么是基本原理? (What Are the Fundamentals?)
This isn't a comprehensive list, but whoever tackles it will become an amazing programmer. It'll keep you busy for years to come.
這不是一個完整的列表,但是解決它的人將成為一個了不起的程序員。 它將使您在接下來的幾年中保持忙碌狀態。
- Learning multiple programming languages 學習多種編程語言
- Algorithms and data structures 算法和數據結構
- Design patterns 設計模式
- Anti-patterns 反模式
- Application architecture 應用架構
學習多種編程語言 (Learning multiple programming languages)
Languages solve problems in different ways. None of them are perfect, that's why we have so many.
語言以不同的方式解決問題。 他們都不是完美的,這就是為什么我們有那么多。
If you're doing JavaScript, get uncomfortable by learning C#. If you really want to push yourself, try Haskell.
如果您使用的是JavaScript,請通過學習C#感到不舒服。 如果您真的想推動自己,請嘗試Haskell。
Compare the solutions each language offers. The more you tackle, the faster you'll learn new things because they all draw from each other.
比較每種語言提供的解決方案。 您處理的越多,學習新事物的速度就越快,因為它們相互借鑒。
算法和數據結構 (Algorithms and data structures)
People love hating on this topic.
人們喜歡這個話題。
- "When will I need this?" “我什么時候需要這個?”
- "This is useless." “這沒用。”
- "CS degrees are a waste of money." “ CS學位是浪費金錢。”
You may never need them, but that doesn't make learning algorithms and data structures a bad investment.
您可能永遠都不需要它們,但這不會使學習算法和數據結構成為不良的投資。
As an IT major, part of me wishes I could go back and take some CS courses, especially algorithms and data structures. The power I felt after learning them was amazing. It's like putting on glasses you never knew you had!
作為IT專業的學生,??我希望我能回去上一些CS課程,尤其是算法和數據結構。 學習它們后,我感到的力量是驚人的。 就像戴上你不知道的眼鏡一樣!
The biggest benefit, in my opinion, is improved problem-solving skills.
我認為最大的好處是提高了解決問題的能力。
The ability to calm down, walk to a notebook/whiteboard, and work towards a solution is an asset that'll save you countless hours of frustrated hacking.
冷靜下來,走到筆記本/白板上并努力尋求解決方案的能力是一項資產,可為您節省無數小時的沮喪黑客攻擊。
Before that I'd gallop into the editor like a classic coding cowboy, code myself into a corner, and then try to figure out a good solution.
在那之前,我像經典的編碼牛仔一樣奔向編輯器,將自己編碼到一個角落, 然后嘗試找出一個好的解決方案。
設計模式 (Design patterns)
From Addy Osmani's brilliant book- Learning JavaScript Design Patterns
摘自Addy Osmani的精彩著作-學習JavaScript設計模式
A pattern is a reusable solution that can be applied to commonly occurring problems in software design...
模式是一種可重用的解決方案,可以應用于軟件設計中常見的問題。
These battle-tested solutions have stood the test of time. Learning them helps you write code that is more familiar and maintainable to other developers.
這些經過考驗的解決方案經受了時間的考驗。 學習它們可以幫助您編寫對其他開發人員更熟悉和可維護的代碼。
You may not have realized it, but modern JavaScript stacks leverage popular design patterns.
您可能沒有意識到,但是現代JavaScript堆棧利用了流行的設計模式。
Bundlers like Webpack and Parcel let you use the Module pattern to separate JavaScript into organized files.
諸如Webpack和Parcel之類的捆綁軟件可讓您使用“ 模塊”模式將JavaScript分成組織好的文件。
Libraries like RxJS and Redux use the Observer pattern to send and receive "notifications".
RxJS和Redux之類的庫使用Observer模式發送和接收“通知”。
Libraries like React-Redux and Recompose let you enhance your components, otherwise known as the Decorator pattern.
像React-Redux和Recompose這樣的庫使您可以增強組件,也稱為Decorator模式 。
反模式 (Anti-patterns)
If design patterns are so good that we should share them, anti-patterns are so bad that we should warn against them.
如果設計模式是如此之好以至于我們應該共享它們,那么反模式就如此之差以至于我們應該警告它們。
Pulling from Addy Osmani's book again, here are some common JavaScript anti-patterns.
再次從Addy Osmani的書中摘錄,這里是一些常見JavaScript反模式。
- Defining many global variables 定義許多全局變量
Modifying the
Object
class prototype修改
Object
類原型Using
document.write
使用
document.write
- Using inline JavaScript. For example... 使用內聯JavaScript。 例如...
<!-- Inline JavaScript anti-pattern -->
<a href="#" onclick="alert('Hi')">Click Me</a>
應用架構 (Application architecture)
Here's where the acronyms go crazy
這是縮寫詞發瘋的地方
- MVC (Model-View-Controller) MVC(模型-視圖-控制器)
- MVP (Model-View-Presenter) MVP(模型視圖呈現器)
- MVVM (Model-View-ViewModel) MVVM(模型-視圖-視圖模型)
- MVU (Model-View-Update) MVU(模型-視圖-更新)
- MVI (Model-View-Intent) MVI(模型-視圖-意圖)
Here's an example of MVC.
這是MVC的示例。
Their common core is separate your concerns. Most applications have a model (data) and view (UI), and it's important they not speak to each other. That's where the controller sits and it mediates their back and forth communication.
他們共同的核心是分開您的關注點 。 大多數應用程序都具有模型(數據)和視圖(UI),并且重要的是它們彼此之間不要講話。 那是控制器所在的位置,它可以調解其來回通信。
摘要-工具很棒?? (Summary - Tools Are Amazing ??)
A true marvel of software engineering. Increase your productivity by learning and enjoying them!
軟件工程的真正奇跡。 通過學習和享受它們來提高生產力!
But don't forget your fundamentals.
但不要忘記您的基本知識。
- Learning multiple programming languages 學習多種編程語言
- Algorithms and data structures 算法和數據結構
- Design patterns 設計模式
- Anti-patterns 反模式
- Application architecture 應用架構
I leave you with one last tweet.
我最后一條推文給你。
Frameworks are the leaves of an enormous tree called Computer Science.Study the 🌲, not just the 🍃, to deeply root your foundation as a software developer.Soon enough, you’ll connect so many dots that “new” tech won’t scare you anymore.
— Yazeed Bzadough (@yazeedBee)框架是一棵巨大的樹的葉子,這棵樹叫做“計算機科學”。研究🌲不僅要研究to,還要深深扎根您作為軟件開發人員的基礎。很快,您將連接很多點,以至于“新”技術不會嚇到您。你了。
-Yazeed Bzadough(@yazeedBee)August 14, 2019
2019年8月14日
謝謝閱讀 (Thanks for reading)
For more content like this, check out https://yazeedb.com. And please let me know what else you'd like to see! My DMs are open on Twitter.
有關此類的更多內容,請訪問https://yazeedb.com 。 并且,請讓我知道您還想看到什么! 我的DM在Twitter上打開。
Until next time!
直到下一次!
翻譯自: https://www.freecodecamp.org/news/the-cure-to-js-fatigue/