Monday 29 September 2008

GNU gettext for Delphi 2009

I just spent a little time testing dxgettext with Delphi 2009, and it was easy to make it work with the new string types, even though this code is really exploiting a lot of the things you can do with character sets. This also means that there is new stuff on the homepage. It is nice to see that CodeGear is back in business, providing seriously useful enhancements while keeping backwards compatibility.

Friday 26 September 2008

Why I like Google Chrome as a software developer

Chrome has a number of caveats, which have been described elsewhere very well. However, it also has a lot of very good features. First, the obvious, which many other reviews tell about, too:

* It starts very, very fast, faster than MSIE and Firefox on my PC.
* When a web page loads the Java runtime for the first time, it doesn't slow down other tabs.
* When something crashes, only one tab crashes. I only tried this once, but was very thankful that I didn't lose much.
* Javascript websites are fast. Really fast. If you ever use Google Docs or similar, you will never go back to MSIE or Firefox (unless they improve, of course).
* It autoupdates, just like other Google apps. This is very convenient for your old grandmother who could be scared by upgrade notifications.
* Reopen a tab that was accidentally closed is easy.
* Start page includes most visited sites, with screenshots.

Now the less obvious:

* It can create a "program shortcut", which starts Chome in app mode. This is interesting for software developers, because it makes a web page behave more like an application. No navigation buttons, no dragging into other Chrome windows.
* Incognito mode is very useful to testing websites, because it allows logins and cookies, but doesn't use the same logins and cookies as the normal part of the browser.
* Incognito mode can be very useful for presentations, if you don't want the audience to know what websites you have recently been using.
* When searching inside a web page (Control-F), the scrollbar indicates, where on the web page the search results are.
* I have two screens, and if I have a chrome on each, I can drag a tab from one screen to the other. Extremely nice. This is how most programs should work.
* It is extremely easy to add a custom search. For instance, I want easy access to our Mantis Bug Tracker, and it is extremely easy to configure chrome, so that I can just type "mantis 123" in the URL, and it will show me the issue number 123 in my mantis system. Even the start page automatically gets a mantis search box. In similar ways, you can easily add search engines for your CRM system, your intranet wiki etc. Type "wiki phone" and you have your phone list, or "crm smith" and you have a list of the customers named Smith.
* It automatically creates custom search engines for you. If you have visited and made a search, you can just type " fopen" in the url, and it will activate a search on for the search term "fopen". I renamed that search engine to php, so that I just need to type "php fopen" to get the fopen page.

Important tips when using Chrome:

* Use Alt-Home to switch a page to the start page.
* Use Alt-Left and Alt-Right to go to previous and next page (just like inside Delphi)
* Use Control-T to open a new tab
* Use Control-F to search inside a web page
* Use Control-L to type a new URL
* In order to add a custom search, right click on the URL and edit search engines.

Thursday 25 September 2008

The next big thing: local apps

Imagine an application, that is faster, snappier, more productive, prettier and much cheaper to develop than web 2.0 apps. It integrates perfectly with other applications that you use, and it even works offline. Sound impressive? Well, it's here. It's called a GUI app. It has actually been around for many, many years, even before the world wide web was invented.

Why did I write this? Sometimes it seems that people don't know this.

Thursday 11 September 2008

Why you need Delphi 2009

Many developers don't consider Unicode necessary. After all, the ansistring type takes half the amount of memory and is often guilty of making Delphi apps much faster than .net and java apps, and you don't think that you need those additional characters anyway.

However, there are a few characters that may already have caused you problems. For instance, the euro symbol (€). It does not exist in the ISO-8859-1 character set! In Windows-1252, it is encoded as #$80, and in ISO 8859-15 it is encoded as #$A4. You may even use an utf-8 converter, that basically converts the ansi bits into utf-8 bits, without repositioning the euro symbol - and that's also wrong, because in utf-8, you need to use the Unicode code point #$20AC. If you're exchanging CSV or ansi files, but want to include the euro symbol, you may experience problems with other character sets. For instance, in cyrillic character sets, euro has position #$88. All this gets much easier with Delphi 2009.

Does it get really, really easy? That depends on your ambitions. Many believe that Unicode is about a 16-bit character encoding, but that's wrong. That would only cover 16 bits, and Unicode has more than that. It is possible to have special symbols with more than 16-bit, and in order to handle that, Windows (and .net and Java) uses UTF-16 encoding, where one symbol may use 2 or 4 bytes. Most programmers will ignore that fact, and your program will still work nicely with Unicode. CodeGear even implemented a widechar which is only 16-bit, and uses that in Delphi 2009 VCL. The Unicode standard ensures that all normal characters are encoded using 16 bit, and will usually do. In almost all normal systems, one character is 16 bit, and that's really, really easy.

One example of a group of characters that is not 16-bit could be musical symbols.