The Cognitive Style of Visual Studio

Charles Petzold is widely known as the guy who put the h in hWnd. He's the author of the seminal 1988 book Programming Windows, now in its fifth edition. And he can prove it, too. He has an honest-to-God Windows tattoo on his arm:


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2005/10/the-cognitive-style-of-visual-studio.html

Using Notepad to code may be an instructive exercise in minimalism for students, but no
professional programmer can afford to build software this way. If anything, I think the
future lies in even tighter coupling of the language and the IDE. I can even envision a
day where it isn’t possible to compile a program outside the IDE-- and that’s probably heresy
to Petzold.

There are a couple of professional programmers using e.g. vi for programming. There are thousands of programs that can be compiled using command-line-tools. Microsoft and Windows are not the whole world where software-development happens. E.g. on unixoide systems it’s always the three-step-way

./configure
make
make install

to compile and install software.

Your vision is no vision anymore. If you want to develop software for console-systems it’s quite often necessary to use the development-system provided by the manufacturer of the console. But as long as there are “free” systems in the world there will be a development being possible without being forced to the IDE of a specific company.

I was changing my IDE for software-development a couple of times, but I will never use an IDE that produces source-code that can’t be compiled using another IDE.

Best regards, Lothar

without being forced to the IDE of a specific company

It’s not about “being forced”; it’s the 1000% increase in productivity you gain from an IDE that is tightly coupled to the language. It has a clear benefit to the user. That’s a carrot, not a stick.

that can’t be compiled using another IDE

It’s hard to create source code that compiles cleanly on all the various FreeBSD/Linux flavors – and that’s purely at the command line!

But as long as there are “free” systems in the world there will be a development being possible without being forced to the IDE of a specific company.

Well, you can also build a house using only a hand saw, hammer, and other manual tools… but all modern home construction companies use power tools.

I’m not saying you should be prohibited from building code in notepad-- but it’s not exactly a practical or realistic example, either.

This strikes me as a similar argument to learning assembly nowadays. Is assembly/knowing how to build my application outside the IDE something I’m going to use every day? Probably not. I am more productive inside the IDE. But knowing knowing how to build my app from the CLI means that when something goes wrong, I have a better chance of finding the problem, and fixing it. I’m not stuck wondering what the generated code does, I know what it’s doing. It also means that if I’m stuck on a machine that doesn’t have the IDE, I can still get things done. (Although that’s certainly a rare occurrence.) First? rule of code generation: If you can’t do it by hand, you can’t write the generator. (And you probably shouldn’t be using one, either.)

It’s not about “being forced”; it’s the 1000% increase in productivity you gain from an IDE that is tightly coupled to the language.

There is a difference between an IDE being coupled to a language and a language being coupled to an IDE as you described it in your vision.

With your vision there will be a lot more similar situations as you were describing yourself in

a href="http://www.codinghorror.com/blog/archives/000392.html"http://www.codinghorror.com/blog/archives/000392.html/a

“Well, after digging around (a lot) to find the DX 8.1 SDK that this sample is specific to, I came up with the C++ source for Moire. With the assistance of a coworker more versed in C++ than I, we managed to bundle Moire into a VS.NET 2003 C++ solution.”

I don’t find myself being confortable with knowing that my ability to compile my own work is dependent on the development-roadmap of another company conerning the IDE I’m currently using.

Since I started developing in Java, I was swtiching IDEs more or less every two years (vi - Visual Cafe - Netbeans - Eclipse). I can still compile all the code I was producing with every single IDE. The compiling/releasing here is completely script-based (with Ant) and is happening on a Linux-machine without any IDE being installed (doing the checkout from the repository, compile, jar together, do the unit-testing, …) so being forced to a specific IDE when compiling would break things here.

It’s hard to create source code that compiles cleanly on all the various FreeBSD/Linux flavors

No doubt on that, it can be even hard to compile it on different versions of Linux-distributions. But on no system I read in the INSTALL-readme to first buy a copy of SuperIDE by Linus Inc. to be able to compile a secific software.

Well, you can also build a house using only a hand saw, hammer, and other manual tools… but all modern home construction companies use power tools.

Sure, but the people using these tools were learning everything with using hand-saws, hammer and other manual tools. And I don’t think that people building houses would be happy if they are forced to buy BlackDecker-machines when trying to build a house in New York with a full stock of already bought Hiltis in their stock.

Best regards, Lothar

First? rule of code generation: If you can’t do it by hand, you can’t write the generator. (And you probably shouldn’t be using one, either.)

Well, then I guess we should all be programming in assembly. :wink:

What bothers me is that these guys keep making the assumption that because the IDE does things for me that I don’t understand what it does. Good “developers” will always understand what the IDE is doing for them under the covers. That’s what makes them good. Sure, there are many people who couldn’t open Visual Studio and create a Windows Forms project by first starting with an “Empty Project”. But then again, that’s because they haven’t taken the time to understand the fundamentals. But that wouldn’t change regardless of what the language required. Even if builds required you to create and maintain text based make files by hand (remember those days?) those “bad” programmers would find a way to cheat (can you say… “Google for sample makefiles”?).

There is blindly allowing the IDE to do your work and then there is understanding what the IDE is doing for you so that you can get your work done faster. It is simply a matter of reliance.

My biggest fear with the ide-language concept is new coders lacking the understanding of what is “really going on” if they always have the ide supporting them. Modern carpenters use power tools to build burb boxes and buildings and whatnot but what about when they need to do a little finishing work or they jump over to the custom cabinet business, when they have to work with things that don’t come pre-cut and blue-printed? Trust me, from someone that just watched their townhouse get built they don’t know much about the finer details and they aren’t paid enough to know.

I think for your average zombie coder this approach is great, it helps keep things standard and you get something to market faster and more stable, a bit like when they throw down a whole suburban development. When you want to go out on the edge though I feel you better know how things work and that’s really what working in Notepad gives people, the understanding of exactly what’s going on. It’s not an exercise in minimalism, it’s in understanding. It’s adding each line yourself instead of it being auto-generated so you understand why it gets auto-generated.

I don’t really like doing everything in Textpad and I curse every time I need to work on some JavaScript but there have been many times I’ve needed to do things the IDE didn’t know about and when I didn’t get my Intellisense I didn’t freak out. When I decided I didn’t really want to init my controls at that point or that no, really, I don’t want my class to descend from that one. A more responsive, understanding ide is great but only as long as I can ignore it and tell it to shup up when I need to.

Basically I still think the kids need to learn the Old Math before the New Math. Give them a super coolie whizbang ide that reads your mind but only after they can demonstrate that they could do it without it.

I don’t understand this obsessive need to know everything that’s going on under the covers. How much do you know about the databases you program against? How much do you know about the details of the graphics subsystem when doing UI coding?

Really, all a developer needs to know is enough to do his job well. If a developer successfully delivers software that was 100% created by a wizard, so the f what? He’s delivering solutions, right?

If you need to dive on the problem, then by all means, dive. Learn all about the internals, learn about the code the IDE generates, if that’s what it takes to get your job done, then do it. Who hasn’t had to do this, to learn something completely new because the job needed it right then?

There is a universe of things to learn about software development. If you focus on learning stuff that’s not directly helpful for your job (like building applications with the barest of tools), isn’t that a form of premature optimization? In the universe of the things to learn, its usually best to focus on the things that are most relevant. Or to put it another way, all that code produced by the IDE is usually irrelevant to your job. If it ever becomes something you need to know, then that’s the best time to learn it.

I agree! Look, I’ll be honest and say I don’t really understand assembly all that well. However, I seem to do just fine without knowing exactly how it works.

I’ve taken the time to learn enough about what goes on under the hood to be effective, but I don’t really need to know every detail.

Likewise, if you’re a good programmer, you’ll take the time to learn what the IDE is doing for you, and you’ll thank the IDE for doing it.

I recently went through a very interesting excercise: I installed my own engine in my 1985 VW Vanagon (if you are interested: http://www.cloakofcarrot.com/gallery/1985Westfaliavanengineinstallation
)

I did some reasearch, tracked down three companies that built engines for these sorts of vans, chose one. Now the 1985 vanagon has a 1.9l engine, which is no longer made, and was quite unreliable. Fortunately, the engine builders are capable of manufacturing a 2.1l engine that is bolt-equivalent of the 1.9l.

This meant that all I had to do was take the old engine out, swap the parts onto the new engine and put it back in.

I am not a professional mechanic, but was able to work through the process, and the van has been running great ever since.

There are a couple of things to learn here:

  1. Why didn’t I build my own engine? Engines are a highly-domain expertise specific thing, and require special knowledge and tools to construct and test. Also - the market will not support a large number of engine builders.

  2. By having clearly defined interfaces, I was able to not only change engines, but get a more powerful engine installed

  3. It was reletively easy to do, as I simply had to have a good knowledge of the problems that were likely to occur, and the patterns required to solve them. I did not need a low-level understanding of how engines work, how to build engines or how to be a machineist…

This ‘how low do you know’ debate has been going on for years, and is really quite redundant. Different people are going to have different levels of understanding, and tolerance for complexity.

Those with skills and capability to handle the complexity should be involved in constructing lower level systems. But there is not a need for everyone to construct or understand things at a low level: the market will not support it.

The key is for those who engage in building these systems is to have clearly defined interfaces and patterns that will allow the rest to succesfully and effectively apply their creations to solve problems.

Why don’t we all build our own computers and hardware from vacuume tubes and magnets? That way everyone would understand exactly how things work at the lowest level.

Each wave of development builds on the last, and the more recently you learn things, the farther away from the core you get. Certainly, you can spend the time to learn assembler etc, but those skills will not likley land you a job anywhere these days.

The only way to build bigger and more reliable systems is through the use of well engineered systems that can be built into a whole matching a design. The domain experts in building motors can build the motors, and a desginer who needs a motor to power a car or a plant, can select the correct motor for their design and be assured that if they build a system that gives it the right coolant, fuel and oxygen that it will power their system reliably for the specifications provided.

That is how things are done in the engineering world, and that is the way things will continue to move in thes software world.

Why don’t we all build our own computers and hardware from vacuume tubes and magnets? That way everyone would understand exactly how things work at the lowest level.

Charles Petzold has an excellent book, “Code: The Hidden Language of Computer Hardware and Software” which does exactly that:

http://www.amazon.com/exec/obidos/tg/detail/-/0735611319

It’s a fascinating and beautiful book, but it’s also irrelevant to most modern programming.

I can hand cook a fancy curry for dinner when I’ve got time, but during the week I’ll cook a curry from a jar of sauce.

Doing it by hand takes longer, but lends itself to a better produced and more delicate flavour.
The jar curry always tastes the same.

But sometimes I add a few of my own ingredents to the jar curry, to freshen it up.

Once you know what you’re doing, then you pick use the correct tool and resources for the job.

I can even envision a day where it isn’t possible to compile a program outside the IDE

I am sure Microsoft cannot wait for that day.

Damien, if you said “I don’t understand this obsession about understanding whats going on behind the covers” during an interview, I would stop and send you home right there.

Not knowing what goes on behind the covers, or understanding them, is what leads people to write bad code. And people who have no interest in how or why things work often make the worst developers; they’re people who are coding because they have to, not because they want to. As with all art, it is an innate interest, and innate fire for what we do that helps us do it well. Anyone who doesn’t see programming as an art is just a shitty code who does it because he has to.

Lothar, Visual Studio generally does NOT produce code that cannot be compiled by another IDE, except for the situations where it is trying to augment C++ to allow it to talk to COM/.NET better. Even in those cases, the IDE and the actual compiler are seperate entities.

The “Wizards” that people depend on are nothing more than code generators, and in general that code is really just code; comments can be used to help the wizard update the generated code. Regular patterns are used to help tools understand what they (or you) wrote. In the case of .NET/Java, introspection can be used as well.

These tools just save you the trouble of writing repetative code yourself and developing a framework/pattern for how to do certain kinds of menial tasks. It’s not magic, its just pre-canned grunt-work that has no connection to the IDE itself.

Just a little side note; that I have to write my 13 times to make it compile on each of the 90 flavors of Linux is the very reason I choose to do all my development on Windows.

One instruction set to rule them all,
one API to bind them, and the darkness.
One compiler to bring them all
and in the linker bind them.

Ugh I had a typo :frowning:

One instruction set to rule them all,
one API to bind them,
One compiler to bring them all
and in the linker bind them.

Boy, some of the comments here don’t align with my experience. IDEs are more than just wizardy things for laying out dialogs or generating code that you’d prefer not to write. A good IDE is an excellent tool for understanding and managing a large body of code: What are the arguments to this method? Who calls me? Show me the implementors of this method? Where is this class defined? The IDE isn’t just a text editor, it has a deep understanding of the language. For refactoring, an IDE can make like much easier: I want to change a method name and all of its callers. I want to encapsulate this common chunk of code as a method. This can be powerful stuff. Just look at the refactoring support in Eclipse and IntelliJ and now appearing in VS 2005.

I’d be unwilling to give up the productivity gains from using a good IDE. It’s not that I can’t code without one – I did for years and years before. But without the IDE it would probably take me longer to do. Why should I waste my time?

if you said “I don’t understand this obsession about understanding whats going on behind the covers” during an interview, I would stop and send you home right there.

But I don’t think that’s what he said. What he said was…

If you need to dive on the problem, then by all means, dive. Learn all about the internals, learn about the code the IDE generates, if that’s what it takes to get your job done, then do it. Who hasn’t had to do this, to learn something completely new because the job needed it right then?

In other words, Just-In-Time learning. I agree. Why learn a bunch of crap you’ll never need?

Of course by that same argument, I should never have gone to college. :stuck_out_tongue: There’s definitely a balance level you want to achieve between JIT learning and background learning.