Saturday, April 3, 2010

Learning How to Program My Mac

The interesting thing about writing Mac apps using Cocoa is that I don't really have to write much code at all to do something interesting.  Apparently it's the Mac Developer's motto.  A lot of the complexity is hidden by Interface Builder and nib/xib files.  Part of the problem for me, however, is that I am so used to writing lots of code in Java in order to do anything useful.  I don't use any Microsoft crap, so I have no access to Visual Studio, and finding a decent GUI builder like Mac's Interface Builder for creating Java SWING or SWT apps has proven to be difficult.

NetBeans has a very nice Swing GUI builder, but no matter how I try to optimize NetBeans for my Mac, tweaking stack and heap numbers, it's slower than a pig trying to swim in quicksand.  And while the performance in the latest Java 6 SE SDK is apparently remarkable, Apple is always behind when it comes to supporting Java.  It's like they wait six months or more before catching up.  True, Apple is only one revision behind, but it is very frustrating waiting.

So back to Cocoa...  Cocoa makes heavy use of the MVC pattern, and you have to understand things like bindings, outlets, actions, etc.  I keep looking at example source code, and it is confusing.  Some people do more work than is apparently necessary--I think this is older code.  And I am always trying to find a way to code something when I don't really have to.  The documentation isn't bad, but it's dense and it seems that there are so many things you have to understand first, so I am constantly going from one document to the next, or looking up API references, etc.  I try to do entirely too much at once rather than just taking my time.  No patients I guess.

The first app I was trying to make was something similar to, albeit far less complex than, OmniOutliner.  I always seem to take on too much as once.  But unless it holds some interest, I just can't be bothered.  Anyway, I will post my progress on this project.  I'd post now, but I've already trashed my last three attempts and haven't learned much in the process.

Oh yes.  One more thing.  The book "Cocoa Programming Developer's Handbook" by David Chisnall, which I have mentioned before, has been wonderful.  I can't recommend it enough.

Reblog this post [with Zemanta]

Wednesday, March 17, 2010

Objective-C Programming

I'm learning how to program in Objective-C and the Cocoa framework so that I can write Mac OS X applications.  I purchased a book by David Chisnall called "Cocoa Programming Developer's Handbook" that is turning out to be an excellent book.  I'm a long time Java developer and prior to that I wrote software in C++ and C.  Objective-C is a very interesting language and odd.  There are things to me that don't make much sense.  But when I found this article by Chisnall, things became clearer.  I'll definitely have more to write about once I get really into it.  But if you're interested in writing apps for OS X, definitely check out Chisnall's book

Reblog this post [with Zemanta]

Monday, February 22, 2010

Eclipse RCP and Python

The two have nothing to do with each other in this post.  But I felt like griping about something.

So with the Eclipse RCP (rich client platform) technology, in theory one can create an eclipse-based application and run it on any OS that has a compliant Java runtime.  So why do I find that there are many Eclipse RCP applications designed to work on only certain operating systems (mostly Windows and Linux)?  I just don't understand.  These same apps should work on OS X, too.  It doesn't make any sense to me.

Now for python.  I'm not sure why this is the case, the documentation is no help, either, but why when defining a class and its methods do you have to put for its first argument the keyword 'self'.  Huh?  Can't it just be implied?  I mean look at this code:

class Bag:
    def __init__(self): = []
    def add(self, x):
    def addtwice(self, x):

What's with all of the 'self' parameters?  Is this not just like a waste of bytes?  This is from the python tutorial:

Often, the first argument of a method is called self. This is nothing more than a convention: the name self has absolutely no special meaning to Python. Note, however, that by not following the convention your code may be less readable to other Python programmers, and it is also conceivable that a class browser program might be written that relies upon such a convention.

No special meaning?  Just a convention?  Huh?  WTF?  It just seems ugly and stupid to me.  No doubt there is some underlying reason for this convention.  It had to come from somewhere.  I just don't get it.  Yuck.

Reblog this post [with Zemanta]

Thursday, January 7, 2010

Thinking About Candy

So the other day I was thinking about candy and was messing around with MagicDraw and figured what the hell.  Here is a model of candy.  In my humble opinion of course.

And here is the use case.

Monday, November 9, 2009

A Social Network

I am modeling a social network using UML.  I call my new web 2.0 social network software... get ready for it... Social Network  Okay so it needs work, and besides this model is all theoretical as I try to distill what I believe are the components of any kind of social network as it is understood today.  Perhaps later I will prognosticate and design the social network of tomorrow... just not quite sure what that might be yet.

Okay, so I'll start with some use cases and a couple class diagrams.

So I use UML, despite where software architecture is heading (e.g. Domain-Specific Modeling), because I've been doing it for a long time and I think it is a great modeling language.  It's general, robust, perhaps a little complex (have you read the OMG UML 2.x specs) and it's what I like.  I've noticed that you can use UML to model a lot of things that aren't software.  You can model anything that is a process and that has parts, which makes sense since a process that has nothing to process or process by is not a very interesting process.  But more on this later.

The first use cases (I am doing this design in no particular order) are the simple member account creation and the member profile update.  Note that the Account subsystem (it is assumed that Account is a subsystem of Social Network) contains the Profile subsystem.

The classes are simple. We have the Social Network class and show that it contains 0 or more members.  And we show a member class that contains a profile class that itself contains some sample classes (Photo, Interest and Bio).  Obviously none of this is concrete, but the names are informative and are good enough for this purpose.

Okay.  More later.

Reblog this post [with Zemanta]

Saturday, October 17, 2009

Software Architecture: What is it?

This is hardly an introduction to the subject, but it might serve to give the non-technical some idea about the nature of this blog and what it means to design and build software. At least that's the plan. So onward we go.

I am very proud to say that I am a software architect.  And when asked to explain just what it is that I do I answer with something like: "Well, a little bit of this, a little bit of that.  I draw pictures, write papers, build prototypes...  Oh, and I get paid a ridiculous amount of money." Rarely does anyone probe further, but sometimes I'll be asked just how much money does a software architect make, to which I answer: "quite a bit more than one might think," which of course is really not an answer, but for some reason it works to redirect the conversation on to something else, which most of the time becomes mundane; it is at this point that I tune out the noise and enjoy the pleasure of thinking about software.

But what is a software architect and what is software architecture? There are very few people not in the software industry who have heard these terms, and fewer still who think they know what these mean--in fact not many (if any) software architects know what software architecture is, including myself.  But I suppose one answer is that a software architect designs software by building models using an arcane language called a modeling language to describe the intended behavior of the software. This is then read by programmers and software engineers who use their own arcane language called a programming language to create, ideally, software that behaves as the software architect's design dictates.

This blog, then, is intended to inform the interested about the pleasures and pitfalls of software design.  Certainly the nature of this blog is technical, but not so much so that the intelligent layman won't be able to grasp the general concepts.

Reblog this post [with Zemanta]

Tuesday, October 13, 2009

Disclosure Policy

This policy is valid from 11 November 2008

 This blog is a personal blog written and edited by me. For questions about this blog, please contact  Thomas Clancy (

 This blog accepts forms of cash advertising, sponsorship, paid insertions or other forms of compensation.

 This blog abides by word of mouth marketing standards. We believe in honesty of relationship, opinion and identity. The compensation received may influence the advertising content, topics or posts made in this blog. That content, advertising space or post will be clearly identified as paid or sponsored content.

 The owner(s) of this blog is compensated to provide opinion on products, services, websites and various other topics. Even though the owner(s) of this blog receives compensation for our posts or advertisements, we always give our honest opinions, findings, beliefs, or experiences on those topics or products. The views and opinions expressed on this blog are purely the bloggers' own. Any product claim, statistic, quote or other representation about a product or service should be verified with the manufacturer, provider or party in question.

 This blog does not contain any content which might present a conflict of interest.

To get your own policy, go to
Reblog this post [with Zemanta]