[OT] Affect of typing styles on coding style (Was: Make dur a property?)
Nick Sabalausky
SeeWebsiteToContactMe at semitwist.com
Wed Jan 23 21:16:26 PST 2013
On Wed, 23 Jan 2013 23:19:17 +0100
"Adam D. Ruppe" <destructionator at gmail.com> wrote:
>
> (yup, I'm kinda for writeln = str; because you can throw that in
> without hunting for the end of the expression to put in the close
> paren.
>
I think that shows how different editors or even just personal
typing styles can affect our coding style. For me, I'll do stuff like:
str~isFoo?
[Oops, that's right, I need parens around that '?:']
<CTRL + (LEFT-ARROW x2)>
(
<END>
)
<LEFT-ARROW>
[Now looks like: str~(isFoo?|) <--pipe is cursor]
trueCond:falseCond
<END>
[Now looks like: str~(isFoo?trueCond:falseCond)| ]
[Hmm, I want to writeln that...]
<HOME>
writeln(
<END>
);
Final: writeln(str~(isFoo?trueCond:falseCond));
Probably not surprising that I avoid trying to code on anything but a
full-size keyboard with a proper section of <arrows, del, home, end,
pgup, pgdn>, because coding on, say, a laptop keyboard (even
one with a numpad) is a huge slowdown. I'd gladly give up the numberpad
on my laptop if I could get a standard arrows/home/end/etc section
instead, rather than the impractical "mini-keys in awkward faraway
places" they currently use for such keys.
Heh, actually, case in point, take a look at my normal work setup:
http://66.228.38.161/download/img/jobs-would-have-hung-employees-for-doing-this.jpg
(Yes, I need to get a wireless keyboard/trackball ;) )
>
> I see no reason to change the current behavior for non- at property.
>
> Now, for @property setters, we might use them for other
> operations too.
>
> @property int a() { return 10; }
> @property void a(int v) { ... }
>
> a += 10;
>
> should be transformed into a(a() + 10); which is not currently
> done.
Geez, we still don't have that?
More information about the Digitalmars-d
mailing list