开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
今日推荐开源项目:《Python 程序大全 awesome-python-applications》
今日推荐英文原文:《Frameworks VS. Fundamentals》

今日推荐开源项目:《Python 程序大全 awesome-python-applications》传送门:GitHub链接
推荐理由:一个好的开源 Python 程序集合,它们不仅可以拿来用,而且可以作为借鉴的对象。一个可以正常运作的程序可以成为我们开发过程中的借鉴对象,兴许你在使用 Python 开发软件的时候可以在这里面寻找同类型的进行借鉴来解决遇上的问题,这会比去 Google 的海洋里寻找答案要来的容易些。
今日推荐英文原文:《Frameworks VS. Fundamentals》作者:Dose of Ted
原文链接:https://medium.com/@doseofted/frameworks-vs-fundamentals-3bfeac80b1c6
推荐理由:先学习框架还是先学习基础知识,这是个问题

Frameworks VS. Fundamentals

If you’ve checked Twitter lately, it’s hard to not have a stance on whether or not developers should be learning frameworks first or language fundamentals first (Twitter thread here) if you are a developer. With that said, and considering I’ve spent a lot of time learning fundamentals myself, I’d like to offer my opinion on the topic.

TL;DR: it doesn’t really matter but your life will be easier with the basic fundamentals. However, there’s a lot more to this that can’t be summed up in a single paragraph. So, I’d like to offer my opinion of the topic as a current Computer Science student so that I can decide for myself which is better and how I should learn in the future. How I Learned (not how everyone else should learn)

I’ve been interested in computers for as long as I can remember but didn’t start learning to program until a teacher of mine in middle school gave me his old Computer Science textbook back when he thought he was going to become a game developer (he was a student teacher for my science class). I learned the very basics of the C++ language including functional and object-oriented programming, functions, classes, pointers, pointers to pointers, pointers to pointers to … you get the idea: the boring stuff, as opposed to the fun things that I can make now. The next year, I ditched C++ in favor of JavaScript and the occasional Bash scripting (I made themes in Cydia, back when that was a thing). After that, I went to school and switched majors to Computer Science in my sophomore year. I had to sit through the basic classes again with topics that I already learned in middle school (yawn) but I also learned some useful algorithms and practices that software developers should follow. These past two years, I have taught myself more fundamentals related to Java, Swift, and C#. Mostly C#.

Fundamentals are key, right?
In short: only partially. I learned a lot about the fundamentals but I didn’t do much with them. Sure, I made a few console programs and I made programs that I thought were cool as a beginner but beyond sitting on my own computer, occasionally opening them up in free time, they didn’t serve much of a purpose other than to show that I’ve learned the fundamentals. Otherwise, they collected dust. I suppose that almost every beginner’s programs do the same even if they choose to learn frameworks first but when we start building programs, we have to understand what they do and if we encounter an issue, and we will, then how do we approach solving it? You have to know the fundamentals. Fundamentals are key and allow us to build better apps. It allows us to debug easier and have an actual understanding of our application or web page.

However, not all fundamentals will serve us well. I’ve learned a lot of the “fundamentals” when it comes to ECMAScript 6 based JavaScript and while what I’ve learned is useful and saves me time, I could easily get by without knowing a thing about it and could even use super old ECMAScript 3 based JavaScript.

I could take this a step further and say that I may be able to use a front-end framework without knowing all of the fundamentals. I could use a library like jQuery or Zepto without needing to know basic DOM interaction (although using them will expose you to the basics). Maybe I could use React and a UI library without knowing much about HTML (not that there’s much to know). I could learn to use Bootstrap framework for styling instead of learning CSS first. We could possibly build better and more useful apps by just learning the basics as we go. The problem with this is when we encounter a problem in code. This is when it pays to knows the basics first because you can more easily find the problem.

While it pays to know the fundamentals, sometimes the fundamentals and certain frameworks go hand-in-hand to make something useful and sometimes a language itself is pointless without certain frameworks.
Everything is a Framework

Try making a user interface without using a single framework. If you program in C, then GTK+ is out. Can’t we use OpenGL? Framework. Okay, can’t we use the X library (if we really hate ourselves)? I think to an extent, we could call this a framework. The same applies to web development, more so even. When using JavaScript, there are countless frameworks for front-end development where frameworks last a year or two before we decide they’re not “cool” anymore (exaggerating a bit, of course many are still used). The bare minimum tools needed to build a website are basic HTML and vanilla JavaScript where we use the set of APIs (you could call a framework) provided to us by the browser.

My point is that we abstract away from the fundamentals and to build anything useful: there’s a framework needed. We don’t use assembly or binary. We don’t build all of the code that we need. We use higher-level languages and code built by others to build something useful. When learning the basics, it’s impossible not to use a framework because some of these lower-level frameworks, as I call them, are often closely related to the basics. We all build off of each other’s work.

Anyway, back to the topic at hand, this discussion about whether you should learn a framework or the basics first is more about higher-level frameworks that abstract so far away from system or browser frameworks that you don’t need to know how they work to build something, instead you can learn as you go. In the world of web development, developers are using frameworks that abstract far from the basic browser APIs. These frameworks are so abstracted away from browser APIs that developers can sometimes use them without needing to know some basics about browser-given APIs. So, do you still need the basics of JavaScript and browser APIs if you can get the general gist of things by learning a framework? For small applications used for a short period of time or for basic websites: maybe not. The problem is when we build large applications and then come across a problem. Sometimes fixing a problem involves more than fixing our code to run a framework. Sometimes these problems involve the fundamentals. While we can learn the fundamentals as we learn frameworks, if we had learned the fundamentals first then we would be able to solve these issues much faster.

Time is Our Most Valuable Asset

The most important takeaway from this topic is that our time is limited and we need to learn what we need to know as fast as we can so that we can make something useful. The question is: how do we get there? Of course, we’ll all take our own different path but I think that the correct choice is to choose balance. It is important to know the fundamentals. I don’t think anyone is arguing against them but learning how to use a library by itself is confusing when you need to do anything more than the basics and there are not many programmers who are paid to make programs that say “hello world” in a console window or a basic HTML page. In order to do anything with a framework, we need to know the basics and sometimes convoluting the basics of a language with a framework make understanding what you’re coding much more difficult and take even more time, especially when debugging.

That’s not to say that it can’t be done. Back when I was in middle school, jQuery may have been a fine way to introduce JavaScript rather than learning the basics. I taught myself JavaScript instead and when I look back, I may have been able to save time by just using jQuery. I taught myself basic C++ but learning C++ with the help of a framework like GTK+ (or a binding for C++) would have allowed me to build better, more useful applications faster.

The problem is that I may not be understanding what’s going on when I use these frameworks. Often times, I don’t need to know. However, I need to know some of these fundamentals first so that I can learn and use these frameworks faster and debug potential problems related to me not knowing the basics.

I think it’s important to have a strong foundation to build on top of but you can also learn a framework first and come across the fundamentals along the way and become an excellent developer that way. However, if you want to learn to develop software as fast as you can without wasting time then the very basic fundamentals should be learned first without frameworks. After the basics, learning frameworks becomes easier because you can relate concepts back to the basics. Using a framework, we don’t have to understand everything that’s going on (that’s sort of the point) but we need to understand it on some level and with the fundamentals, that will be easier.

I’m only a CS student offering another limited opinion but if you’re building a house on rocky foundation, that house won’t be there long but with a strong foundation it can stand for many, many years.
下载开源日报APP:https://openingsource.org/2579/
加入我们:https://openingsource.org/about/join/
关注我们:https://openingsource.org/about/love/