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.

Comments

Popular posts from this blog

Managing Developers is HARD

I've been a software dev for a long time.  I've also been running my own software company for a few years now.  This is important information because of why I do these things.  I am a sofware developer because I love learning.  I slack off when doing a job that bores me, and software development always has something new to experience which keeps me excited and interested.  Why start a software company then?  That puts me in the role of manager rather than developer.  The truth is simple.  I've worked for a lot of companies, and I don't see any of them doing a great job of managing their software development.  That's not to say none of them have done a good job, but no one out there seems to be doing a great job.

How are they different?
A lot of companies get this part right.  Software developers are different from other employees.  The distinction is important in the same way it's important to acknowledge that an insurance agent is different from a construction…

When Is Software Done?

I have some very exciting news.  A piece of software I've been working on for over 2 years is released to the general public!  This is a little exciting if it were software I'd been working on for some big company.  It's very exciting because it's software I have been working on for my company.  That's right!  My company is ready to start selling software and start making money!

I'm not gonna use this blog post to talk about my company and what it does.  You can read about that in our press release.  Instead, I'm going to talk about the software industry and the concept of done.  Because, as with everything, it's more complicated than it seems.

Software is never really done
Actually that's a misnomer.  Software can really be done.  But done is sort of a quantum state--there and not there at the same time.  First and foremost, anyone can understand that software that works is complete.  If the software's purpose is to process a credit card, if th…

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 …