[fpc-devel] type discussion

Jamie McCracken jamie-junk at blueyonder.co.uk
Thu Jun 2 17:05:28 CEST 2005


Micha Nelissen wrote:
> On Thu, 02 Jun 2005 15:31:51 +0100
> Jamie McCracken <jamie-junk at blueyonder.co.uk> wrote:
> 
> 
>>Micha Nelissen wrote:
>>
>>
>>>I don't understand, why are these forward declarations so evil ? 
>>>
>>
>>More code bloat, more typing and they get in the way. They dont give me 
>>anything useful in return.
> 
> 
> Please show me a piece of code where they are "in the way". Code bloat? They don't cost anything in the executable.

thats not what I meant! I mean its source code bloat to me especially 
when trying to follow code with large classes in it.

> 
> 
>>>>python is great I just envy *some* of its shorter syntax and it would
>>>
>>>Ok, some, but not this one ?
>>
>>Well typing begin..end all over the place isn't a lot of fun :(
> 
> 
> Have you done maintenance yet of other people's code ?
>  
> 
>>Especially as Im gonna have to indent them as well just to make em 
>>readable. So yeah it seems they are more pointless syntax bloat.
> 
> 
> They are not pointless to me: they indicate clear structure, but we may simply differ in opinion here.

But its the indenting that gives the structure. If i used begin end 
blocks without indenting there would be no clear structure - it would be 
a mess!

> 
> 
>>>Sorry, the only language that does what ?
>>
>>var strlist : TStringlist;
>>strlist := Tstringlist.create;
>>
>>I know strlist is a Tstringlist, the compiler knows it too as I have 
>>declared it so why do I have to spell it out in the creation process?
> 
> 
> In C++:
> 
> TStringList strlist;
> 
> strlist = new TStringList;
> 
> How is that shorter ?

okay but its still redundant. Why does the compiler need to have it 
spelt out twice? Why cant the compiler deduce that as the pointer is 
declared as TStringlist therefore it creates a TStringList?


jamie.




More information about the fpc-devel mailing list