The Map Man Says GOTO is Evil

In the days before the C# language became popular, many people coded in BASIC.

BASIC has a rather controversial statement in the family of jump statements called GOTO. The GOTO statement lets you move the flow of control to any point in the source code that you desire. It was usually used within the THEN or ELSE clause of an IF statement. But, if you had numerous nested-IFs it could be difficult—if not impossible—to look at the source code and have any idea what it was going to do. So, you had to be careful how you wrote your code. You still do.

At the time, there was some debate on the use of this statement with respect to the maintainability of source code. And, it was much frowned upon in many circles to the point where one would be judged badly for using it.

Well, this morning, as I sifted through the changes in the C# Language Specification 5.0, I came across the goto statement. I smiled and thought to myself, “They haven’t killed you yet?” I kind of like the GOTO statement. It lets you do what you want to do; however you like . . . make up your own rules . . . you can be a rebel if you like (kind of like commas, semi-colons, em-dashes and ellipses in grammar),

Then I remembered this essay, “A Case against the GO TO Statement,”   by Edsger W. Dijkstra, the creator of the algorithm for finding the shortest path from a to b in a directed graph; or in layman’s terms, the initial ancestor of the algorithm that Google maps or your GPS receiver uses when it plots how to get from your house to the grocery store within the shortest amount of time or distance—kind of a hard thing to do.

Having studied and used some of his algorithms in college, he certainly had and still has my respect. And, if you’ve ever used a GPS, he should have yours as well. He kind of knows what he’s doing wouldn’t you say?

Back in school when I came up on the essay, I gave it strong consideration when he said:

The go to statement as it stands is just too primitive, it is too much an invitation to make a mess of one’s program.

With the exception of using, say, JMPs in assembly language (the equivalent of a GOTO in BASIC), I have tried to avoid using them as much as I can for the very same reason he states above.

But, I am happy that you can still GOTO in C#. So, if you feel like being a bit of a rebel . . . GOTO for it! Just don’t over do it . . . the Map Man might come looking for you (and he knows the quickest way to get to your house!)

Anders Hejlsberg—My Favorite Geek

Aside from Bill Gates, Anders Hejlsberg is my favorite geek.

In the mid-80s, my black-and-white TV had the phrase, “UNDER LICENSE FROM MICROSOFT” burned into the screen. It looked like the image to the right here (only in B&W).

But, once I grew out of my TRS-80 MC-10 and my TRS-80 Color Computer, BASIC was no longer a viable language to be coding in. I was in the PC world now with my AT&T 6300 on loan from my employer. And to code on that, I needed Turbo Pascal.

I loved Pascal. It was how I thought about software. And, Borland’s books taught me how to code in it and how to think about software. Later, Borland came out with Object Pascal, and Anders taught me object-oriented programming. And, along with Charles Petzold, I learned event-driven programming in Windows 3.1. Petzold and CompuServe was Stackoverflow and Google all rolled into one.

And then Anders created Delphi and combined windows and Pascal into one GUI that produced tiny, fast .exe’s that blew away Visual Basic in so many ways. Delphi was wonderfully easy to program in.

Well, Bill Gates was having none of that. So, he swooped into Borland and stole Anders from Philippe Kahn—killing Delphi. Then, Gates let Anders work his magic at Microsoft. And, when VB.NET and C# came out with the new Visual Studio and the .NET libraries, I felt the same feeling as I had felt when I experienced Delphi.

This was right. This was the way it’s supposed to be. Anders hasn’t let us down.

And now . . . he’s working on TypeScript . . . listen to “the man” talk about it . . . and download it if you like it . . . from my favorite geek, Anders . . . he’s making JavaScript better these days . . . too . . . cool . . .

Vision First . . . Then Innovation Follows . . .

I found this old video of Steve Jobs in the early years of Apple; at the time of this video, there were about 50 employees.

I think you’ll enjoy seeing a young, undaunted man trying to convince himself of his vision.

I like hearing about the journey driven by his vision which drove his innovation.

I like this quote too:

Simplicity is the ultimate sophistication

as well as other quotes about how the Apple II won’t be obsolete (18:42) and that they won’t make people buy newer versions of everything again.

Knowing the truth, you can seem him struggling with the decision to either try and educate a stranger about the necessity of making things obsolete or tell the stranger what he wanted to hear; which is what Jobs did.

Here’s the video . . . enjoy:

Entity Framework Books

Where can I find free ebooks on Entity Frameworks?

IT eBooks has several. You can find them below (just click on the image). They are a little dated but still contain a lot of good information.

There are a lot more on the site. These are just a few to get you started . . . enjoy.

Error Logging for MVC

What’s a good error logging tool for MVC applications?

There is a neat system called ELMAH that you can use. It’s web based and installs as a part of your entire web application.

Through configuration files, you can require authentication and assign roles pretty easily to protect the pages. It will show you all the logging information your application is producing.

You can install it into your MVC application with NuGet.

Here’s more information about ELMAH.

https://code.google.com/p/elmah/

Good MVC Primer

Where can I learn Microsoft’s ASP.NET MVC C# quickly?

This is a really good survey of MVC by Scott Allen. If you’ve been in software development and done some of the older, ASP or ASP.NET web programming, you can pick this up pretty quickly with his tutorial.

Also, he show’s you how to get free tools for following along. That’s right, you can learn all of this for free with free tools from Microsoft.

Here’s the link:

http://pluralsight.com/training/Player?author=scott-allen&name=mvc4-building-m1-intro&mode=live&clip=0&course=mvc4-building