Software Engineering discussion

Beautiful Code > Treating Code As an Essay

Comments Showing 1-2 of 2 (2 new)    post a comment »
dateDown arrow    newest »

message 1: by Brad (new)

Brad (bradrubin) | 264 comments Mod
I agree with the points in this nice essay, which defines some attributes of beautiful code (along with a Ruby plug). I smiled during the discussion on compact, non-redundant variable declarations because here is an example of the lines typically needed in an instance variable declaration in Objective-C:

.h file
UILabel *text;
@property (nonatomic, retain) IBOutlet UILabel *text;

.m file
@synthesize text;
self.text = nil;
[text release:];

Yep, 5 lines of code for one variable!

message 2: by Erik (new)

Erik | 165 comments Nice chapter. Seems a little late in the book. Could have been nice earlier too.

I agree with you UILabel text example. Windows MFC GUI always bothered me, because there's so much setup/overhead. I'm not sure if that's the nature of GUI or not. ASP.Net C# GUI seems like it has alot less unnecessary lines to write to achieve the same results as MFC GUI. I would guess other modern languages have solved this problem similarily.

back to top