Home > English, Jeez, Programming > Tabs, spaces, curly braces and blocks

Tabs, spaces, curly braces and blocks

Quick and small update concerning JBoia desing: decided to go with curly braces instead of identation for block delimiters.
Three reasons:

1) Tab width isn’t a standard, and it can get confusing when a single source-code file is edited by more than one person, who may not use the same editor. [ 1 & 2 ] ;

2) After reading Gaucho‘s commentary and the link he recommended, I though that curly braces are more popular and should make people already familiar with languages like C/C++, C# and Java more comfortable;

3) Yeah, also, I’ve gotta admit: it will be way easier to implement the compiler using curly braces instead of identation.

Categories: English, Jeez, Programming
  1. May 23, 2007 at 22:46

    >> Tab weight isn’t a standard, and it can get confusing when a single source-code file is edited by more than one person, who may not use the same editor.

    This is only a matter of making your editor substitute tabs for spaces, but it’s true, if you don’t pay attention it get confusing.
    The main reason to use indentation as block delimiter is readability. This takes away one degree of freedom from the developer, but the source code of different people became a bit more alike. It turns out to be a good thing, because usually we spend more time reading and mantaining code than writing, and this way you don’t have to “context-switch” too much.

    >> Yeah, also, I’ve gotta admit: it will be way easier to implement the compiler using curly braces instead of identation.

    Yeah, you be goddamn sure of that =D
    There are a lot of problems to implement indentation block delimiters…

  2. May 24, 2007 at 00:43

    Yeah, Gaucho. But I don’t think that curly braces take away freedom from the developer. He can (and should) always ident his code. The braces are only a little-help for the compiler (and for me), which also helps in these problematic tab-related cases.

    Regarding your last commentary…
    Python being duck typed doesn’t mean it’s not strongly typed. Begin strongly typed just means that you can’t do an operation such as 1 + “1″. In JavaScript, weakly typed, it’s allowed.

    About inheritance.. yeah, I’ve heard and read some about it being a problem. That’s why Java lacks multiple inheritance.
    I’m not sure yet about what to do about this topic, I think it needs more research, taking a look at Python’s interfaces (which I don’t know) will probably be a good beginning.

    Thanks a lot for your suggestions😀

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: