The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
My Apprenticeship - Friday, July 2, 2004

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jake Scruggs

Posts: 336
Nickname: aurorae314
Registered: Feb, 2008

Jake Scruggs is a developer at ThoughtWorks
My Apprenticeship - Friday, July 2, 2004 Posted: Jul 2, 2009 10:18 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jake Scruggs.
Original Post: My Apprenticeship - Friday, July 2, 2004
Feed Title: Jake Scruggs
Feed URL: http://jakescruggs.blogspot.com/feeds/posts/default
Feed Description: Ruby, Rails, Metrics, Testing, and pursuit of clean code.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jake Scruggs
Latest Posts From Jake Scruggs

Advertisement
This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

Friday 7-2-04

We did use my code in the wiki conversion program. And while it was good to finish up that project, this meant we had to start working on the State Map Compiler. A program first written in 1993 in C++, then later re-written in Java in '98. No tests, very long methods, and the documentation gives lots of examples in C++ (which I don't know much about -- it seems like Java, but it most definitely is not.) The point of the program is to take in a simple statement of a 'state machine' and output source code that implements the state machine in either Java or C++. We are going to be adding a C# output option to this program.

Now, at this point, you might be wondering: 'What is a state machine?' Well, let me attempt to regurgitate the turnstile example. A turnstile has two states: Locked and Unlocked. If you try to pass through a turnstile when it's locked, you'll get quite a different response than when it is unlocked. A coin will cause a locked turnstile to become unlocked, but won't do much to an unlocked turnstile. A lot of software engineering problems can be thought of a nothing more than a dressed up turnstile with a few more states. So it's handy to have a program that takes in some information about a finite state machine and then outputs the basic code that you can build your implementation around.

Also, it's pretty interesting to be working on a compiler. Software that writes other software (that, ultimately, will be translated into byte code, and then the byte code will be translated by the virtual machine so that the real machine will know what to do -- quite a process).

Not a bad explanation of a state machine for guy who just learned about them that day: Good job distant-past-jake. I think ended up using a state machine pattern in my code submission to ThoughtWorks later that year.

I later worked on a huge java project that would generate something like 15 classes for every one written class. I soon got very tired of generated code ("Hey, why did my changes go away? Oh, it's a generated class... (next line said forlornly) Guess I better go dig through the xml pit for what to change.")

Read: My Apprenticeship - Friday, July 2, 2004

Topic: Producitivity tip: Let Derek Sivers Take Notes for You Previous Topic   Next Topic Topic: Interview: Author Paolo Perrotta

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use