[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Coding style question
From: |
Markus Hitter |
Subject: |
Re: Coding style question |
Date: |
Mon, 14 Apr 2008 16:56:48 +0200 |
Am 14.04.2008 um 11:29 schrieb Fred Kiefer:
[...] the new 10.5 style of using NSInteger and NSUInteger instead
of int and unsigned int.
GNUstep already has these types defined in NSObjCRuntime.h and my
question now is, whether we should slowly switch over to use these
types in the API definitions?
Well, I'm still stunning why people prefer variable types of
undefined size[1] (int, NSInteger, etc.) over those with defined size
(int16, int32, int64, etc.). To my understanding of coding, one
should always care about the size of variables, ruling out types of
undefined size. Additionally, ideal code compiles and works on a 16
bit platform just as good as on a 128 bit platform, without
conditional code or similar clutches.
So, an enhancement over Cocoa would be to get rid of int as well as
of NS(U)Integer.
With that off my chest, I think moving to NSInteger is better than
sticking with int. Undoubtly, one day Apple will start to do things
with NSInteger you can't do with the traditional types.
Markus
[1] Sure, on a given platform, int has a defined size. But GNUstep is
meant to be platform independent, isn't it?
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/