解决Javascript疲劳的方法-以及其他所有疲劳
Learn your fundamentals, and never worry again.
了解您的基礎(chǔ)知識,再也不用擔(dān)心。
新工具讓我擔(dān)心 (New Tools Worry Me)
When JavaScript's shiny tool of the day comes out, I sometimes overreact.
當(dāng)JavaScript一天一度的閃亮工具問世時(shí),我有時(shí)React過度。
And after 15 minutes of my imagination running wild, the urge to explore it becomes unbearable.
經(jīng)過15分鐘的想象力狂奔之后,去探索它的渴望變得難以忍受。
Doesn't matter what tool, it's all the same story.
不管使用哪種工具,都是一樣的故事。
- I must learn this technology! 我必須學(xué)習(xí)這項(xiàng)技術(shù)!
- I need every advantage in this competitive job market! 在這個(gè)競爭激烈的就業(yè)市場中,我需要一切優(yōu)勢!
- I have to stay relevant, right?! 我必須保持相關(guān)性,對吧?
Well yes, but no.
是的,但是沒有。
我的前輩從不擔(dān)心 (My Seniors Never Worry)
Sometimes I'll share this sentiment with senior developers in the office, and get a standard reaction from them.
有時(shí),我會(huì)與辦公室的高級開發(fā)人員分享這種想法,并從他們那里得到標(biāo)準(zhǔn)的回應(yīng)。
After enough encounters like this, I began thinking...
經(jīng)過如此多次的相遇之后,我開始思考...
為什么會(huì)有所不同? (Why the Difference?)
Why do I anxiously pounce on today's top tool, seemingly doomed to repeat this forever...
為什么我急切地挑戰(zhàn)今天的頂級工具,似乎注定要永遠(yuǎn)重復(fù)下去……
While my seniors calmly let the JavaScript storms pass, picking tools up as needed?
當(dāng)我的前輩冷靜地讓JavaScript風(fēng)暴過去時(shí),可以根據(jù)需要選擇工具嗎?
It's because they see common threads among these tools. To them, even after all these years, the landscape isn't so different.
這是因?yàn)樗麄兛吹搅诉@些工具之間的共同點(diǎn)。 對于他們來說,即使經(jīng)過了這些年,情況也沒有太大不同。
Where do these common threads come from? The fundamentals.
這些通用線程從何而來? 基本面。
一切都在基礎(chǔ) (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.
我遇到的最好的開發(fā)人員并沒有被JavaScript的光速演進(jìn)所分階段。 他們并沒有因?yàn)镴avaScript疲勞而筋疲力盡,因?yàn)樗麄兺顺隽吮荣悺?
Instead of learning frameworks to boost their careers, they focused on the fundamentals and skyrocketed their careers.
他們沒有學(xué)習(xí)促進(jìn)職業(yè)發(fā)展的框架,而是專注于基礎(chǔ)知識并推動(dòng)了職業(yè)的飛速發(fā)展。
Your favorite framework can plummet one day, and you'll eventually have to pick up another one.
您最喜歡的框架可能會(huì)在一天內(nèi)暴跌,最終您將不得不選擇另一框架。
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.
但是基本面是常綠的。 它們可以追溯到幾十年前的計(jì)算機(jī)科學(xué)資源。 無論年齡多大,這些原則仍然構(gòu)成了計(jì)算的基礎(chǔ)。
This tweet I stumbled across sums it up perfectly.
我偶然發(fā)現(xiàn)的這個(gè)推文完美地總結(jié)了它。
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年代閱讀計(jì)算機(jī)論文,就像在考古現(xiàn)場中挖掘并找到聲音螺絲刀一樣。
--= fogus =-(@fogus)June 4, 2019
2019年6月4日
We're all just building on the groundwork established a long, long time ago.
我們都只是建立在很久以前建立的基礎(chǔ)上。
什么是基本原理? (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.
這不是一個(gè)完整的列表,但是解決它的人將成為一個(gè)了不起的程序員。 它將使您在接下來的幾年中保持忙碌狀態(tài)。
- Learning multiple programming languages 學(xué)習(xí)多種編程語言
- Algorithms and data structures 算法和數(shù)據(jù)結(jié)構(gòu)
- Design patterns 設(shè)計(jì)模式
- Anti-patterns 反模式
- Application architecture 應(yīng)用架構(gòu)
學(xué)習(xí)多種編程語言 (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,請通過學(xué)習(xí)C#感到不舒服。 如果您真的想推動(dòng)自己,請嘗試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.
比較每種語言提供的解決方案。 您處理的越多,學(xué)習(xí)新事物的速度就越快,因?yàn)樗鼈兿嗷ソ梃b。
算法和數(shù)據(jù)結(jié)構(gòu) (Algorithms and data structures)
People love hating on this topic.
人們喜歡這個(gè)話題。
- "When will I need this?" “我什么時(shí)候需要這個(gè)?”
- "This is useless." “這沒用。”
- "CS degrees are a waste of money." “ CS學(xué)位是浪費(fèi)金錢。”
You may never need them, but that doesn't make learning algorithms and data structures a bad investment.
您可能永遠(yuǎn)都不需要它們,但這不會(huì)使學(xué)習(xí)算法和數(shù)據(jù)結(jié)構(gòu)成為不良的投資。
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專業(yè)的學(xué)生,??我希望我能回去上一些CS課程,尤其是算法和數(shù)據(jù)結(jié)構(gòu)。 學(xué)習(xí)它們后,我感到的力量是驚人的。 就像戴上你不知道的眼鏡一樣!
The biggest benefit, in my opinion, is improved problem-solving skills.
我認(rèn)為最大的好處是提高了解決問題的能力。
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.
冷靜下來,走到筆記本/白板上并努力尋求解決方案的能力是一項(xiàng)資產(chǎn),可為您節(jié)省無數(shù)小時(shí)的沮喪黑客攻擊。
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.
在那之前,我像經(jīng)典的編碼牛仔一樣奔向編輯器,將自己編碼到一個(gè)角落, 然后嘗試找出一個(gè)好的解決方案。
設(shè)計(jì)模式 (Design patterns)
From Addy Osmani's brilliant book- Learning JavaScript Design Patterns
摘自Addy Osmani的精彩著作-學(xué)習(xí)JavaScript設(shè)計(jì)模式
A pattern is a reusable solution that can be applied to commonly occurring problems in software design...
模式是一種可重用的解決方案,可以應(yīng)用于軟件設(shè)計(jì)中常見的問題。
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.
這些經(jīng)過考驗(yàn)的解決方案經(jīng)受了時(shí)間的考驗(yàn)。 學(xué)習(xí)它們可以幫助您編寫對其他開發(fā)人員更熟悉和可維護(hù)的代碼。
You may not have realized it, but modern JavaScript stacks leverage popular design patterns.
您可能沒有意識到,但是現(xiàn)代JavaScript堆棧利用了流行的設(shè)計(jì)模式。
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模式發(fā)送和接收“通知”。
Libraries like React-Redux and Recompose let you enhance your components, otherwise known as the Decorator pattern.
像React-Redux和Recompose這樣的庫使您可以增強(qiáng)組件,也稱為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.
如果設(shè)計(jì)模式是如此之好以至于我們應(yīng)該共享它們,那么反模式就如此之差以至于我們應(yīng)該警告它們。
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... 使用內(nèi)聯(lián)JavaScript。 例如...
應(yīng)用架構(gòu) (Application architecture)
Here's where the acronyms go crazy
這是縮寫詞發(fā)瘋的地方
- MVC (Model-View-Controller) MVC(模型-視圖-控制器)
- MVP (Model-View-Presenter) MVP(模型視圖呈現(xiàn)器)
- 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.
他們共同的核心是分開您的關(guān)注點(diǎn) 。 大多數(shù)應(yīng)用程序都具有模型(數(shù)據(jù))和視圖(UI),并且重要的是它們彼此之間不要講話。 那是控制器所在的位置,它可以調(diào)解其來回通信。
摘要-工具很棒?? (Summary - Tools Are Amazing ??)
A true marvel of software engineering. Increase your productivity by learning and enjoying them!
軟件工程的真正奇跡。 通過學(xué)習(xí)和享受它們來提高生產(chǎn)力!
But don't forget your fundamentals.
但不要忘記您的基本知識。
- Learning multiple programming languages 學(xué)習(xí)多種編程語言
- Algorithms and data structures 算法和數(shù)據(jù)結(jié)構(gòu)
- Design patterns 設(shè)計(jì)模式
- Anti-patterns 反模式
- Application architecture 應(yīng)用架構(gòu)
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)框架是一棵巨大的樹的葉子,這棵樹叫做“計(jì)算機(jī)科學(xué)”。研究🌲不僅要研究to,還要深深扎根您作為軟件開發(fā)人員的基礎(chǔ)。很快,您將連接很多點(diǎn),以至于“新”技術(shù)不會(huì)嚇到您。你了。
-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.
有關(guān)此類的更多內(nèi)容,請?jiān)L問https://yazeedb.com 。 并且,請讓我知道您還想看到什么! 我的DM在Twitter上打開。
Until next time!
直到下一次!
翻譯自: https://www.freecodecamp.org/news/the-cure-to-js-fatigue/
總結(jié)
以上是生活随笔為你收集整理的解决Javascript疲劳的方法-以及其他所有疲劳的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 梦到几口棺材是什么征兆
- 下一篇: 做梦梦到别人掉水里了是什么预兆