[nem-en] loving Nemerle

d d at hell.art.pl
Thu Oct 27 21:59:36 CEST 2005


On Thu, Oct 27, 2005 at 07:57:40PM +0200, Kamil Skalski wrote:

> >  This would be great. Actually IMO such a thing should be enabled by
> > default. The more the compiler cares about, the better. If some of the
> > work can be taken care of by the machine, let's shift the burden to it!
> 
> And why do you want to force people to conform to the "one coding-style way"?

 Not One Coding Style, but the one *they* have chosen for a particular project.
And why ? Because the code only benefits from it and it is a little effort
on the side of the programmer. Noone is forcing anything on him, *he* choses the
style and should by any reasonable standards, stick to it afterwards.

> I think that in general compiler should warn only about things, which
> could potentially be an error, like variable which is never assigned
> to.
> 
> On the other hand it is not always the best approach.
> 
> There is a number of warnings, which I like in ncc:
> - check if instance method actually uses 'this' pointer, otherwise it
> can be made static
> - check if hard cast (:>) is necessary or you could just do type enforcement:
>    foreach (x :> string  in ["1", "2", "3"]) {   // cast is not needed
>      ...
>    }
> - method is unused
> etc.

 Indeed, this is great. But it takes care about stuff, that is relevant to the
compiler and neglects the part that is important only to the human - coding
conventions. Clear and consistent code style can make sources way more 
understandable, searchable and maintainable in general.

> > use a "predefined" style (such as ncc-style for example) or perhaps
> > it could be detected "on the fly" and consistency checked in the rest
> > of the source code.
> 
> I would prefer to see it as a separate tool / compilation pass, but
> probably just for performance reasons and avoiding the expolsion of
> complexity in compiler.

 Well, that is your choice to make. 

> >  I totally believe the programmer should be restricted to doing only what
> > they are supposed to. And the more can be forced on compiler level, the
> > better.
> 
> Sounds like a prison to me ;P
 
 Really ? Functional programming, which I assume, you like, takes away a lot
of this "freedom", but you admit it's worth it, don't you ? People who love 
this "freedom" more than anything, keep writing in assemblers ;]
 What I'm saying is that it took people a lot of time to learn, that it pays 
off to narrow down the possibilities a bit, to gain something in return (on
code level) - why not extend this good practice, to the source-styling level ? 
 And as I said in the beginning - of course using such a feature shouldn't be
mandatory, but I think modern languages *should* enforce consistent source
styling by default. An average programmer todays days is usually lousy (in
terms of knowledge) and lazy, you can't expect things to get better in this
field, if you don't force them (the programmers) (or at least gently, but 
firmly push in the right direction ;]).

d

-- 
https://hell.art.pl == terror.org.pl == terror.icm.edu.pl/~d/gpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /mailman/pipermail/devel-en/attachments/20051027/148d8f6c/attachment-0001.bin


More information about the devel-en mailing list