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/