The
Ultimate
Business Machine

Technology, business
and innovation.

And, not least, about
the Mac.

Weblog Archive Cutedge

by: Bernard Teo






Latest Joy of Tech!

Joy of Tech ... from Geek Culture



Creative Commons License

Copyright © 2003-2012
Bernard Teo
Some Rights Reserved.

The Ultimate Business Machine - Archives

List of Categories : Commentary * Singapore * Technology * Travel *

Mon 25 Sep 2006

The Journey

Category : Technology

"It took me a long time to learn where he came from. The little prince, who asked me so many questions, never seemed to hear the ones I asked him. It was from words dropped by chance that, little by little, everything was revealed to me."

- The Little Prince, Antoine de Saint-Exupéry (via the Katherine Woods translation)

It started with the question - do currencies always round to two significant digits, like US$9.99? The answer is no. There is at least one case, the Japanese Yen, e.g., ¥1,280 for a pack of Pampers, where they have no decimal places.

So how do we make Luca work universally across all currencies without hard-coding all these things?

The question started me on a journey of discovery where I learnt about NSDecimalNumbers, creating a custom NSNumberFormatter class in Cocoa together with its own Interface Builder palette, and also about storing blob values in SQL databases so I can stash these number formats that the user has created.

And I'm now almost done. I have an interface in Luca that now allows a user to create custom number formats for any individual currency, and he can apply these formats wherever he's entering currency values in any voucher.

If he chooses the Japanese yen as the base currency for the accounting system in Luca, then all calculations where rounding has to be applied (e.g., in exchange rate or tax calculations) are done to zero decimal places.

That's triggered in just one place in the code and there's no hard-coding.

So, to answer my own question : it can be done.

Along the way, I think, I can now really articulate why Cocoa and, especially, Objective-C are such good software development tools.

It's all about design.

You've got to take a Janus-like stance and look both inwards and outwards at the same time.

You've got to look inwards into the code and be aware that the world you're modelling is as complicated as only life can be. And so, you've got to simplify, simplify, and simplify yet again wherever you can in the coding, to get everything neat, clean, crisp and small. Because if you don't don't, then you're going to get drowned in all the possible permutations when things come together in combination, when you meet a real user in the real world.

It's from this perspective that we should value the simplicity of the Mac. And the wonderful pragmatism of the Objective-C language.

And see how PC people like Paul Thurrott totally miss the point.

And so I continue to simplify Luca. I'm pulling all Luca application settings into one single Preferences window, and I hope I can organise its presentation into a narrative to help the user understand what he has to do to set up an accounting system. If I can get this Prefs window done, then Luca will be reduced to just two menu items - an Accounts menu and a menu for Journal, and that would be about it.

Posted at 12:08AM SGT | permalink


Mac@Work
Put your Mac to Work

Sivasothi.com? Now how would you do something like that?

Weblogs. Download and start a weblog of your own.

A Mac Business Toolbox
A survey of the possibilities

A Business Scenario
How we could use Macs in businesses

VPN Enabler for Mavericks

MailServe for Mavericks

DNS Enabler for Mavericks

DNS Agent for Mavericks

WebMon for Mavericks

Luca for Mavericks

Liya for Mountain Lion & Mavericks

Postfix Enabler for Tiger and Panther

Sendmail Enabler for Jaguar

Services running on this server, a Mac Mini running Mac OS X 10.9.2 Mavericks:

  • Apache 2 Web Server
  • Postfix Mail Server
  • Dovecot IMAP Server
  • Fetchmail
  • SpamBayes Spam Filter
  • Procmail
  • BIND DNS Server
  • DNS Agent
  • WebDAV Server
  • VPN Server
  • PHP-based weblog
  • MySQL database
  • PostgreSQL database

all set up using MailServe, WebMon, DNS Enabler, DNS Agent, VPN Enabler, Liya and our SQL installers, all on Mavericks.