Looks better than the previous version. I’ll probably start posting shorter posts from my iPhone just because it’s so easy. :)

I decided to forward my own domain, sergiutruta.com to my WordPress blog. It looks better as sergiutruta.com than sergiutruta.wordpress.com, so I’m sticking with this solution for now. Maybe at some point I’ll go back to having my own hosting for it, but for now it works fine and trouble free :) .

Disclaimer: I don’t know Perl, I’m just using it to run a local process in an application.

I had to upgrade my perl libraries after upgrading to Snow Leopard, which installs Perl 5.10. More specifically, the perl process didn’t connect to the MySQL database anymore.

Searching on the net, I found suggestions that if you have installed mysql in 32 bits, the DBD::mysql library won’t work. And it didn’t. Using this article I uninstalled mysql. And than using the instructions from this other article, I installed mysql in 64 bits.

On my iMac, the installation of mysql Perl library went smoothly, using these instructions (from our Perl guru):

1. To start the cpan shell:

sudo perl -MCPAN -e shell

2. In this shell, I ran:

install Bundle::CPAN
install DBI
install DBD::mysql

On the MacBook, just because I messed around with CPAN settings or something, the DBI failed to install.

To solve this problem, I had to erase the following folders:

1. “.cpan” folder from my user’s root folder

2. the following two folders used by Perl 5.10: “/Library/Perl/5.10.0/” and “/Library/Perl/Updates/5.10.0″ (most probably the second one is not a must).

After erasing these, I started again the CPAN shell and run the three commands from above. Voila! All working well.

UPDATE: After installing the 64 bit version of the mysql Perl library, and upgrading the MySQL local installation to 64 bit also, I had trouble running the mysql ruby gem which was compiled in 32 bits. After trying different options, I’ve come to the conclusion that installing Snow Leopard from scratch is the best option, so I did a clean install of everything and now all runs smootly!

My first iPhone app has been accepted in the App Store, you can find it here. If you don’t know what the Planetary Hours are, Google finds a lot of good references. Here’s the Wikipedia page.

I’ve just submitted my first iPhone app to the App Store. You can find the post describing this app by clicking here or on the “Planetary Hours” link from the Sidebar. Yupiiiiii! :) ))

It’s more than an year since I’ve written my last article here. I’ve been very focused on Ruby on Rails for more than 2 years now and for 6 months or so I’ve been playing with the iPhone SDK. We live wonderful times, indeed :) . I have an application ready to go to the AppStore and I’ve been thinking about having some support pages for my iPhone apps.
I’ve chosen to use this blog, so I’m back. Not so much with philosophical articles, but with support for my apps.

Since April 2008, I’ve started working from home. And by “home”, I don’t mean only home, but anywhere I am. As I love traveling, I take my MacBook with me and work from wherever I might be. I like this flexibility, though I work more than I used to when I was an employee.
Someone just made me an interesting proposition to join a US based start-up, but I’d have to go in the office every day and work side by side with a specific team. I like working with smart people, and I like working at exciting projects. Though I won’t go back to working in an office any time soon.
So it got me thinking: is it better to work in an office, or is it better to work from home? Both these approaches have advantages.
Working in an office
Probably people like to work in an office for different reasons: if you have kids, it’s definitely not easy to work from home if your kids keep distracting you from your work. Also, working in an office helps you stay focused when you’re there, and you can forget about all those things when you get out of the office.
Working from home
The advantage is that you can work whenever you feel like it. If you have an idea, you can start working right away. If you’re out of ideas, you can just stop working, and do something else. If you’re sleepy after lunch, you can take a nap. If you’re very productive in the morning, or late in the night, you can work during that time. No one tells you when to work and how much to work.

These two situations, match exactly two profiles: employee and entrepreneur. An employee likes to think about the job when he’s in the office, while an entrepreneur thinks about what he has to do all the time. As an employee, you probably prefer to have a job life, in the office, and a personal life, at home. As an entrepreneur, there’s no distinction between these two. You’re working all the time, you’re thinking all the time how to improve things, you’re always thinking how to grow your business, how to find more customers..
None of these situations is better than the other. It simply breaks down to what you want to be and which one suites you best.

Are there people that cannot learn? No. Are there people that do not learn? Yes. Why is that? I’ve asked myself this question many times. The only answer I’ve come up with is this: people do not learn because they do not realize they have to learn.

It’s not enough wanting to evolve. We have to realize what we do wrong and what we need to change. The biggest step is realizing what we lack. The problem is always in ourselves.

Let’s talk about people who do learn. During life, they keep evolving and transforming themselves. How can they evolve? By learning. They learn, they gather information, they gather feedback, they gather reactions to what they do, and they sum all these up. Then they gather their desires and their aspirations and they sum all these up. Using the sum of these sums, they have enough information to transform themselves and become better and brighter.

Let’s also talk about people that do not learn. They want to learn. Most of them do. But they do not use the information as they should. And so they never know what to learn. They keep trying to understand where the problem is, but they will not find it until they understand how to use the information surrounding them. And they have all the needed data, more than enough, feedback, reactions, desires, aspirations, but they don’t understand how to use it.   And so they don’t evolve and they stay the same.

What type of these two are you? What type do you want to be?

To test or not to test
I read a great article on testing written by James Golick. There’s always a debate about doing unit testing or not. Most of the we-don’t-write-tests-because-we-don’t-have-time-to-do-it evangelists say that they have to implement features and release the product and that’s the reason they don’t write tests. I’ve felt this too, but that was before starting to write tests. It’s just like your old Honda, why buy a new one what the old one works so well.

I started writing tests when I begun working with Ruby and Rails. Before this, I worked in C, C++, Java, where you have to look for a testing framework, then learn how to use it, and then using it. Probably that’s why I’ve never done it. But when I started to learn Rails, and Ruby, and I saw the unit testing embedded into the language itself, it became so obvious and easy to try it. It’s hard to change the old habits. Even now when working on a new project I want to keep implementing features and never look back. But with mind discipline, I keep reminding myself that I need to write tests. Test-driven or not, during development it’s great to have tests. It’s assuring and comforting. And you’ll even sleep better at night. :)

We don’t need tests
Even though it’s been proved that writing tests is good, a lot of developers never write tests. And they always say that they don’t have time to do it, that they have to implement features, that they have to release on time, that they feel much comfortable with manual testing. Correct me if I’m wrong, but all the developers that started to write tests changed their mind about testing. And they keep writing tests for everything they do. To all the other developers: I don’t want to argue with you. I just have a suggestion: for your next project, do write tests and do it for a while. Never say Subaru or Honda is not a great car unless you’ve driven one. It’s the same thing. Never say testing is not good unless you’ve tried it. And not for a day or two. Do it for a couple of months. If you still feel it doesn’t help you than it’s fine. But unless you’ve tried it, don’t say it it’s not good.

Writing efficient tests
It takes some time to write efficient tests. The more you write tests, the better your tests are. Don’t expect to write efficient tests from the beginning. Just keep doing it, and you’ll see that your tests get better in time.

Testing is great for startups
When you have a small team, you can’t afford to spend time on testing…or better, on manual testing. Manual testing takes more and more time as you add features. So you have two options:

  • having a testing team, which means more money, and it’s a bad idea for startups;
  • developers test manually, which takes more time as you add features.

Having tests which run automatically saves you a lot of time, because you write a test, then a feature (or viceversa), and then another test, and another feature, one step at a time. At the end of the day you’ll have less features, but all of them are tested, and protected from now on by regressions. And this saves a lot of time you’d spend later on debugging and bug-fixing.

Another good thing when you have tests is that you can refactor your code more often and with more confidence. That’s because you have a suite of regression tests to back you up. And every time you refactor something, you can run the tests to see if you broke something. And the chances there’s a hidden bug which will appear on you live app decrease.

I’ve read an interesting article at ReadWriteWeb about free content and giving away for free. I’ll start by saying I’m for the free content, and not against it.

It seems that more and more people are against free, and against giving away for free. This whole “for free” trend was probably started by Google. They had the search engine, they had the user-base, then they figured out they could display adds into the search results. And they were paid to do it. So they started displaying ads into mail listings also. Even though some argue that this is not good, I’d say it’s the key to the web evolution, and the key to our evolution: programmers, engineers, doctors, scientists, writers, and so on, can find a lot of useful information quickly and free. This was not possible 10 years ago, and it wouldn’t be useful today if the service was not free. Few people would use such a service if they had to pay for it. So you can’t argue that (at least) this free service helps our society evolve.

Why are we so afraid of receiving for free? Ok, we actually don’t get anything for free, we see the ads (more like ignore them, but that’s a different story) and for that we can use search, mail, access information all over the web. But guess what? We don’t care. I don’t mind that I see ads on the search results as long as I find what I want. And I don’t mind seeing adds next to my emails, as long as I have a 6GB storage in my Inbox.

Instead of being afraid of free, why don’t we adapt to free? Why don’t we work on changing the way we do business in order to stay competitive? Yeah, it’s easier to blame others when we feel losing ground, but instead we should adapt our business. This is one of the oldest rules of doing business, not just in the web, but everywhere.

I’m for free and because of these free services the advertising became what it is today. Because others give away for free we have to thing of better and more useful services just to stay competitive. And I wouldn’t mind getting free books either. :)