Archive

Archive for August, 2013

ISpotify

August 30, 2013 Leave a comment
Spot on

Spot on

Just started playing with the Spotify API (libSpotify)! Strange that there are no pascal wrappers yet, but i’ll roll my own 🙂

Head over to spotify developer and have a peek!

Embarcadero blacklisting again

August 29, 2013 Leave a comment
Bring it on!

What goes around…

Embarcadero is.. (trying to find the words for it here): like a really, really bad friend.
You know, then guy that is always your friend if you have money – but never your friend when it’s time to pay back? “You take this round” he says, but he always leaves before it’s his turn. The kind of friend that says “hi!” when you meet him on your own, but pretend he doesn’t know you when he is with someone he think is important.

I remember guys like that from high-school. I also remember beating the crap out of those at one point. What does a bully do? This:

I just learned that +Embarcadero Technologies didn’t want us to do a talk about
Smart Mobile Studio during the upcoming Dutch PasCon event.
Something about a “competing product”.
Seriously!  EMB doesn’t even have a client-side web-dev tool in their portfolio! 

Apparently they see me and the pascal consortium as a threat — You dont say?!  Wow!  No we have been plotting for your resurrection and taking crap for 5 years just for fun!

In the words of shakespear: “Oh ye retched coward!”

It really must suck to know, that you managed to turn one of your most loyal group of people, absolute borland nazi to the bone — those that supported you when you were down for the count with everyone against you — into your worst enemy, just by being a complete selfish ass-hat. I will crack every version of Delphi from now to kingdom come just to make sure you lose money. Out of pure spite. Pure anger.

QUARTEX IS 4EVER

Think your silly 16 wheel cipher is going to bolt quartex? What’s next, apple like certificates.. yeah thats really hard to crack (lol!). Took me at least an hour… Yet your product is the first download on the torrent, with my horn in your side, until you are nothing but a wikipedia entry.

Karma, ain’t it a bitch

If you honestly think that Smart Mobile Studio is a threat – consider my earlier blog posts when i outlined not just the idea, but also posted progress reports on a weekly basis – publicly for all to see (with people from embarcadero commenting, usually negative). I also put together a team to make it happen and spent 2 years of my life promoting, teaching and selling pascal as a language. I personally dont benefit from this. All I wanted to do was to save our jobs as Delphi developers and promote pascal, because it is a better language than C#, Java and Objective C. And I also have a loyalty to the company that made Delphi since it has put food on my table for the past decade.

I have sent 3 proposals to you regarding what you should to do make Delphi and object pascal more mainstream, all of them good ideas with minimal cost and maximum benefits. You rejected them all. So finally I decided to build it myself… and now you blacklist our work and treat us like enemies.

So be it. Friend no more.

With friends like you … who needs enemas

Database codegen

August 22, 2013 3 comments

What is the problem with the current Delphi database model? You might think I have gone off my trolley completely, but if you are an experienced Delphi programmer you will probably recognize what I’m talking about. Namely that when you  have a huge application with many forms – all populated by query components, you quickly end up with spaghetti code. It depends of course on how you write your queries – but somehow big projects always end up with a fair amount of spaghetti. Especially when you have apps coded over several years, involving some 20+ programmers all with their own ideas (like myself) on how to solve it.

So how do we make database programming on a massive scale “human”? Well, leaving commercial solutions aside, I like my database code wrapped up neatly in classes. When working with database records it is much easier to work with normal objects rather than hundreds of lines of code with fieldByName(“somefield”). So I decided to create a little firebird database table-wrapper generator.

dbwrapper

Consider the following task:

  • select all items from a table
  • loop through each item and sum up a total based on a value from each record

This task is now reduced to:

var
  mItems: TMytableItemList;
  mItem: TMyTableItem;
  mTotal: Int64;

if TMyTableController.getItems(mItems) then
Begin
  try
    for each mItem in mItems do
    inc(mTotal,mItem.value);
  finally
    mItems.free;
  end;
end;

Thats pretty easy to debug and work with. And as you can imagine, the more tables and joins you have – the more complex a normal Delphi TQueryComponent based form gets. But with clear-cut classes neatly wrapped for both read and write — it’s actually fun to write large-scale database applications.

Sanity check

At present my little wrapper spits out some very basic code. Blobs are read verbatim on requesting an object or a list (which is not very friendly) and also you get choices like “should a list be read on demand? or all at once”. Im still busy tinkering with the API (the TDatabaseObj class and firebird database helper methods), but it will soon hit production. The bonus? It’s dead simple to add support for other databases – and the user doesn’t have to care at all about the underlying engine. It doesn’t matter if you use sqlserver, firebird, mysql, or a native delphi database like elevatedb. Just stick to the objects and you are home free.

Other alternatives

If you have the luck to start a project from scratch, then I would probably go for Remobjects Data Abstract product. I have been a fan of Remobjects since day one, and although we have had our differences over the years – i still love their products. They deliver polished, no hazzle and straight to the point solutions. At present my offering is little more than a “proof of concept”, so don’t expect to fork my codebase and re-wamp your databases just yet. But when im done – database programming on source level will be easier and more secure. I have spent the better part of 10 years writing rock solid database solutions for oil companies that demand 24/7 win32 service excellence so – even though some of my solutions might seem strange, rest assured that there are reasons (read: real life experience) for the way the code is generated. A simple exception in a win32 service that handles some 200.000 customers an hour will cost you an arm and a leg.. you dont want to mess about with code formating or excessive use of exception handling at that level.

But word to the wise – you need a good database solution? Remobjects will give you a great solution out of the box. It depends on how close to the code you want to work.