08.29.08
Posted in Apple, Journal, Software Development, TDD at 6:01 pm by Pablosan
Day 4: I retract my previous correction. As of last night, Apple must have finalized their credit transactions as I have now officially been charged $107.17 for my iPhone Developer Program application. Still no word from them on the status of my application. All I get is:
“We are currently processing your enrollment application and will be contacting you soon.”
That’s just grrrrrrrreat… and no, not the Tony-the-Tiger kind of great. Maybe they should consider having the same group that optimized their billing process look at the application process. I’m sure they’d find significant room for improvement.
Meanwhile, I’m working feverishly on the content for a new, one-day Advanced TDD class at work. I think I’ve got a pretty good problem-space: Test-Driving algorithms, a design pattern (Singleton, to be exact) and concurrency/threading in Java. I’m supposed to teach the class for the first time in 10 days, so I’m starting to feel the pressure.
Like a very good friend of mine is fond of saying, “if it weren’t for deadlines, ain’t nuttin’d get done!”
Permalink
08.28.08
Posted in Agile, Apple, Journal, Software Development, TDD at 2:21 pm by Pablosan
Day 3: Still no word from Apple on my iPhone Developer Program application. In the words of Roz (aka “Number One”), “their stunned silence is verrrrry reassuring!” </sarcasm>
I have a confession to make: I did not use TDD 100% of the time on my iPhone App project <gasp!>. Sorry. I should have made sure you were sitting down before saying that.
Here’s how it happened: I started with the Model, which was developed 100% using TDD and enjoys 100% test coverage. Very cool. Once I had a pretty good handle on the Model, I started work on the View, which is a blast using Apple’s Interface Builder. It’s all drag and drop: even wiring the View to the View Controller! Since creating the View did not entail writing a single line of code, it was not Test-Driven. I suppose the purists are screaming “That’s no excuse!” at this point, but I just didn’t feel the need. And, no, that’s not my confession.
Let’s see… the pattern is MVC and I’ve talked about the “M” and the “V”. I’ve thought of several explanations as to why I didn’t Test-Drive the Controller, but they all end up sounding like excuses. A colleague of mine once told me “I’ve tried test-driving the Controller, and I don’t see the point”, but I can’t even claim that as my reason.
I spent a little time thinking about how to Test-Drive the Controller, and I couldn’t figure it out. I mean, all it does is pass a message or two to my model and send messages back to the one view in my app, keeping it in sync with the state of the model. The cool thing about my approach was that I successfully kept the Model from creeping into the Controller, and you’d have to work very much against the tools (XCode and Interface Builder) to get the Controller to seep into the View. I’m completely satisfied with the way the app abides by the Separation of Concerns principle, and I am confident the app is solid… though, not as confident as I’d like to be.
So it bugs me that I didn’t Test-Drive the Controller. I’ve gone back and looked at the code several times in the past few days, and I still don’t have an answer. Maybe I’ll spend some time re-creating the app in Java (using Swing or SWT… or something) with my friend, Jeff’s article as a guide. I’m not yet ready to admit defeat!
Permalink
08.27.08
Posted in Apple, Journal at 11:01 am by Pablosan
In yesterday’s post, I mentioned that Apple had already billed my credit card. I re-checked today, and that statement was not exactly accurate: the charge is showing on my credit card, but it is showing as “pending.” So the funds have not actually been deducted from my account yet.
I’m still spamming the “Get Mail” button on MobileMe, to no avail (I need to be careful: I might wear it out). If I ever find the guy that told me email will get delivered faster if you hit the button faster…
Yes, yes, patience is a virtue… a virtue I do not possess.
Permalink
08.26.08
Posted in Apple, Journal, News, Software Development at 3:24 pm by Pablosan
It’s been over a week since my last post, and there’s a good reason for that… in my mind, anyway.
I’ve made mention before of my desire to try my hand at developing for the iPhone, and I’ve been working on a little project over the last month toward that end. This last week has been a mini-sprint, brought on by the fact that my little project was really starting to shape up. This morning (at about 1:30) I came to a startling realization: it’s done. I mean, there are still things I want to implement, but the app is handling the basics just fine and (thanks in large part to TDD) the app seems to be quite solid. There is only one problem…
I made a promise to myself: I committed to putting off paying for the iPhone Developer Program until I actually had a product ready to ship. There have been too many times in my life where I had the best intentions, dropped the cash, and then never did anything with the tools. A prime example: back when the Palm Pilot was still owned by US Robotics (yes, it was… trust me), I dropped the six hundred bucks to get the whopping 1 Megabyte version that came bundled with the SDK. I had big plans to take over the world with my new PDA and it’s accompanying SDK! Guess how many lines of actual code got written? That’d be none; zilch; nada. Yeah… pretty sad. And that is just one of several personal examples.
So, this time… this time was gonna be different. Shortly after my startling realization (about 1:45 am), I started reading up on the iPhone Developer Program, hit the web site and signed up, fully (and ridiculously) expecting to see my nice, shiny new app on the App Store within minutes… okay, maybe an hour. Yes, I had heard the stories of how slow the process was, but I was operating in hyper-delusional mode at this point (hey, I was sleep deprived!). Squinting out of droopy eyes, I frantically spammed the “Get Mail” button on MobileMe, staving off sleep for just a bit longer. About five minutes later I hadn’t even received the customary emailed receipt, let alone directions on how to continue the arduous process of becoming an official iPhone Developer. Call me a wimp; pansy; whatever… I went to bed.
The emailed receipt has since appeared in my Inbox. And I just checked my credit card online, and I see that Apple seems to have the billing part of the process running quite smoothly, ’cause I’m down $107.17. I haven’t researched what the average turn around time is: I don’t want to know.
So I wait. In the words of the famous Inigo Montoya, “I hate waiting… I donna suppose you could speeda things up?!”
Permalink
08.18.08
Posted in Agile, Iterative Development, Software Development, TDD at 8:01 pm by Pablosan
See, I told you I’d get back on track when I wasn’t so distracted! My latest Erlang article, Strings ‘n’ Things is up on CodeNotes. I ran into a little trouble with character encodings. I wanted one of the tests to demonstrate the extended characters that Erlang supports (ISO-8859-1, a.k.a. Latin-1) and they weren’t getting encoded properly by my article generator application. After some digging, I figured out that I did not have vim configured correctly (everything was UTF-8 except for vim, which can be fixed by adding “set encoding=utf-8″ to your .vimrc file, btw). Once that was fixed, I was back in business.
My primary lesson-learned in this coding session is that Erlang is probably not the best choice if you need to deal with multiple character encodings, or even if you’re looking to support UTF. I don’t see that as a significant problem, as it would be quite effective to use Erlang for “heavy lifting” tasks, and relegate character encodings to something much friendlier… like Ruby (especially Ruby 1.9).
This latest revelation almost caused me to look for a different functional language… almost. I’m totally sold on Erlang’s approach to concurrency, though. It is dead simple and avoids the mess of multi-threading and shared memory. I know it’s not the only language out there that takes the message-passing/no shared memory approach, but I’m pretty sure any other language I look into will have it’s share of peculiarities.
This is the last article covering the basics of Erlang, and it was finished just in time. I’m ready to move on to some heavier stuff.
Permalink
08.15.08
Posted in Journal at 11:15 pm by Pablosan
Today I woke up distracted. Of course it was probably due to just finishing up a two-day SOATest class. While I thoroughly enjoy teaching, it does seem to take a lot out of me.
I set up a new project to work on my next Erlang article and found my mind wandering. There have been some minor layout issues on my web site that have been bugging me for a while, and I started thinking about those. That reminded me of the lack of a consistent L&F across my websites, which then reminded me that something about my TDD logo was bothering me.
I started thinking I might need to start a To-Do list <gasp!>, and that thought shocked me into action. Now, at the end of the day with the dust settling I’m very pleased with the results. I’m much happier with my SalientBlue main site, and I was able to fix most of the issues with CodeNotes.
I didn’t make it back to my Erlang article and that’s okay. I’m looking forward to working on it… when I’m not feeling so distracted.
Permalink
08.12.08
Posted in Agile, Iterative Development, Software Development, TDD at 10:02 pm by Pablosan
Objective-C’s, X’es and O’s – Part 2 is now up on CodeNotes. This article finishes up my exploration of Test-Driving a Tic-Tac-Toe model in Objective-C. There is still more that could be done with the model, but I needed to stop somewhere.
The test class is about 2.5 times larger than the production class, which seems about right for this type of problem. The resulting test coverage is comprehensive, and the code quality seems high to me.
The other thing I noticed is that, since I show all of the source code with every change, the articles can get a bit long. I’m considering changing the format so that just the changed/added lines are shown, but I think seeing the entire class/interface/whatever improves comprehensibility.
This has been a good break from Erlang for me, but I’m eager to get back to my favorite functional language. So look for a new Erlang article soon!
Permalink
08.11.08
Posted in Agile, Iterative Development, Software Development, TDD at 5:32 pm by Pablosan
Objective-C is… interesting. There are some things I really like about the language. The message-passing metaphor works really well for me: I like it a lot. I also like the “annotations” that help distinguish the interface from the implementation (it seems like syntactic sugar, but I still find it helpful). I was disappointed by the inability to use a static const for the size component(s) in array initialization: being forced to use a #define… well, hurt… just a little (as described in my previous Objective-C post).
OCUnit seems to be a decent implementation of the xUnit framework as well. Unfortunately, they didn’t provide convenience Assert methods that don’t require a comment, so I felt like having comments on every single Assert cluttered up the tests just a bit. That could be easily fixed, but I can’t quite figure out the current state of the OCUnit framework. The Sen:te site hasn’t been updated in over three years, so I’m afraid OCUnit has been swallowed by Apple. And once something has been swallowed by “Mr. Proprietary”, it’s untouchable.
Test-Driving a Tic-Tac-Toe model is a blast: I think it should become a Code Kata. The article, Objective-C’s, X’es and O’s, Part 1 will be concluded with a follow-on article very soon. The article is plenty long, but there were still a few more things to implement to complete the model.
One final request: it would be really helpful if someone with extensive Objective-C experience could critique my use of the language. I feel like I have a fairly good grasp of the language, but it wouldn’t surprise me if I’m missing things.
Enjoy!
Permalink
08.08.08
Posted in Agile, TDD at 2:37 pm by Pablosan
I have been eagerly watching my site statistics, very pleased with nice, gradual growth in readership. The month of July ended up being my busiest month to date, and I was pretty happy with that: until this morning…
I’m currently using a mix of my web host’s metrics and Google Analytics to track my progress and I dutifully checked them both, looking for a little more traffic. At first, I was pretty sure there was a major bug in Google Analytics because, if the numbers were right, I’d just had one, busy day that blew away my busiest month! Further research indicated an inordinate number of links in several different forms from one site: Reddit. Cool! I decided to dig (pun intended) into this further.
It took me a while, but I finally just entered “TDD” in Reddit’s search box and hit enter. Yep, there I am! What amuses me most is that, at least at one point, I must have been pretty high in Reddit’s “Controversial” category because 16 people found my blog entry from that page alone. Wow! I guess I really stirred up the hornet’s nest with my Why TDD is Unpopular entry.
I really shouldn’t be surprised… but I am. I knew the discipline of TDD had it’s share of proponents and dissidents; and I knew that the practice could be somewhat polarizing, but wow… just… WOW!
Excuse me for being rude and cutting this short, but I really need to get back to my TDD mantra chants and brain-washing tapes. Vive la révolution! <rolls eyes>
Permalink
08.06.08
Posted in Software Development at 10:12 pm by Pablosan
Learning new programming languages, while being a lot of fun (for me, anyway), can also be quite frustrating. It’s those stinkin’ pre-conceived notions that get me every time.
I spent more time today than I care to admit trying to use a “static const” to initialize a plain ol’ C array… in Objective-C. I spent several years of my career as a C++ developer, and “prefer static const to #define” was drilled into my head (Effective C++
): lean on the compiler whenever possible.
So I wrote the following Objective-C code in the “interface” file (somewhat analogous to a C header file, and uses the file extension “.h”):
static const int BOARD_SIZE=3;
@interface TicTacToeGame : NSObject {
@private
int board[BOARD_SIZE][BOARD_SIZE];
bool isO;
int totalMoves;
}
- (int) makeAMoveInRow: (int) row andInColumn: (int) column;
- (int) squareRow: (int) row andColumn: (int) column;
@end
I was surprised (and, over time, quite frustrated) by the fact that this code wouldn’t even compile. I kept getting the error:
error: variable-size type declared outside of any function
After a bit of Googling and digging through XCode’s documentation I started running across comments telling posters that they were trying to use C++ code with gcc set to compile to C. That wasn’t my problem exactly, but it prompted me to try changing that first line to:
#define BOARD_SIZE 3
Well whad’ya know?! It compiles! So much for using my years of C++ experience to quickly ramp-up on Objective-C. First important lesson learned: it’s not Objective-C++, it’s Objective-C. <sigh>
Permalink
« Previous entries Next Page » Next Page »