`
leeseon
  • 浏览: 100399 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

"Why Would You Want to Do That?"

阅读更多

Introduction: "Why Would You Want to Do That?"
It was 1985, and I was in a chartered bus in New York City, heading for a press reception with a bunch
of other restless media egomaniacs. I was only beginning my media career (as technical editor for PC
Tech Journal) and my first book was still months in the future. I happened to be sitting next to an
established programming writer/guru, with whom I was impressed and to whom I was babbling about
one thing or another. I won't name him, as he's done a lot for the field, and will do a lot more before
he's through if he doesn't kill himself smoking first.
But I happened to let slip that I was a Turbo Pascal fanatic, and what I really wanted to do was learn
how to write Turbo Pascal programs that made use of the brand new Microsoft Windows user interface.
He wrinkled his nose and grimaced wryly, before speaking the Infamous Question:
"Why would you want to do that?"
I had never heard the question before (though I would hear it many times thereafter), and it took me
aback. Why? Because, well, because…I wanted to know how it worked.
"Heh. That's what C's for."
Further discussion got me nowhere in a Pascal direction. But some probing led me to understand that
you couldn't write Windows apps in Turbo Pascal. It was impossible. Or...the programming writer/guru
didn't know how. Maybe both. I never learned the truth. But I did learn the meaning of the Infamous
Question.
Note well: When somebody asks you, "Why would you want to do that?" what it really means is this:
"You've asked me how to do something that is either impossible using tools that I favor or completely
outside my experience, but I don't want to lose face by admitting it. So,...how 'bout those Blackhawks?"
I heard it again and again over the years:
Q: How can I set up a C string so that I can read its length without scanning it?
A: Why would you want to do that?
Q: How can I write an assembly language subroutine callable from Turbo Pascal?
A: Why would you want to do that?
Q: How can I write Windows apps in assembly language?
A: Why would you want to do that?
You get the idea. The answer to the Infamous Question is always the same, and if the weasels ever
ask it of you, snap back as quickly as possible: Because I want to know how it works.
That is a completely sufficient answer. It's the answer I've used every single time, except for one
occasion a considerable number of years ago, when I put forth that I wanted to write a book that taught
people how to program in assembly language as their first experience in programming.
Q: Good grief, why would you want to do that?
A: Because it's the best way there is to build the skills required to understand how all the rest of the
programming universe works.
Being a programmer is one thing above all else: It is understanding how things work. Learning to be a
programmer, furthermore, is almost entirely a process of learning how things work. This can be done at
various levels, depending on the tools you're working with. If you're programming in Visual Basic, you
have to understand how certain things work, but those things are by and large confined to Visual Basic
itself. A great deal of machinery is hidden by the layer that Visual Basic places between the
programmer and the computer. (The same is true of Delphi, Java, Perl, and many other very high-level
programming environments.) If you're using a C compiler, you're a lot closer to the machine, and you
see a lot more of that machinery-and must, therefore, understand how it works to be able to use it.
However, quite a bit remains hidden, even from the hardened C programmer. (Many C programmers
fool themselves into thinking they know way more than they actually do-and have the bad karma to be
pretty damned arrogant about it.)
If, on the other hand, you're working in assembly language, you're as close to the machine as you can
get. Assembly language hides nothing, and withholds no power. The flip side, of course, is that no
magical layer between you and the machine will absolve any ignorance and take care of things for you.
If you don't understand how something works, you're dead in the water-unless you know enough to be
able to figure it out on your own.
That's a key point: My goal in creating this book is not entirely to teach you assembly language per se.
If this book has a prime directive at all, it is to impart a certain disciplined curiosity about the machine,
along with some basic context from which you can begin to explore the machine at its lowest levels.
That, and the confidence to give it your best shot. This is difficult stuff, but it's nothing you can't master
given some concentration, patience, and the time it requires-which, I caution, may be considerable.
In truth, what I'm really teaching you is how to learn.

这是Jeff Duntemannd 在《Assembly Language Step-by-Step: Programming with DOS and Linux, Second Edition》中的一章的内容。

呵呵,我好象也常常问这样的问题,看来我也是真的不好意思承认自己的无知、、、

只有几次例外,如一个同事用了多个消息循环,另一个却喜欢在程序中create table与drop table、、、呵呵

分享到:
评论

相关推荐

    Assembly.Language.Step-by-Step.Programming.with.DOS.and.Linux.Second.Edition.Part1

    Introduction - "Why Would You Want to Do That?" Chapter 1 - Another Pleasant Valley Saturday Understanding What Computers Really Do Chapter 2 - Alien Bases Getting Your Arms around Binary and ...

    Assembly.Language.Step-by-Step.Programming.with.DOS.and.Linux.Second.Edition.part3

    Assembly Language Step-by-Step—Programming with DOS and Linux, Second Edition Foreword Introduction - "Why Would You Want to Do That?" Chapter 1 - Another Pleasant Valley Saturday ...

    Assembly.Language.Step-by-Step.Programming.with.DOS.and.Linux.Second.Edition.part2

    Assembly Language Step-by-Step—Programming with DOS and Linux, Second Edition Foreword Introduction - "Why Would You Want to Do That?" Chapter 1 - Another Pleasant Valley Saturday ...

    PL/SQL详解 从入门到精通 英文版

    This is a book about writing stored procedures for an Oracle database. A stored procedure in ... Why would you want to do that? Because your program will run faster inside the database.

    Android代码-RxAppFocus

    Why would you want to do that? Maybe you want to trigger a sync with a cloud service when your app is resumed. Maybe you want to stop receiving location updates when your app goes into the background....

    Expert Oracle Database Architecture 9i and 10g programming Techniques and Solutions

    different ways would you like to do that in Oracle?” I hope that this book will help you make the correct choice. This book is aimed at those people who appreciate the choice but would also like some...

    2012英语资料

    24、How could you say that? ___________. I did not mean to hurt you. A:Excuse me B:I won't regret C:I'm really sorry D:That's all right 25、- I've heard that you are going to Thailand? - Yes, I'...

    HBase:权威指南(英文版)

    There may be many reasons that brought you here, it could be because you heard all about Hadoop and what it can do to crunch petabytes of data in a reasonable amount of time. While reading into Hadoop...

    Effective C++ 3rd Edition 55 Specific Ways to Improve Your Programs and Designs (PDF)

    If you want to really and truly understand C++, you must read Effective C++. After first reading Effective C++, I had a totally new appreciation for and understanding of C++. And it's not just me: ...

    Microsoft Windows 7 In Depth.pdf

    ), you might want to check Brian’s book Windows 7 and Vista Guide to Scripting, Automation, and Command Line Tools, which is due to be published in the fall of 2009. From the Library of Lee Bogdanoff...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    When you include a header file you introduce a dependency that will cause your code to be recompiled whenever the header file changes. If your header file includes other header files, any change to ...

    Expert Oracle Database Architecture 2nd Edition

    exactly the data that we really want to access and minimizes the risk of the optimizer producing a silly execution plan. In principle, it’s all in the manuals, but only if we have the insight to ...

    Swing Hacks

    When your users want two pieces of software to work together the first thing they want to do is drag-and-drop data from their other programs to yours. This chapter covers how to do robust and ...

    Mastering Machine Learning with R, 2nd Edition-Packt Publishing(2017).epub

    ", or "What the heck was I thinking saying it like that?", and on and on. In fact, the first project I started working on after it was published had nothing to do with any of the methods in the first ...

    UE(官方下载)

    This is a convenient feature when you're manually comparing files, when you want to copy/paste between multiple files, or when you simply want to divide up your edit space. Tabbed Child Windows ...

    cisco_router_performance_field_guide.zip

    I hope that they do not become just objectives in a book for you to memo- rize. The Real World Scenarios are designed to trigger your thought process and allow you to find practical applications in ...

    XML Processing with Perl, Python, and PHP (2002).pdf

    some of them are so easy to use that it’s hard to understand why you would even look at another language. Did you know, for example, that you can talk to any application in MacOS with AppleScript? ...

    Teach Yourself COBOL in 21 days

    If I\'ve missed any of these, and you see a program that seems to do something silly, irrelevant, or useless, be tolerant. Review the program as an example of how the language works and not as a ...

    一个跨平台的CString源码

    // something I was never able to do. Greg Marr pointed out // a compiler warning about an unreferenced symbol and a // problem with my version of Load in MFC builds. Bill // Carducci ...

    MFC+Windows程序设计

    Keep in mind that the wizards never do anything you can't do yourself, so it's perfectly feasible to type in every source code listing by hand if you'd like to. The downside to using wizards in a ...

Global site tag (gtag.js) - Google Analytics