`
varsoft
  • 浏览: 2503787 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

Failing To See the Big Picture - Mistakes we make when learning programming

阅读更多

Failing To See the Big Picture

Mistakes we make when learning programming

By pongba (http://blog.csdn.net/pongba)

Let’s start with an obvious fact:

The Inconvenient Human Nature, #1
People are inherently more easily attracted by “interesting” (as opposed to “mundane”) things. (We will define “interesting” in the later parts)

What can we derive from this simple axiom?

A lot of things. But since we’re talking about learning programming, we shall focus mainly on the implications it has for how we learn programming.

Programming, the interesting and the mundane

The Interesting

What was the first thing that struck you when you first learned how to program? Wasn’t it the simple fact that you could order a computer to do stuff by simply typing a bunch of characters (thinking of the “hello world” program that we all have written)? But what happened then? You (hopefully) would learn the things that happened under the hood and drove your programs, which leads us to the first point:

If it’s something under the hood, it’s interesting (therefore attracts people).

People are always curious about the forces behind the phenomenons in nature since the dawn of human civilization. There’s a need for people to seek the reason why something happened. We call it the desire to understand.

After you’ve learned how to hack up a program, and the reason why your program works all the way down to the bit level. What, then, would be the next thing you do? You write programs, and in so doing discover more and more features of your programming language, which means you get more and more familiar with your language and you start to notice the sorts of things it can do conveniently and those it can’t. That when language tricks step into the picture. Language tricks are interesting in that they enable you to do something you usually can’t do. Human beings are born problem solvers, we like solving problems just as much as we like seek out the deep reasons why stuff works. But sadly we’re also adept problem creators.

In program language sense, the problems of which we seek for solutions are also the ones created by us. For example, there has recently been a remarked theory suggesting that design patterns are missing language features. First we create a language that - of course - has some drawbacks which we then use language tricks (such as design patterns) to overcome, but as time goes by, we would get to a point where all those kinds of patterns aren’t wealth anymore but instead turn into pure burdens, which is when we build them into the language. However, by solving the problems created by the previous language, we often create our own new problems. For example, there’s always this “DSL & GPL” (where GPL means general-purpose language) debate. On the one hand, building domain specific features into a language has the obvious advantage that it would be a lot more convenient for programmers to use when faced with domain-specific programming tasks, but on the other hand it would also limit the usage of the language, thus making the whole set of runtime system only accessable by itself (yeah, of course I know there’s inter-language operation, but that’s still another additional step don’t you think?). As to GPLs, the main advantage of them is to use a single runtime system to serve theoretically unlimited application areas. This isn’t without compromises, either. The main compromise is that when faced with domain-specific problems, a GPL only makes for a second-class language. That’s why Microsoft “invented” the CLR system; that’s also why Martin Fowler started advocating the so-called Language-Oriented Programming.

So, to sum up, we created all kinds of language abstractions to make programming easier. But, as it always has been, by solving one problem (programming convenience) we create other ones. Our language will no doubt have many drawbacks, that is, ones that make certain programming tasks harder to do. That’s where language tricks step in and steal our focuses (I guess you all have a huge stack of language “techniques” books, right?). If you don’t understand what I’m saying, please take a look at any suggested “classic C++ books” list.

However, why on earth do we have to learn those tricks? We don’t, actually. But we tend to. Because:

We’re born problem solvers, we like solving problems; problems are interesting, even if they’re created by ourselves.

So, what happens after that? We learn new “techniques”. By “techniques”, I mean literally dozens of libraries, frameworks, APIs, and several new languages dubbed “the next big thing” (whether or not they say that explicitly). Again, why do we have to learn these? We don’t, really. We can learn them on an as-needed basis. One of the main reasons we’re attracted to them is because:

We like new stuff. If it’s new, it’s interesting.

Another reason is that we like to jump on the bandwagon.

The Inconvenient Human Nature, #2
Jumping-on-the-bandwagon
: If everyone is doing it, so should I.

Not only do corporations use this strategy to induce us, we do it ourselves, that is, we create our own bandwagon. When some new language or technique comes out, we often get so excited that we blind ourselves to the problems it has; we’re blinded by the halo created by its featured features. We often, as a result, regard it as a panacea. We start eagerly to learn it. Programmers are smart animals, probably too smart. They always yearn for new stuff (check out what’s been discussed on the major programming forums and you will know what I’m saying), just like beasts hungering for blood. You walk around on the programming forums, you see thousands and thousands of technical details; it’s an endless job learning all those, but programmers love that.

The Mundane

On the other hand, what do (most) programmers not love? Principles, be it coding principles in the small (e.g. “always give variables meaningful names”) or development principles in the large (e.g. “write tests before you write the actual code”). They’re just dull. They’re not tricky; they’re not weird; they’re not challenging. We can’t show the world how smart we are by complying with some silly rules. What we do love is writing some insanely tricky code or using some dazzling patterns that nobody else has a clue what we’re doing (or everybody knows what we’re doing).

Right?

The Self-handicapped Programmers

On the one hand, programmers are learning too fast, and learning too much (see above). On the other hand, there’re always times when we need to learn new things.

There actually are several kinds of human natures that can hinder one from learning new things. The one related to what we’re getting at is:

The Inconvenient Human Nature, #3
Self-serving bias
: We love what we’re doing, or who we’re; we dislike all the things that counter it.

Admit it or not, we’ve all been through this. After we get familiar enough with some language or platform, the self-serving bias will start to affect what we like (and learn) and what we dislike (and won’t learn). Language debates are all too common in programming community. By blinding ourselves to the disadvantages of our languages or platforms and to the advantages of other languages or platforms, we limit our access to new techniques and ideas. In a sense, we limit our potentials.

Conclusion

Most of the times, we’re learning just a little too much. We’re attracted to interesting stuff like a moth to a flame. Or oftentimes we just learn what everybody else around us is learning or what we’re told to learn, not knowing why we should learn it. Fact is, however, after we’ve grasped the essential knowledge, other stuff can just be learned on an as-needed basis. Don’t fall into technical details unless they’re essential or needed right away. There’s just unlimited number of details to follow in this area; you can put your time to something more useful (learning the essentials, learning the ideas, or even just another language).

On the other hand, however, we’re learning too little. We blind ourselves to the really important subjects just because they look dull. Tests? That’s like wearing condoms before having sex! Refactoring? Why do we have to do something that’s not going to generate new functionalities and notshinny at all? Defensive Programming? No thanks, I know what I’m doing here. API Design? Oh-Man, it’s just too darn hard to consider how somebody else would be using my code when I’m writing theSPLENDID implementation. New languages? What… R U saying that mine is not good enough? Did U NOT see how I can bend the language to do whatever the heck I want it to do?

分享到:
评论

相关推荐

    BURNINTEST--硬件检测工具

    - Note: We have seen a report of the Video Playback failing (crash) due to a faulty video codec, ffdshow.ax. If you are using this we suggest you try a different Video file and codec. Release ...

    The Enterprise Big Data Lake

    Enterprises are experimenting with using Hadoop to build Big Data Lakes, but many projects are stalling or failing because the approaches that worked at Internet companies have to be adopted for the ...

    b+树,learning index

    There is a value in the constructor of the RMI that triggers a retrain when the overflow array reaches a certain size. The basic API: ```c++ // [first/second]StageParams are network parameters int...

    Python安装包version 3.1.5

    We try to have a comprehensive overview of the changes in the "What's New in Python 3.1" document, found at http://docs.python.org/3.1/whatsnew/3.1.html For a more detailed change log, read Misc/...

    google api php client

    // add the query to the request and make the request $request->setQuery($query); $response = $datastore->projects->runQuery('YOUR_DATASET_ID', $request); ``` The method used is a matter of preference...

    八年级英语上学期期末模拟试题(无答案) 人教新目标版五四制 试题.doc

    ---- Can you make _________ in English when you happen to meet an American in the street? ---- I’m afraid not. I knew little English. ` 使用`make oneself understood`表示“使自己被理解”,这里应填`...

    system mechanic Activator v1.0

    Make sure to read all the notes and info below, cause you may need them. * If the activator is detected by your antivirus software then add it to the exclusions lists of real-time protection and ...

    Expert One-on-One J2EE Design and Development

    volume J2EE applications and salvaging failing projects, as well as intimate knowledge of the J2EE specifications, to offer a real-world, how-to guide on how you too can make J2EE work in practice....

    Failing-servers-on-a-Network-Anomaly-detection-

    "Failing-servers-on-a-Network-Anomaly-detection-"这个标题暗示了一个关于网络服务器异常检测的问题,这通常涉及到监控网络流量、服务器性能指标以及识别可能导致服务中断或性能下降的不寻常行为。 描述中的"网络...

    memory leakge & initialization & invalid pointer

    In the realm of software development, especially when dealing with lower-level programming languages like C or C++, developers often face challenges related to memory management. Three critical areas ...

    Docker.Jenkins.Continuous.Delivery

    The combina on of con nuous delivery being executed on applica ons running in Docker containers will allow us to see, in enterprise IT, the exponen al growth in innova on that we have seen in ...

    BuzzFeed to Failing Pile of Garbage-crx插件

    【BuzzFeed to Failing Pile of Garbage-crx插件】是一个专为英语用户设计的浏览器扩展程序。这款插件的主要功能是实现特定文本替换,将网页上出现的"BuzzFeed"一词自动替换为"垃圾堆失败"。这个工具可能是为了讽刺...

    BIND-LINUX64位包

    a way to specify the local address for use when sending update packets. [RT #34811] "named-checkconf -z" now checks zones of type hint as well as master. [RT #35046] Update config.guess and ...

    Web Analytics 2.0: The Art of Online Accountability and Science of Customer Centricity

    - **Interpreting Data**: Provides guidance on how to interpret clickstream data to make informed decisions about website optimization. #### Chapter 4: The Awesome World of Clickstream Analysis: ...

    django-master-class

    The idea is to first write a failing test, then write the necessary code to pass the test, and finally refactor the code to improve its design and quality. TDD encourages a more structured approach ...

    gerrit-3.0.3.war

    Extend the addMenuLink method in the PolyGerrit plugin API to allow plugins to specify a capability that users must have in order to view a top menu item provided by the plugin. Utility script remove...

    hudson1.293.part1.rar

    Recover gracefully from failing to load winp. (report) What's new in 1.290 Fixed a regression in 1.286 that broke findbugs and other plugins. (report) Fixed backward compatibility problem with the ...

    路由插件pgrouting和中文分词插件zhparser.zip

    在IT领域,数据库管理和数据分析是至关重要的,而`pgrouting`和`zhparser`是两个针对特定需求的 PostgreSQL 插件。`pgrouting`主要用于地理信息系统(GIS)中的路径规划和网络分析,而`zhparser`则是一个用于中文...

Global site tag (gtag.js) - Google Analytics