Little things Delphi gets right

Having spent my entire working time in the last decade coding in C, C++, Objective C and Delphi (in the broadest sense - Objective Pascal), I can only say that this essay is spot on. It is vastly easier for any coder, at any skill level, to write readable and secure code in Pascal than in any dialect of C.

He makes several good point on syntax, too. How many C programmers have been bitten at one time or another by making an assignment in an if statement without the compiler saying a word? It's also true about hassle free linking - I have code where the main program is in Pascal and several routines were written in C. It was simple to accomplish this. On the other hand, trying to get a C program to link in a Pascal lib or object file can be like pulling teeth.

So for those of you who still labor under the delusion that Pascal is a dead language, washed away by the superior tides of C, read this and weep. Then fire up Delphi or Lazarus and write some clean, secure code for a change...

For those who haven’t seen it yet, due to popular demand, the StackOverflow people created a new site called programmers.stackexchange.com, a site for the more subjective questions that StackOverflow isn’t really designed for. Someone recently set up a poll: What’s your favorite programming language. You can probably guess what my answer was.

(link) [Turbu Tech]

20:16 /Technology | 0 comments | permanent link



A Glad Midsummer!

Well, today is Midsummer, and the Wheel of the Year has cycled once again. There's been so much going on that I hardly know where to start. So let's start with the best: I've got a new job! I'm still writing code, but I'm no longer in consumer electronics. It's all system level stuff in Linux, and so far it's all in C++. Python is promised on the horizon, and some of the older control software is written in Delphi. My new co-workers were very interested to hear about Lazarus...

This meant a healthy raise, and my timing was perfect. My old employer had decided to return the money they'd withheld over the course of the past year just before I handed in my notice, so I got what amounted to a nice bonus check on my last day. But the real bonus is my new employer: it's the best place I've ever worked, and I've worked a lot of places. I was able to hold my oath, the systems are well designed and documented, and even some of the manufacturing is still done on site. Most of my new colleagues are around my age, with about the same level of experience. "Geezer geeks" is my own term for the likes of us - techno-curmudgeons. It makes for interesting conversations, that's for sure!

On the farm front, shearing was complete by the end of May with very little trouble. Even Mild Thing lived up to her name!

Given that we had a little spending money, we engaged in what our daughters refer to as "retail therapy", and Lorraine is in her chair next to me reading on her new Nook Color. She loves it - and I must say that it lives up to it's good reviews. I helped her load up on classics from Project Gutenberg, and I think she's started on War and Peace...

We picked the Nook over it's competition for it's web capabilities - and we have not been disappointed. It's my first real exposure to an Android device, and I must say I've been impressed. The only dumb design issue is the use of a specialized USB cable, which I assume was for easier (and faster?) recharging. But that's a small thing for such a nice tablet. Yeah, I called it a tablet, because it's certainly a lot more than just an ebook reader.

I've got a big backlog of items in my "to be posted" folder - with any luck at all I'll start working my way through them (as well as new stuff that pops up) and my lengthy stays away from blogging with be a thing of the past. But blogging is a habit, and I'm going to have to work somewhat to reacquire it, so no promises!

19:49 /Home | 0 comments | permanent link



Lazarus

I've been a user of Delphi for quite a few years now, mostly in it's C++ Builder incarnation. Because of this (my "C-weenieness") I've not done a tremendous amount of coding in Object Pascal, But I have done some, mostly at a very low level in components and libraries as the base (the Visual Component Library or VCL) of C++ Builder is all written in Delphi Pascal.

I noted with some interest last year that Codegear was working on a cross platform product, bringing Delphi to the Mac (and back to Linux). This was pretty exciting to me, because there's an increasing pressure at work to develop Mac solutions (and I'm sure they'll catch on to Ubuntu eventually). This would be an ideal solution, as it would leverage our existing codebase to new platforms.

The problem is that Codegear is taking their sweet time. And we needed a solution now - products have to ship! And I found a solution - Lazarus.

This isn't a "write once, run anywhere" environment (like Java promised to be), nor is it a cross compiler (exactly). It's a "write once, compile anywhere" RAD IDE for Object Pascal, with a component library that mimics the VCL but ties to an underlying widget set that's platform specific. Carbon (and some Cocoa) widgets are supported on the Mac, QT and GtK on Linux platforms and Win32 (or WinCE) on Windows. Processor support includes PowerPC, Intel and ARM. And it works.

I can write a program on a Windows box that compiles on my Mac - and on Windows it looks like a Windows app, and on the Mac it looks like a Mac app. There are a few platform specific ifdef's in the code, to be sure, but remarkably few. Most of the OS dependent stuff is handled transparently under the hood, including the crazy stuff like path separators for file access. It's really quite amazing.

I'm finding myself becoming quite enamored of the language itself, too. Sometimes my fingers move faster than my brain (especially on things like the equality operator - in Pascal, it's := as opposed to just =, which is the comparison operator) but overall the syntax is strikingly similar to what I've been doing with C++ Builder. This is mostly due to the nature of the underlying framework.

The developers of Lazarus have done one heck of a job with the LCL (Lazarus Component Library) and the FCL (Freepascal Component Library). These do much more than merely mimic the VCL - they extend it in very logical and useful ways. Unicode support, graphics support, even compression support are all built in. It's actually fun to write code in this thing.

And they did a smart thing with licensing, too. While the IDE and compiler are GPL, the frameworks and libraries are all LGPL. Which means no restrictions on us in commercial programs.

In short, I'm throughly impressed. If you need a cross platform dev tool, don't let the "Old School" rap of Pascal put you off. Check out Lazarus - you'll be amazed at what's possible today.

11:48 /Technology | 1 comment | permanent link



Ex-Borland's Delphi owner re-ignites cross-platform dream

It's about time somebody did this as native code. And as a long time Delphi/C++ Builder fan, I'm glad it's Embarcadero.

Embarcadero is now betting on cross-platform for Delphi and its partner C++ Builder, which shares many of the same libraries. "The most important thing is native cross-platform, Mac and Linux. Some of our biggest customers have moved completely to Mac. Internationally we don't hear as much Mac interest, but Linux is really strong," Williams said.

(link) [The Register]

07:01 /Technology | 0 comments | permanent link



Delphi at Delphi
Dave At Delphi with Delphi

OK, so you can't see it too well, but I'm holding a copy of RAD Studio 2007 edition. This is of course a version of Delphi - and I'm standing in front of the city limits sign at Delphi, Indiana. Click the image to load a bigger picture - by the way the photo was taken using an RCA EZ209 Digital Camcorder, which uses software written in Delphi as a management tool on the PC. I oughta know - I wrote it!

This little road trip (Delphi is about 40 miles from where I live) was prompted by this post on David I.'s Codegear blog.

01:27 /Technology | 0 comments | permanent link



Happy Birthday, Delphi!

Borland Delphi 1Fourteen years since 1995, and the introduction of what's still, in my not so humble opinion, the finest RAD toolset on the market. I'm still using Delphi, and even more it's C++ Builder cousin, although I daresay it's come a long way since it's 16 bit, Windows 3.1 origins.

Sure I bitch about it at times, and moan about various new "features" added that I feel detract from the product. But I still use it daily to write more code faster, with better code quality, than I could do with any other tool out there. And that counts for alot in todays environment.

00:17 /Technology | 0 comments | permanent link



What a week ...

It's been a long time time since I've been through the travails of a "release week", and I've never been through one like this one. I've shipped a lot of code in my time, but this week, well, this was special. The code was supposed to ship a week ago - we finally "burned gold" last night at 5:30.

As if the pressure of shipping code wasn't enough, I discovered last Monday that my little red S10 has a burned out a clutch. And, oh, by the way, the water pump picked the same time to go kaput. That'll set me back about a grand, an expense that I'm certainly not prepared for - and won't be prepared for for a couple of weeks. So I borrowed my mom's car and have been driving that back and forth to work. A major pain - still haven't figured out how to deliver 70 dozen eggs from the back of a 1989 Dodge K-car.

At the Tuesday status meting another bombshell fell. The lead developer at my work is leaving, effective a week from today. Which puts me in the rather uniques position of being the senior PC software engineer for the division - having been there a little over 3 months. Supervising a codebase in excess of a million lines. Whew! Most of in written using MFC and Visual Studio, two technologies that I cordially despise. Joy.

On the plus side, that means we'll be transiting to some rational, maintainable technology, like Delphi, C++ Builder or C# (if corporate insists on staying with M$).

Wednesday we ran into the show stopper bug from Hel (of course) - it was a dependency issue with machines that had installed IE7, and I literally worked 20 straight hours to resolve it. But resolve it I did.

When I got home last night at about 6:30, I discovered the goats were out, and about a mile away south. A huge hole in the back fence - the little bastards will have to spend today in the barn, until I can get out to fix it tonight. Assuming it stops raining.

And tomorrow, my eldest daughter is moving in with me, planning on staying until July, when she finally get some professional license issues resolved and can move to Chicago. She'll have the spare room, and I'm really looking forward to it, but it'll be stressful, no doubt.

There's a lot of things I'd like to blog about - I've been saving clips all week - and maybe I'll get to some in a few minutes. Or over the weekend. Or maybe I'll just sleep in until next Friday.

18:21 /Home | 2 comments | permanent link



CodeGear polishes Delphi jewels

An IDE for PHP ... what an interesting idea. I wonder how long it'll take to catch on?

CodeGear, Borland Software's tools subsidiary, has added support for Windows Vista and PHP to Borland's Delphi integrated development environment for Windows.

(link) [The Register]

22:30 /Technology | 0 comments | permanent link



I Spoke Too Soon

I went off on quite a rant the other day, moaning about M$ Visual Studio and it's nearly unusable user interface. I compared it to the tools I was most used to, which were from Borland, namely Delphi and C++ Builder, and found MSVC sorely lacking.

Which is where the title of this post comes in: I should have made it clear that my references were to C++Builder and Delphi before the atrocity known as "Borland Developer Studio" was foisted on the unsuspecting programmer. You see, I downloaded a trial copy at work (it's 537MB download, not for an ISDN line at home). And what an eye opener it was.

Oh, they still have the VCL, a completely superior framework for Win32. And they've added .Net capability and even a C# environment. But they've tossed their old IDE to the trash heap of history, and rather than coming up with something new and better, they've slavishly imitated Visual Studio, right down to the idiotic project setting style, the bifurcation of each program into 'Debug' and 'Release' branches, and the utter and complete lack of usable help.

Un-fucking believable. Forms are now shown on tabs in the editor rather than free floating - and they've undocked the tool pallet and made it contextual, doubling as a template and wizard container. The screen's so busy and cluttered it took me thirty minutes just to figure out how to open a new project!

Imitation is said to be the sincerest form of flattery, but why they chose to flatter the dunghill known as Visual Studio is completely beyond me.

I was prompted to download the Borland tool out of frustration - I have gotten nowhere at work trying to do a simple SOAP client in Visual C++ without using the .Net framework (which is deemed too big a download for our customers). Knowing C++ Builder 6 as well as I do, I figured I could whip one out in an hour or two. Which I did. Tonight. At home. Using C++ Builder 6. Because the ultra expensive and expansive Borland Developer Studio was completely unusable - I couldn't even get F1 context help to pop a readable class definition!

So it's Visual C++ and M$ tools for me: if I gotta use an environment that sucks that badly, I might as well use the one that's most popular with employers, and productivity be damned. Which should make some of the folks at Borland think: I've been using (and spec'ing and buying) Borland compilers since the 1980's. And unless I can figure out a way to make the IDE function in a "classic" mode, and get help actually working, it looks like Delphi 4 and C++ Builder 6 will be my last purchase from that venerable institution.

00:37 /Technology | 1 comment | permanent link



Visual C++ .Net Not

Well, I can't stay silent much longer - I've been using the product referenced in the title for over a week now, and have yet to find a single redeeming quality in it. Please note that this critique is directed at Visual C++, and not the other components of the Visual Studio developer suite - I've actually been quite pleasantly surprised by C#, and .Net is not at all out of line as frameworks go, except for one little niggling detail that I'll get to in a moment. But I digress: I'm here to slag the Evil Empire's sorry ass excuse for a C and C++ compiler, and shall not be deterred from my appointed rounds by glimmers of hope on the horizon.

I'm been writing and compiling C programs for better than 20 years now, so I'm not exactly a newbie. And the compiler I loved best in the days before Windows was a Microsoft product: QuickC. It was lightening fast on compiles and links, had the ability to inline assembly and the optimizer was nothing short of a marvel for it's time. It had an IDE of sorts, and an arrary of companion languages (QuickBASIC and QuickPascal, as well as a QuickAssembler, believe it or not). I found the editors much friendlier than Borland's offerings in Turbo Pascal and Turbo C, and the compiler/link cycle much cleaner. But then came Windows and Visual C 1.0, and it all went to Hel in a handbasket.

In an effort to retain some of the DOS command line geekiness that permeated the early days of software, Visual C++ decided to retain it's switch settings as "command line options". That you entered in an edit box, on a buried configuration screen, as though you were still typing them in a makefile. You still had to set environment variables, and you had to set them globally, because after Win32 came of age every compiler instance had it's own environment.

Despite the obvious advances in user interface that the GUI represented, and that Microsoft insisted you use in your programs, by the way, their development tools remained stuck between the worlds: command line settings in a GUI, sans radio buttons, sans checkboxes and sans sense, unless you can remember what /Od /Mt /Dd really mean...

And they've retained the basic style to this day, with one important and exceptionally annoying addition: the wizard. It's hard to create a Visual C++ project without running into a wizard of some sort, that fills in all the blanks you don't need filled.

I don't think they've changed the debugger since 1.0. I've yet to be able to find a real dump screen, or even a easy way to watch variables or inspect classes while a project runs.

Which brings me to another thing that's still the same: the debug and release builds. In two separate directories, under your main project source folder. Why? Maybe it helps some folks organization, but to me it's just clutter - a PE format executable has version info embedded, including a flag for a debug build. This was, of course, designed by M$. Why don't they just use that? I do.

I think there's a way to actually place controls on a form now - but damned if I could tell you how! A huge part of this products problem is it's documentation: there's no lack of it, to be sure, but it's so disorganized as to be useless. My fellow PC programmer at the new job suggested just abandoning the help system in favor of Google - and she said it with a straight face! The embedded help viewer is, of course, Internet Explorer, which adds a toolbar of it's own to your main window, cluttering things up even more. And whereas you can right click on a source or header file's tab to close it, you can't do it with a help file's tab! Truly they've taken Emerson's dictum about a foolish consistency being the hobgoblin of little minds to heart.

Maybe I'm just so used to Borland's tools, but it seems to me that the layout of the editor and the IDE in Delphi and C++ Builder is much more rational than in Visual C++. The help system as a whole still sucks, 'tis true, but at least I can get easy access to class definitions. And I get a much finer degree of debugging control, to the point of being able to step through while watching and inspecting. Which I'm sure is possible in VC++, but nobody seems to be able to tell me how to do it!

I could go on, but there's not much point. I've gotta deal with this beast for the duration, and learn it I will. I just wish M$ would stop making it so difficult.

But before I go, a final word about C# and .Net in general. It's a nicely thought out language and a well designed framework - and a 22MB download that's not distributed by default with any given M$ operating system. And since most of our customers are still on dial up, and we don't distribute our software on a CD, it's completely useless. Tantalizingly so, I'm afraid.

I feel much better now.

21:18 /Technology | 0 comments | permanent link



Borland tools buyer MIA

Well, we'll have Delphi and C++ Builder for a while longer, I guess. But how much longer is anyone's guess.

Borland Software will retain control of its tools operation after failing to find a buyer during an eight-month search.

(link) [The Register]

07:48 /Technology | 0 comments | permanent link



Why Johnny Can't Code

Now this is an interesting article. Indeed, I encountered the tail end of this in my last years as a developer, when I was managing the R&D department. You have no idea how many people out there that call themselves developers have only ever used one modern, RAD language system (usually Visual C++ or Visual BASIC) and simply can't grasp the whole concept of writing all the code themselves. And they usually didn't even get the fact that they were loading libraries to do the nifty tricks - most of them thought that BitBlt was a feature of C++!

Now, I love my Builder and Delphi environments, and can really be pretty incredibly productive in them. But even they hide such things as the main program entry point, and they stack so many libraries so deep that unless you're familiar with what's going on under the hood you have no idea how the programs you write actually work.

Which is OK for an old geezer like me - I do understand what's going on under the hood. But as this article so succinctly points out, a lot of todays kids (and tomorrows developers) don't even know that there is a hood!

And that's going to be a problem.

Salon has an article named 'Why Johnny Can't Code', an interesting examination of the dearth of line programming languages available today. At first I wanted to read this and say aha, here's a simple line oriented language that's available through open source, but after reading the article I couldn't find any. And being an old fart, I remember the days spent with edlin and basic."

(link) [Slashdot]

08:42 /Technology | 0 comments | permanent link



Delphi demands end to labour deal

They're right, you know. It's all the unions fault: there's no way Delphi can compete with Chinese prison labor while paying a living wage to it's workers.

Yeah, it's the unions fault, all right. In a pig's eye.

Troubled car parts firm Delphi urges a US court to end its labour deal with unions, warning that without change it may collapse.

(link) [BBC News | News Front Page | World Edition]

20:47 /Politics | 1 comment | permanent link



Borland Delphi 2006

I was one of those C++Builder developers, and I always had Delphi on the system, too, if for no other reason than modifying components for BCB that were written in Object Pascal. And, as I'm currently looking for a bit more coding work to supplement my income, this is a welcome upgrade. They've finally combined the products, and I'll only have to pay one upgrade price. It's on the wish list...

Developers out there who're still plunkering along with M$ tools like Visual Studio (which isn't really very visual) or Visual Basic (which is neither) should really take a look at Borland's offerings - I think you'd be pleasantly surprised.

2006, and Borland has confounded its critics. Delphi 2006 is not only a bug-fixed version of the previous release, but adds in C++Builder, a Win32 development tool that marries the C++ language to Delphi’s Visual Component Library. I won’t dive into the sad story of C++Builder X, but enough to say that C++Builder is back; to the delight of C++Builder developers, who finally have an update they can use.

(link) [The Register]

00:00 /Technology | 0 comments | permanent link



Does Visual Studio Rot the Brain?

In a word: yes. Which is why I prefer Borland tools. C++ Builder and Delphi give you the option of going for true RAD, but both have facilities that make it easy to get down and dirty with the code, including inlining assembly.

The last decent UI for dev tools that M$ released was the [in]famous "Quick" series: QuickBASIC, QuickC and QuickPascal. The compilers in that series weren't bad, either, although Borland's tools of the time (Turbo C and Turbo Pascal) still managed to build tighter executables. I truly despised the Borland editing environment with those compilers, though, and would often code and test using the M$ tools, and then manually make the production version with the Borland compilers.

As a UNIX guy dragged kicking and screaming into the Windows world, I've never really been able to enjoy Windows programming. Charles Petzold, who is a long-time developer for DOS & Windows really laid out the reasons for me at the NYC .NET Dev group. Visual Studio and Microsoft tools force you to adopt programming techniques designed around implementation speed, not understanding or quality.

(link) [Slashdot]

00:00 /Technology | 2 comments | permanent link