Atomorun2008 Opensource

Mike Parker aldacron at gmail.com
Thu Aug 21 18:30:24 PDT 2008


bearophile wrote:
> Jarrett Billingsley:
>> Uh, I'm not sure where you got the idea that you can tell other people what 
>> coding style they should use, but typically it doesn't work ;)
> 
> I'd love people to criticize my code :-)
> 
> In the the creative literary mailing lists I follow I am used (and even supposed too) to comment/criticize everything people shows in the group. So I am trying to... improve this group encouraging people to look at each other code to suggest things, etc. A community of writers doesn't need to be too much different from a group of programmers :-)
> The things I have said here aren't just "coding style", for example I have avoided suggesting things like where to put the brackets, how much indent use, etc. The things I have suggested, like to not put "private" inside structs seems more important, closer to being code bugs (despite not being bugs). Walter has written some conventions for D and I think it's positive to follow some of them (even if maybe Tango doesn't follow some of them).
> 

In literature, the written word is the end product, which should be as 
'polished' as possible. Software is polished in terms of functionality 
and presentation. Which features of the language to use in the source 
itself ('with' statements, templates, and so on) is a choice of personal 
discretion (or team coding standards). Your suggestions are nowhere near 
the equivalent of helping someone improve a literary work.

If your post of unsolicited suggestions had been directed at me, I'd 
ignore the whole thing and be rather annoyed at you for doing so. Just 
because you don't need to add 'public' to struct fields doesn't mean you 
shouldn't. Some, myself included, would argue that it improves 
readability. Just because Point objects share a lot of similar code 
doesn't mean they *have* to be implemented as templates (as suggested by 
downs). Personally, I avoid templates for such simple cases. You say 
this isn't the same as telling someone where to put the brackets, but in 
effect it is because there's no 'right' way.

Sure, source should be readable so that others can pick it up. But an 
important aspect of readability is consistency. Whether or not you use 
'with' statements is less important that whether you do so or don't do 
so consistently.


More information about the Digitalmars-d-announce mailing list