From: Louis J Scoras Date: 2006-10-07T10:00:57+09:00 Subject: Re: What is the reason for this syntax? > Thats why I keep sayind defacto (by default) in other words this style > became required because blocks are like parameters in ruby. I'm not > trying to say someone just happened to think K&R style was the best > thing ever with respect to blocks. This is why I asked what the > reason was for the parsing errors in my original question. I know you didn't think it was a conspiracy or anything =) Still, I think it is helpful to have a standard format for code, whether it is enforced by the language or not. Coding standards are established at many organizations, in the latter case, for just this reason. Granted this is a touchy topic for a lot of people. I know that many programmers react viscerally to the "wrong" indentation, but you really do need a standard. > What does the first line you quoted have to do with syntax of a > language that statement was in response to davids assertion that > people should use one convention when programming in the real world > (IE one that he happens to like.) my contention is that this is not > really up to the language to enforce an indentation scheme. You are exactly right. Unfortunately this topic generally tends to get peoples blood boiling, probably to the same level as politics, religion, et cetera. Example: Should ruby enforce a two character indentation level? I'm sure that would be a heated debate. I have my opinion, and I'm betting it isn't the same as yours. > With respect to copious amounts of comments what makes it a good idea > to assume that whoever else might be reading the code you have written > is at the same skill level as you are especially if you decide to > opensource your work. First, I think that it is a valid assumption that they have a grasp of the programming language you are working in. Second, I'm not saying that you shouldn't have _documentation_. I'm saying that you shouldn't clutter your code with excess comments. You should have developer documentation that you keep along with the code (with your code artifacts, but not inside them). > Personally I try to keep the comments to anything I feel that might be > a bit strange to someone not because of formatting but because they > simply have never seen a given technique I use before. Eg:Case > statements alot of the people I know at Uni don't really understand > cases so I try to put comments near my cases if I am going to be > sharing code with them. Or I simply tell them what this or that does > while I am face to face with them. *Shrugs.* I would assume that someone reading my code would know the standard constructs of the language the program is written in. I wouldn't annotate and English poem with grammar notes--unless I'm writings a textbook on teaching English poetry. > With respect to the last line you quoted it is precisely because this > is an opinion that making it a syntactical requirement of the language > is a mistake not everyone will find the same parts of a language as > readable as others will. I find cases to be much easier to read than > if's generally should I go make a language that does not have an if > construct at all and instead only allows cases? You need to have some way of expressing the concept. The implementers have to select one or you don't get the feature unfortunately. > Also take note that I was refering to the use of ?: in c/c++ not in ruby. > > As I said in the begining these are just minor annoyances I feel like > some here are taking things far too personally or are too busy trying > to pull rank on someone to actually see the point they are trying to > make. (I do not mean you Lou.) Well, people will be people, and as I said above this topic tends to be quite touchy for programmer types. Who knows why? Don't let it bother you =) I get what you are saying, but I still think that claiming that these issues constitute a design error is a mistake. -- Lou.