dhh1128 / intent

the intent formal language
https://intentlang.org
2 stars 1 forks source link

in aliases, make sure new types are not created #122

Open dhh1128 opened 8 years ago

dhh1128 commented 8 years ago

This article has a valid complaint about the java antipattern of using extension as a sort of pseudo typedef: http://www.ibm.com/developerworks/java/library/j-jtp02216/index.html

We can also mitigate some of the complaints about C typedefs and "header hell" by not making aliases conditional--that is, we don't allow:

#ifdef PLATFORM1
    typedef id_t int32_t;
#else
    typedef id_t int16_t;
#endif

We should allow aliases, but by making them unconditional, we make their meaning consistent. The authors of the java article were correct to point out that this is a virtue of java--at least every java agrees on what the types mean.