Meme: How I Got Started In Programming

June 13th, 2008

Josh Holmes tagged me.

I must admit I enjoyed reading many of these by people I have met and they have all definitely been in the spirit of what I read at Michael Eaton’s blog when he said “…while I know my tweeps (twitter friends), I don’t really ‘know’ them.”

How old where you when you started programming?

Six years old?

How did you get started in programming?

My dad has a really cool pocket computer. Yes pocket computer. When I was causing trouble in church or out in public or some place where I needed to not cause trouble he would point to the Sharp PC-1500 and I would write him a little program. Later I would find out that it was mostly TRS80 compatible BASIC. The programs were pretty stupid, but the ability to control the little machine kept me entertained for a while. They usually involved questions like “What is your name?” and “How old are you?” with responses like “Wow <name>, you are old”. Sometimes I would put if statements if the name was “Jay” it would say “You are cool” or if the age was under 10 (10 is old when you are 5) it would say “you are not old”. GOOD TIMES!

I really wanted my own computer. My Uncle had a ton of Commodores. When I say “ton” I mean MANY. He automated an entire candy factory by making his own robotics and automating the robotics using Commodore computers. Some were VIC20s some were various editions of the C64, the C64 plus 4, the C64 plus, etc. Anyway, he had an extra VIC20 at some point, I think it was fall of ‘85 or ‘86. He lent the family a VIC20 and so I got to learn all the differences between TRS80 BASIC and Commodore BASIC. Immediately I had opinions about coolness and suckage between the two languages. Another critic was born!

Sometime after that, it must have been Christmas of ‘85 or ‘86, the family got an Atari 800XL. It had a TAPE DRIVE. It had a slot for a cartridge, but I never, ever used the cartridge. Games were way too expensive said that parents and so I never got any. Now I’m told there was a huge piracy ring for trading games on floppy disk back then, but notice I didn’t say I got a floppy drive. I didn’t. So I didn’t pirate software. I didn’t play hardly any games except for a few which someone did pirate to me on cassette. Lacking games, I learned to program.

It was an awesome experience as a seven or eight year old to learn to program the 800XL. Later I learned that the LINE, DRAW, CIRCLE and FILL commands which I learned to love on that ATARI BASIC were not on C64. Actually I learned that months later when I was visiting my Uncle or someone else who had a C64 and I tried these drawing primitives and they didn’t work. It was later that I learned that C64 just didn’t have these and I realized how blessed I was to have gotten the ATARI. I remember learning Cartesian Coordinate systems in grade school and thinking they were backwards(graphics occur unsigned with numbering like the 4th quadrant of a Cartesian system), but quickly adapting and thus being ahead of my grade school peers.

In summer of ‘87 the family got an Amiga 1000 with the 512K expansion unit and a second external double density 3.5″ disk drive used from a coworker of my pops. A WHOLE NEW WORLD WAS REVEALED TO ME as I learned BASIC WITHOUT LINENUMBERS! It turns out that Microsoft wrote the versions of basic that shipped with the Amiga Workbench versions 1.2 and 1.3 and while I had versions 1.1, I didn’t like the funny screen that popped up with the 1.1 BASIC which was not from Microsoft. So I learned non-line numbered procedural programming around age 10. 1987 was a fun year. The drawing primitives on the Amiga Basic were very similar to that on an Atari so I was able to draw fun pictures and play with geometry.

The Amiga also came with a FORTH interpreter and so I followed the manuals to do some simple FORTH program.

The Amiga also came with a C compiler called North C. I tried and tried and tried to get Hello World to run, but I don’t think I ever succeeded. At 12-14 years old, I had no idea what compiling and linking were all about. I was used to interpreted BASIC.

After IBM Clones (that is what we called PCs back then) looked like they were the winner, I begged and begged and begged for one and after a few years off from learning much about computers, I got one. In 1991 it was a 486 33Mhz DX with 4MB of RAM and a 100MB disk. Yes I typed 100G the first time I typed that. We ordered it with a 80GM but they had some inventory issues so gave us a 100MB. It was sweet. I learned DOS and played with Windows 3.0. I programmed QBASIC.

I saved up all my allowance, because that is what 12year olds do, and I got a modem, 2400 baud baby! It was a $30 BestData brand modem. I got to set jumpers and insert it into a free ISA slot in the 486. BBSing was awesome. Later a 14.4kbps modem came too.

Then came my drivers license, the job in food service and high school girls. Programming took a back seat.

After high school I got a job operating a Unisys mini-computer (yes, as opposed to a mainframe or microcomputer) at the world headquarters of a small local paper and plastics manufacturer. This horrible job is where I decided for sure that I was going to go to college. One of my jobs at this place was searching for certain text in the green and white mainframe print outs. Later I would assume that no one on the IT staff there knew what grep was. I was human grep.

Then came College, a brief stint with a Computer Engineering program before I switched to Computer Science where I belonged.

What was your first language?

BASIC, DUH!

What was the first real program you write?

I’m still waiting to write it.

What languages have you used since you started programming?

I lost count somewhere in the late 90s, but for the sake of keeping up with others who followed this Meme, I will try. In order as I recall:

BASIC, FORTH, PASCAL, C, C++, VB, SQL, Bash, JAVA, HTML, JavaScript, PHP, Python, Pike, IDL, ML, Modula-3, VHDL, Perl, C#, Ruby, Boo, F#

What was your first professional programming gig?

Three years ago when I started working at ADP writing custom software to aide in managing their Hosting Center. All jobs prior to this were System Administrator jobs which I may have scripted or programmed, but programming (or delivering software) was not my primary responsibility in those roles.

If you knew what you know now, would you have started programming?

Yes, although I may have kept it a hobby rather than doing it professionally. Sometimes, I wish I was a lawyer.

If there is one thing you learned along the way that you would tell new developers, what would it be?

That guy over there that you think is so smart is just a man just like you, trying to be the best programmer he can be (hopefully) just like you.

What’s the most fun you’ve ever had… programming?

Fun? What is so fun about it? Its hard damned work!  J/K

I can’t place just one thing. Most thoughts are of the little graphics programs I wrote as a child. The first time I ever pair programmed was in college and that definitely stands out.

Update: I showed my Mom this article and she reminded me that she used the Atari 800XL to practice her typing for her secretarial work. She told me a great story about how I asked her “When you press the R on the keyboard, how does the R show up on the screen?” And like most computer users, she didn’t know, but I was a 7 or 8 year old who could read and so she handed me the manuals and I started reading them. Most of the manuals we had were on BASIC and getting started and so I guess the curiosity of getting the R on the screen is what triggered the curiosity of how these PRINT, INPUT and LINE commands make things appear on the screen. Thanks for the good memory Mom.

Vista Error Reporting, Can It Report Its Own Errors?

June 12th, 2008

Application Error Reporting Crash_2008-05-16_15-04-00

I found this funny. Can it report its own errors?

Visual Studio Task Tokens Help Me Find Smells

June 11th, 2008

VS TaskTokens_2008-06-10_12-29-43

I work with some great people whose initials are BWW, DWH, etc. They already comment up a code base which I inherited with their initials. Visual Studio’s Task List feature lets me get a list of all of these comments just bad adding their initials as tokens.

I’ve also added a token named “SMELL” for when I see something I think is code smell, but I cannot fix it immediately.

Now, my proposal is for teams to exploit this feature. A small team could easily get all of the initials of its team mates and add them as tokens and then export only the Task List settings from VS and post that to their web site, repository, wiki, whatever for all of the team to download and import into settings.

This might be a cool team feature for teams who don’t have blame setup in their source control management system.

C# is already whitespace significant

June 10th, 2008

error CS1040: Preprocessor directives must appear as the first non-whitespace character on a line

 

Of course you would put an #if or #pragma on its own line, but what if you didn’t?

#pragma warning disable/restore makes sense to be on the same line as the warning generating code. But in this case the C# language is white space significant. Why not extend this to other areas of the language?

Using xmllint because xml still sucks

June 6th, 2008

I already mentioned how to get human readable xml from the non-human readable.

Today I had a human readable xml file, but it had many branches, some deep, with lots of information in it. I wanted to know only the names of the nodes which are direct children of the root node.

e.g.

<someRootElement><firstChildOfRoot><someOtherBS><couldBeMoreBS>… </…> …</…></firstchildOfRoot><secondChildOfRoot>…insert tons of crap here</secondChildOfRoot><nextchild…

I could have done this by paging the file, but this would not have scaled. It was just long enough that I didn’t want to do this.

xmllint rescued me again. I started in shell mode

$ xmllint –shell mystupid/xmlfile/thatIhate.xmlhated

Then I am greeted with an xmllint prompt with which I can navigate my xml document much like I do a filesystem with command like ls and cd.

/ > ls
—     21 someRootElement
/ > cd someRootElement
someRootElement > ls
ta -   3
—     21 firstchildOfRoot
ta -   3
—     21 secondChildOfRoot

Pretty cool eh?

<3 Tools.

The Fastest Readable Xml

May 17th, 2008

I hate xml.

I really hate it. No humans should have to read it.

As a developer, if I have to even think about Xml, then it is because some developer before me made the wrong choice.*

That said, sometimes a developer full of contempt toward Xml does need to read xml.

Both feedburner and WordPress output mostly well spaces xml, but what if I look at rss from blogs.msdn.com? It looks like the webserver is running a whitespace filter. This is not human readable Xml. Now, I COULD copy and paste into Visual Studio, but then I have to open a new xml document, or save what I’m viewing in the browser and open in Visual Studio. All too many steps.

Cygwin comes with an optional program called xmllint. It is part of the libxml2 package, so be sure to select libxml2 when you run cygwin setup.exe.

$ curl http://blogs.msdn.com/giorgio/rss.xml | xmllint –format - | less

This reformats the xml into a nice 2-space indented by tag display.

* This may be a bit extreme, but I will stand by it most of the time.

C# vNext feature request

May 15th, 2008

At Ann Arbor Dot Net Developers meeting last night, Eric Maino was there. I don’t think he meant to open up the giant can of worms that is me when he asked “What kind of things would you like to see in the next version of C#?” Here is my list.

  • Static Imports

    yes like java!

    Sometimes extension methods aren’t as readable as just a method call. Ability to import static methods and call them without the class name would be super.

  • Drop var.

    Type inference rules. Can we drop the var? its noise.
    var x = 1;
    x = 1;
    which of these lines is more concise? At least make it optional. I don’t mind if you want to say var. Just don’t make me do it.

  • Better type inference

    Optional type parameters, since the compiler knows what I mean!
    peeps = List(new string[] {”Bob”,”Dorothy”,”Jane”});
    This is a List<T>, but I don’t need to say List<string> the type can be inferred via the List<T>(IEnumerable<T>) constructor.

  • Optional Whitespace Significance

    We all use whitespace formatted code anyway. Why not just drop the parenthesis and semicolons and make the whitespace actually mean something. Of course I say “optional” because not everyone will like it. It would be really cool to be able to toggle it throughout a file.
    #pragma whitespace significance enable
    public class Employee
      public Employee()
        name = string.Empty
        hireDate = DateTime.Now
      public string Name
        get
        set
      public DateTime HireDate
        get
        set
    #pragma whitespace significance disable
    public GiveRaise() {
    salary *=1.10;
    }
    #pragma whitespace significance enable
      public Promote()
        CLevel–

    The file would have to end in the same mode in which it were started, or the compiler can figure things out.

  • A hook into the compiler pipeline

    See boo.

  • A hybrid compiler

    At CodeMash, Joe O’Brien and Michael Letterle about how nice it would be to use the better suited language for any given task in .NET. We don’t want separate projects. We don’t want separate netmodules.

    I want it right down to partial classes. VB’s XML Literals and late binding are sweet. I want to use those if I need. C#’s everything else are what I prefer to work with.

    ReadYourFeed.cs:
    public partial class ReadYourFeed {
      Initialize(){
        rss.FirstChild.AppendChild(GetGenerator());
      }
    }

    ReedYourFeed.vb:
    Partial Public Class ReadYourFeed
      Public Function GetGenerator()
        Dim sig = <generator>SuperReadYourFeed 2000 1.2.3.4.5</generator>
        Return sig
      End Function
    End Class

    * I don’t know VB. Writing that VB took me much googling

  • A plugable compiler

    Similar to the above with boo, but almost the inverse. I want an open definition for the AST which the compiler uses to generate IL and I want a great API for building this AST myself.

    Next, I should be able to plug in my own parser/lexer which builds this AST. So the IL generation from the AST is entirely from the (now more than) C# compiler, but the parser is mine.

    This is really an abstraction and opening of the previous step. Instead of just C#/VB, I want it ALL!

  • Easier method currying.

    Dustin Campbell might like writing lots of code to do it in C#. I’m sure he does it all the time, but I’d like to be able to do it in FAR fewer lines of code.

  • F#’s pipeline operator.

    This is more readable
    {1..10} |> Seq.fold (+) 0;;
    than this
    Enumerable.Aggregate(Enumerable.Range(1, 10), (a, b) => a + b);
    or this
    (from i in Enumerable.Range(1, 10) select i).Sum();
    or even this
    Enumerable.Range(1, 10).Sum();
    Ok, well extension methods sure look a lot like the pipeline operator, so never mind on this request :)

It seems like I talked about other crazy stuff too, but I don’t recall what things they were.

Creation of Open Space

May 11th, 2008

via Gregg Newsom

 

Open Space is an awesome format for meeting and conferencing. The Day Of Dot Net Conferences have been promoting it with varying success.

Personally, I love it when a conference has space set aside for Open Spaces, if the conference isn’t entirely open space format. There are only so many times I can sit through another presentation about something I have seen before. Open Spaces does provide an alternative for us overly selective types.

More importantly, it provides a place for you to get out of it exactly what you put into it. What do I mean by this? How many times have you said “yeah, that would be awesome” to some idea when you were talking with someone at a conference? Open Spaces provides the means to make that idea a reality. Next time this happens to you, please grab that person with whom you were speaking and march directly to the open spaces room and begin working, planning, designing, developing, whatever-ing. Maybe make a pit-stop at the Open Spaces board on the way.

I can’t wait for the upcoming development tools focused open space event at SRT Solutions. I love my tools. I’m passionate about my tools. Like any good craftsman, I have my favorite hammer, my favorite saw, and my favorite drill. I feel crippled without my own tools. Ask a craftsman to build you something and give him unfamiliar second rate tools and see what happens :)  You probably will not like the results.

When you don’t know the language…

April 24th, 2008

internal static short uiShiftRightBy8(short x)
        {
            short iNew;
            iNew = (short)((x & 0×7FFF) / 256);
            if( (x & 0×8000) != 0)
                iNew = (short)(iNew | 0×80);

            return iNew;
        }

 

AHHHHHHH!!!!*

Nevermind that this was public even though it was used only once by the class in which it was defined. Nevermind that this was not marked static even though it uses no member functions. (Also nevermind that I made it internal instead of private so I could test it and make sure it was as stupid as I thought.)

When you learn a programming language, even when you can get things done in it, it still adds tremendous value to you as a programmer to READ A FRAKKING BOOK on the language. The above code works, absolutely. It does exactly what the writer intended. When the #1 concern when writing software is “do whatever is needed to ship it now, and you have no time to better yourself” you get this code. IMO maintainability should be #2 concern directly following “does it work?”

I’ve entirely removed the above code and replaced it with the operator and value it implements: >> 8

Yes it really is Shift Right by 8. Yes, someone didn’t know about the >> operator. Yes I wasted time reading code that uses this method. Yes I don’t want to think about the performance characteristic of this in a tight loop in critical systems.

*my coworkers laughed when I said AHHHHHHH!!! outloud. At least bad code provides us with solid entertainment.

Speculations about .NET 4.0

April 23rd, 2008

I found this in my Live Writer drafts. I figured I should send it, since its been a month and I haven’t thought of anything to add to it.

*insert timewarp to March 18th, 2008*

I was at the Visual Studio 2008 launch in Detroit today. This was my 3rd Microsoft Launch event. The first being Visual Studio 2005 and the second being Vista/Office2k7. As a developer the Vista launch was really the .NET 3.0 launch to me.

One thing I’ve learned that I don’t do well and I need to do better is future think. What is next?

  • ASP.NET 3.5 “extensions” will be known as ASP.NET 4.0
    • ASP.NET MVC (see MonoRail)
    • ASP.NET Dynamic Data (see Rails scaffolding or MonoRail scaffolding)
    • ASP.NET AJAX (browser history, but I expect more here)
    • ADO.NET Entity Framework (see NHibernate)
    • ADO.NET Data Services (many projects to see here, snooze is one)
    • Silverlight Controls for ASP.NET (I expect much more here)
  • Full development support for Silverlight will ship along with this release.
  • WPF finally get an editable Grid. It won’t be named DataGrid, DataGridView or GridView(exists in WPF as a ListView mode). It may be named DataViewGrid or GridDataView.
  • A WPF “Dynamic Data” library complements the ASP.NET extension.
  • The System.Core.Enumerable class gets a Each extension method. Its name endlessly confuses developers who don’t understand why it wasn’t there in 3.5 and who don’t know why it isn’t ForEach like Array and List<>. Developers start calling Microsoft’s naming difference a “catch up to Ruby”.
  • A handful of new Workflow activities are released but no one knows what they are, what they do, or how do to use them.
  • Cardspace continues and adds even easier support for OpenID but no one knows what they are, what they do, or how do to use them.
  • Like the 3.0 release the languages and compilers don’t change.
  • a DI/IoC container with a subset of the features of Windsor, Spring.net, StructureMap or even EntLib ObjectBuilder is included!
  • DLR still won’t ship. No IronPython. No IronRuby. Python and Ruby will remain the most common languages used in demo for Silverlight.
  • Visual Source Safe is still the recommended version control system if you can’t afford Team Foundation Server. WTF?
  • There will be some hidden PerfCounter, WMI, awesomeness. It won’t be documented very well.
  • Hibernate and NHibernate users everywhere are stunned and gape mouthed when they see Entity Framework. Then they fall out of their chair laughing. “We hate maintaining our single HBM files, you want to maintain 3 uglier XML files (CDSL, MSL, SSDL)?” Microsoft answers these cries with “use the designer”, but the power developers want to do things that are only possible in the XML that the designer cannot do.