Archive for the 'New ideas' Category

Blocks in Objective-C

Tuesday, September 2nd, 2008

There have been quite a lot of news about blocks in C recently. What I wonder however is: will there be a Objective-C block object that wraps such a new C block?

Thing is: You can’t send messages to C-Blocks, they’re just as primitiv as an int, or a float, even if they’re more complex. In Obj-C you also have string literals like @”a string”, which you can send messages to. Why not also have literal blocks like @[:arg | arg doSomething]? I think that would really make live a bit easier sometimes.

@[:arg | arg doSomething] might look a bit too smalltalkish for some people, but on the other hand the selectors in Obj-C also look just as cool as in Smalltalk.

Anyway, looking forward to seeing blocks in Cocoa.

Karsten

Spam hell

Tuesday, July 10th, 2007

I think everyone knows Spam to be a big pain because one receives tons of unwanted mails every day. For developers the problems of spam are even worse. It’s a common problem that mails sent to customers don’t get through. Sometimes because there’re some server problems with some host, but most of the time the mails simply get filtered by some anti-spam service.

I was thinking to add a new page to briksoftware.com that asks the visitor for an email address and then it shows all pending messages for this email address. This should be a really easy way for customers to see if their feedback has been answered yet.

For this idea to be successful i think this new part of a web-page has to be used by _MANY_ developers’ websites. If users know/expect this feature on a website they’re more likely first have a look there instead of just being upset that no-one replies to their mails. The developer on the other hand doesn’t have such a big problem to get his messages through to the customer.

While writing this idea down i thought that this could actually be implemented by some kind of a client-server thing. Developers register with an email-address. They add the content of the servers page to their own website, maybe in an iframe or however. When they’re replying to some email-address they may just put the email-address of the anti-spam service in the cc field and the mail is automatically added to the page.

What do others think about it? What should be a good name/button or whatever for this service so that users may recognize it immediately? Is it hard to make this service secure against abuse?

I’m not much of a web-developer, but i think the basics should be quite easy to implement. It should be a free service for everyone and the provider has to ensure that he doesn’t abuse any of those email-addresses that are collected through the time.

Karsten

Schizophrenic plugins

Saturday, June 9th, 2007

Lately I was driving home and I was thinking a bit about BSInspectors. The inspectors use plugins, but the plugins always come in pairs, which is first: annoying to create, and second: annoying to maintain. I’d really prefer to go for a one plugin per plugin architecture ;-).

I ended up with a concept that I’ll call Schizophrenic plugins in the post. Basically they are plugins that contain two or more principal classes. The benefits are obvious: you only need to create one bundle/plugin and you only need to install and load one bundle.

Why would you need it in first place? BSInspectors is a plugin for Xcode that has plugins itself, and these plugins are divided into two parts, the Xcode part and the application part. The application part is loaded into the application to provide the data for objects in a proper way. The Xcode part can then use this data to display the objects in a much more convenient way.

So how can such a plugin be implemented? The implementation is as simple as the idea. You just ask the plugin’s principal class for the class you want. The principal class for BSInspector plugins for example could look like this:

@interface MyBSInspectorPlugin {
}

+ (Class)inspectorClass;
+ (Class)debugObjectClass;

Simple interface, isn’t it? Your plugin loader then just has to do something like:

	...
	Class aClass = [[bundle principalClass] inspectorClass];
	id myInstance = [[aClass alloc] init];
	... //whatever

instead of:

	...
	Class aClass = [bundle principalClass];
	id myInstance = [[aClass alloc] init];
	... //whatever

I think I’ll implement it into BSInspectors some day, but till then I’ll first do a hell of a lot more work for CuteClips3 😉

Karsten

Dakar Testing

Thursday, May 10th, 2007

Hi,

lately I convinced Michele to start learning Smalltalk. I’ve been a Smalltalk developer for several years and really like this language. But it’s not only the language, it’s also the IDE. Smalltalk IDEs have always been to first IDEs when it comes to creating new features that help developers do their work. That is testing with SUnit, which was developed in the early 90s or refactorings, which were added to Smalltalk IDEs in the mid 90s.

After some time other languages like Java and C# got Unit testing frameworks as well, and their IDEs (Eclipse and VisualStudio) can do refactorings too, but the first implementation was in Smalltalk. There’s a simple reason for this: Smalltalk is a very simple language with really cool features, like Blocks (Ruby developers should also know them 😉 ) and the whole IDE is also written in Smalltalk. So this makes Smalltalk a great language for trying out new stuff. For example the people over at the SCG at the university of Bern (link) added Traits to Smalltalk.

Last summer I wrote a tool called Dakar Testing together with Damien Cassou for the Smalltalk IDE VisualWorks. The idea of Dakar Testing is to simplify the creation and the management of SUnit tests. To do this, Dakar Testing adds another editor next to the existing source-code editor. This editor is used to create and edit the tests that are assigned to the selected method. In between those two editors is a list showing all tests that are assigned to the selected method, so it’s also easy to see which tests stress which code and which tests need to be run.

I wrote a small article about Dakar Testing a few month ago and I also created an image that you can use to try out Dakar Testing. The article can be found here and the image for VisualWorks NC 7.5 can be downloaded here. The image also contains a Readme that you really should read if you’re not familiar with Smalltalk.

Karsten

Adding Inspectors to Xcode

Wednesday, March 7th, 2007

So last time I blogged about getting data from the target app into gdb. While I considered this to be the hard part of this project I figured that getting the data from gdb to Xcode is way harder. While I think nothing is impossible, I tried to get things running and finally succeeded.

(more…)

improving debugging in OS X

Thursday, February 15th, 2007

So the first thing i noticed when debugging Applications with Xcode is that there’s no GUI for inspecting objects. i mean, an array has some certain objects and printing all to the console is not very user-friendly, so let’s improve things a bit.

This problem really got me thinking why there’s no better way of displaying the data and i broke things down to the problem, that objects are located inside the target application. Gdb doesn’t have these objects for itself and neither does Xcode. I tried around a bit and came up with what i consider a good start to begin improving the debugging process in OS X.

(more…)