Skip to main content

Know What You're Working With

When teaching programming, every teacher has his or her own custom style.  The difficulty is that, when learning about programming, you need to understand the teacher's style, and that's the bit their less likely to explain, sometimes because they can't and other times just to avoid arguments about how they should change.

So I'm going to go over a stylistic trick that a lot of teachers use.  When learning to program, some teachers tend to live in the IDE.  They don't discuss the background stuff that's going on, which can leave you in the dark when you try to understand how everything attaches to the computer as it exists.  So the teacher will be discussing programs inside the IDE but may never even show you the output directory.

I'm using Visual Studio in this walkthrough, but the purpose here is to show you that you should look at the output directories of your own programs, even your toy apps.  Here's the output directory of a tiny hello world app.
Notice first the directory itself is set deep inside the project folder structure in a binaries folder called "bin" and in a folder titled with the build type, in this case "Debug".

My application isn't complicated, it's 16 lines, including unnecessary usings and whitespace, but Visual Studio output 4 files here.  All of the files are named after my solution, so the only way to tell them apart is by the text after the first dot, so let's stick to that text.

First, the "exe" file.

This is the actual application.  I'm sure your professor told you once that your application is producing an exe file, but it's important to note that all of your code was compiled and put inside that exe file.  That's the compiled code.  Different project types may produce different output, but in this case, all of our code is put into one exe file.

Second, the "pdb" file.

This file is used for debugging.  It's purpose is so that visual studio knows what line of your originally written code corresponds to what line of compiled code inside the "exe" file.  It's only purpose is in debugging and it has nothing to do with your actual application when it runs.

Finally, the "vshost.exe" and "vshost.exe.manifest" file.

VSHOST is a feature enhancement to Visual studio to make the Debugger faster.  It creates a hosting environment so that your file can be debugged easily.  This is also only used in debugging and has nothing to do with when your application runs.

It's important to understand what your IDE is doing, because you will some day end up working with other people's code.  If you see that someone else's application has some code you would like to call from your code, you only have a few ways to do it.

If you use the app that the other person wrote, then you have to call an Execute method, wait for the Operating System to spin up the application, and then wait for the application to process your data.  However, if there's a way to call the application through an API, then you have the flexibility to call it directly from your code which can be loads faster.

The reason I mentioned this is because I have seen teachers use the API pattern when working with outside code, but never note it to the students.  Not only are the students missing out on the valuable reason the teacher is doing things in that way, but some might even have missed the very brief sentence in the lecture where the external code was written.  It can be extremely confusing trying to write code that comes from an external API being unaware that you're supposed to have downloaded an external API.


Popular posts from this blog

Teams and Complexity

Let's pretend you're a car mechanic (I don't know, maybe you are).  But you don't work at some shop in town, you work at a bigtime auto-maker onsite at the factory.  You help build cars from scratch.  You work with a lot of other car mechanics, and various engineers of different levels.  If we were looking at the 1910s, you might be working for Henry Ford on one of the first ever assembly lines.  Either way, you have a specific part of the car you're responsible for.  Your skills probably extend beyond that, and you might work on a different part of the car each day as your manager moves you around to keep the factory efficient.

One of your coworkers, Bob, is a superb engineer.  He is very good at building cars, far better than you, and he does it faster than everyone else.  Your boss really likes him.  You often get stuck after him in the assembly line, so you know exactly what sorts of things he does.  He's not sloppy, but he likes to do things his way.  He w…

Managing Programmers

Working with other programmers is tricky.  That said, it's nothing compared to the job of managing programmers.  One of my favorite quotes about Perl is that (paraphrased) "a Perl developer is like a rockstar.  Now imaging having a bunch of rockstars in one room together and you will understand why you don't want an entire team of Perl developers."  It's not about Perl here though. What's important to understand is that any developer worth his salt is going to be like a rockstar.  And yes, there are a lot of professional developers out there who aren't worth their salt, but that's for another post another day.  Rockstar may not be the right term here, but think of it this way.  These guys are smart.  They may not be geniuses, but there's going to be things that they know that you don't and probably never will.

I've seen it more than once and it's not going to make some Product Managers happy, but I'm going to state a fact, an eleph…

How to identify a skilled programmer during an interview

How does one identify a skilled programmer?  No company that has interviewed me could tell the difference between myself and other programmers they'd interview.  The interview process is truly a game of luck in this industry--on both sides.  Both the programmer and the company are basing their actions entirely on luck.

Companies have come up with numerous methods to attempt to discern a good programmer from a bad one.  The best tricks they have include a series of math problems, algorithms, problem solving technique tests, and even obscure programming questions, some without definitive answers.  As an example: Is there an authoritative source of information on the core principles that define object oriented programming?  I've heard everywhere from 3 to 7.  In a field of research about a synthetic concept, an authoritative answer is almost impossible to obtain.

Programmers were then forced to study to the interview.  Careercup is one of my favorite sites for this.  This almost …