Suggestion

BlitzMax Forums/BlitzMax Programming/Suggestion

Jeroen(Posted 2004) [#1]
Rem
End rem

... it's not very handy to type those rather clumsy lines everytime I want to temporary (un)comment a block.

A suggestion: the alias to Rem/end Rem!
Why not:


/'
short version
'/




Robert(Posted 2004) [#2]
Or easier, a feature in the IDE to do automatically comment / uncomment blocks of code.


ImaginaryHuman(Posted 2004) [#3]
Isn't /' almost as complicated as Rem to type?

I guess I agree though, being able to select a block of code and hit some key to make it commented would be nice


Warren(Posted 2004) [#4]
Sure, but '/ is a lot less typing than "end rem".


Anthony Flack(Posted 2004) [#5]
"A lot"?


eni(Posted 2004) [#6]
Greatly doubt the change will happen, but I'd welcome it. Not because it's less typing, but because scanning your method headers gets confusing with Rem ... End Rem everywhere.

It's a lot easier to ignore symbols than it is words.


{cYan|de}(Posted 2004) [#7]
XD


Jeroen(Posted 2004) [#8]
Yes, a lot, when you are commenting much, the difference is huge. '/ is 70% less typing.


BODYPRINT(Posted 2004) [#9]
why not type

Rem
End Rem

and then to un-remark it type
'Rem
'End Rem

Now you don't have to hit the backspace key 100% more than before and to re-remark them is 50% less typing than /'...'/

:-P


Hotcakes(Posted 2004) [#10]
Ahhh, but imagine this combo instead:

'/*
'*/

;]


BODYPRINT(Posted 2004) [#11]
lol

Must be an Adelaide thing, whatever your name is :-)

I live near Marion Shopping Centre here by the way.
What area are you?


Warren(Posted 2004) [#12]
"A lot"?

Well, since you asked, let's see:

'/ = 2 chars

end rem = 7 chars

My option is 5 chars less, which is a 250% savings.

Extrapolate that over the total number of block comments you would (hopefully) be writing over the course of a project and I'd say it adds up to "a lot".


John Pickford(Posted 2004) [#13]
There are lots of words we could replace with symbols to save typing time (like that matters). But the language would be come undreadable.

I believe Mark has the right philosophy in minimising the use of symbols. Rem\End Rem is clearer. It's also consistent with the rest of the language. All blocks of code are defined in the same manner.

Typing time is not a significant factor in programming. I've never met a programmer who can code as fast as he can type. Clarity, on the other hand is vital.


Warren(Posted 2004) [#14]
Typing time is not a significant factor in programming.

I really can't disagree strongly enough.

The best advances Microsoft has made in their IDE's over the last few years all center around reducing typing (intellisense, auto complete, etc). Fewer keystrokes is the goal for higher productivity.


John Pickford(Posted 2004) [#15]
Well I think you're mistaken.

Very little of the time spent writing a progam is actually typing. I don't belive saving keystrokes has any measurable effect.

Microsoft's unstoppable feature creep has little to do with productivity.

Clearly readable code on the other hand can certainly improve productivity.


TommyBear(Posted 2004) [#16]

Typing time is not a significant factor in programming. I've never met a programmer who can code as fast as he can type.



Meet some more. :p


Clarity, on the other hand is vital.



The problem with using verbose delimiters around actually english-like text is that it can start to mix with the text and that reduces clarity.

For example:
Rem
Remove all the blocks in this list because it will
end up overflowing
End Rem


as opposed to
/'
Remove all the blocks in this list because it will
end up overflowing
'/


See the difference? Something a lot of people miss.


John Pickford(Posted 2004) [#17]
Yes. I think the first one is clearer. Of course I would put blank lines and indention in there.


Warren(Posted 2004) [#18]
Yes. I think the first one is clearer.

Wow.

Of course I would put blank lines and indention in there.

"I like having lemon juice squirted into my eye but, of course, I would have a cloth handy to wipe off my cheek."


TommyBear(Posted 2004) [#19]

Yes. I think the first one is clearer. Of course I would put blank lines and indention in there.



No. Look again.


dan_upright(Posted 2004) [#20]
i think jp (mind if i call you jp?) is getting at something like this:
Rem
    Remove all the blocks in this list because it will
    end up overflowing
End Rem
or even better, this:
Rem

    Remove all the blocks in this list because it will
    end up overflowing

End Rem
and i happen to agree with him that typing time is fairly insignificant and that rem/end rem seems perfectly natural within the context of the rest of the language ('/ & /' would look a bit out of place) - although in all honesty i couldn't care less whatever is used, bottom line, arguing about insignificant crap like this is worse for productivity than a bit of extra typing =p


Jeroen(Posted 2004) [#21]

I believe Mark has the right philosophy in minimising the use of symbols. Rem\End Rem is clearer. It's also consistent with the rest of the language. All blocks of code are defined in the same manner.


Hmmm, I don't agree. There already is the ' symbol. Now what is so extra difficult in adding something that types fast, and helps you commenting a block without the "Rem / End Rem" line? I think distincting "Rem" from commands like If/End If or Function/End Function is smarter! It makes it more readable, not less.

When I read Rem / End Rem I think the actual code inside the statement is something that is part of the active language, just like if/end if.


Typing time is not a significant factor in programming.


Wrong. It is about transferring your thoughts to the editor, you have to stay in a "flow".


podperson(Posted 2004) [#22]
I like the /' '/ suggestion, but I'd prefer:

'/ -- this is ALREADY a comment, since ' starts a comment
/'


Hotcakes(Posted 2004) [#23]
What area are you?

Glanville - just a bit past Pt Adelaide...

Didn't know there was anyone else stuck in Adealide round these parts =] You should check out Adelindie if you don't already know about it - http://www.grit.net.au/adelindie

Sorry to the rest for being off topic, but the only really decent post was podperson's above ^^^ ;]


FlameDuck(Posted 2004) [#24]
"A lot"?
Yeah. Like typing 'u' instead of 'you', and '2' instead of 'to'/'too' and 'm8' instead of 'mate' saves alot of typing, and makes sentences much more readable.

Whether Rem and End Rem or /' and '/ make for easier reading in notepad is rather pointless isn't it, as any decent IDE will have syntax highlighting, which improves readability by such a large factor that keywords become irrelevant.


podperson(Posted 2004) [#25]
The autocompletion features in advanced IDEs are huge productivity improvements, but not so much because they reduce keystrokes (they *certainly* don't increase typing speed, since it's hard to touch-type through the autocompletion interface) but because they reduce errors in entry.

Hence, I don't think that autocompletion and other context-sensitive features in IDE argue for keeping language features terse.

{
code here
}
is nice because it breaks up text code with punctuation, but not if your code also looks like punctuation.

if
code here
endif
is nice because it links the closure to the beginning of the block (and less ambiguously then a generic "}" or "end").

In both cases, indentation would help.