flat assembler
Message board for the users of flat assembler.

Index > Main > Add block-comments into Fasm?

Goto page Previous  1, 2, 3  Next

Add block-comments into Fasm?
Yes, absolutely
56%
 56%  [ 37 ]
I use this sparely (in other languages)
12%
 12%  [ 8 ]
No need
19%
 19%  [ 13 ]
Don't do this, it would anticipate with Fasm's concepts
9%
 9%  [ 6 ]
Donno
3%
 3%  [ 2 ]
Total Votes : 66

Author
Thread Post new topic Reply to topic
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 08 Dec 2004, 15:09
Code:
whatsover .. u wanna start here <------------- line 30
comment whatsover ..
    

above would be marked error at line 30

dot dot must start after the [ret] and with a space after

[return]
..[space]start ur comment <- to start multiline comment

mark as single line comment unless dot dot before right before [return] was found.

ascii text comment [space]..[return] <----- to end multiline comment
[/code]
Post 08 Dec 2004, 15:09
View user's profile Send private message Visit poster's website Reply with quote
rea



Joined: 14 Nov 2004
Posts: 92
rea 08 Dec 2004, 15:10
Yep, by the way, what I sugest are more oriented to suport a switch from the editor when you whant write code and when you whan write info to programmers or documentation, I still thinking that: commentaion, documentation, messages, flags for programmers are not part of the language. And yes you should use the source editor but only if you whant have access to that things, you can still write a full source programm in notepad, then you can open a app if you wish that is a tool specialized for: documentation, comentation and other goodies.

I dont whant to delete them, but I whant to move them to other part and not in the source.


For me I guess should be nice, but yes, I doubt there exist such a way actually.... or that will like to all Razz
Post 08 Dec 2004, 15:10
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 08 Dec 2004, 15:19
Code:
.. start multiline comment
.. wanna start again
.. wanna start again for nice UI ..

.. comment ..
.. comment ..
.. comment ..

.. +-------------------+
   | whatsover comment |
   +-------------------+ ..
    

above should be valid comment Smile
so, what do u think?
Post 08 Dec 2004, 15:19
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 08 Dec 2004, 15:27
h, I still think comments in source is a good thing - main documentation should be external, but it's often a good idea to have a small note as to why you're doing things in a particular way. Or in assembly, if you're depending on a register or stack value set a page of code away, that this use of that register is because of this or that fact. And, of course, *references* to the external documentation.

I don't like "write all the documentation inline in the source code", which (afaik) is what people do with JavaDoc or OxyGen or whatever. But I still think comments, both singleline and blocks, are important.

As for the implementation, I don't think nested comments are a good thing. They can end up being confusing very easy, it requires even more code both in the assembler, and in an editor to do syntax highlighting, and it's not *that* useful.
Post 08 Dec 2004, 15:27
View user's profile Send private message Visit poster's website Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 08 Dec 2004, 15:34
well, for IDE developement,
i think,
we could do something like (if to stick with tradition)
when a text range was selected (perhaps 5 rows text), Ctrl + watsover would automatically insert ";" each in each line start or delete the ";" from each selected line.

that is nice feature if to stick with tradition and perhaps the fastest way to comment and uncomment Smile unless ur comment range is larger than ur screen monitor

well, just read matrix post, my style has something alike with him/her?
Post 08 Dec 2004, 15:34
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 08 Dec 2004, 16:07
vbVeryBeginner, that's nice if you're using an IDE - but what if you're using notepad, or some linux editor?
Post 08 Dec 2004, 16:07
View user's profile Send private message Visit poster's website Reply with quote
rea



Joined: 14 Nov 2004
Posts: 92
rea 08 Dec 2004, 16:41
hhe, I not think Matrix is her Wink lol.

Quote:
But I still think comments, both singleline and blocks, are important.


Yes, but little comments, and comments not flags for warning, todo and such things, I think such type of flags should be remind in the project or aka the IDE, for example you have a project, you let it some time and then return, in this time you have missed that somewhere in your files you put ; FIXME: Check for the dependency and the input of this function.

If you remember that there is a fault if you dosent have a good technique or defined one, you will get some time if you put a flag called FIXME or CORRECTME or a TODO, you will need not only search for all posible tags that you can imagine, but in each file. I think that way for handle the track of ERRORS, TODO and other things is a bad way of handle them.

Instead you open a source editor, in fact you open the project and you can get a resume of it. without scan all the files in the project Wink.


I have a friend that have passed some time talking to me, and he propose the called readability, when more readable is a source code less commenting (explanation will need) and now I get my new signature Smile. There are other things, ok dont remove simple commenting, but sumary of a project (errors, how was the log of fails in compile/assemble, and other things) should be done at the source editor side. And documentation should refer (or insert) the code if necesary, not the code should insert the documentation Smile.
Post 08 Dec 2004, 16:41
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 08 Dec 2004, 16:53
f0dder wrote:
Madis,
#1 - comments that long should be moved to external documentation
#2 - C-style block comments are fine Wink
#3 - is that really a problem? And removing the begin-comment was never a problem with C-style comments, at least if you use the /* /**/ trick...

I think supporting block comments is a good idea, I've always missed them in assemblers that don't support them. It should be trivial to code, and in no way "Bloat" FASM - there's a difference between adding a nice feature and adding bloat. How much would the support be, a couple hundred bytes of code at most if sloppily coded? And would it affect speed? Doubtfully.

As for people saying code shouldn't be commented, that's your choice - no reason to remove commenting support just because *you* don't like it Smile.

Rectangle comment blocks are an interesting idea, and I've had the thought myself... but I'm afraid it would be way too confusing to be actually useful. Perhaps if it was tightly coupled with a syntax-coloring IDE, but I don't think it's a good idea tying a language so closely to it's IDE that you can't use it without.


f0dder
i think fasmw could have the feature to convert blockcomments to line end comments

; line
; line
; line

block comments primary advantage whould be to avoid using ; in eachj of the line beginnigs, i thought at least some of you had the feeling its not good writing ; before each line in some cases, like example:
i insert a block of interrupt list, and wana concert the block to comments, so it could stay near the code i have written.

the problem whould be with non vertical selection editors, of course you couldn ' t move the first block of comments to the right and then convert block to linear style (; ; Wink

of course if you are writing a source with notepad that rect block comment shouldn't bother you.
Post 08 Dec 2004, 16:53
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 08 Dec 2004, 19:22
Quote:

you will need not only search for all posible tags that you can imagine, but in each file.

The key here is consistency - stick to a few symbols and use those. FIXME, TODO and BUGBUG are easy to scan for (since they shouldn't be used as symbols or anything in normal source files). If you work in a team, agreeing on standards is important already, so you might as well agree on some commenting standards like this.

The advantage of using comments is that you can use any kind of source editor you want, you aren't tied to one particular IDE. And it's easy showing this kind of comments with a multifile grep or similar tool (lots of IDEs even has multifile grep'ing builtin, because it's so useful).
Post 08 Dec 2004, 19:22
View user's profile Send private message Visit poster's website Reply with quote
rea



Joined: 14 Nov 2004
Posts: 92
rea 09 Dec 2004, 17:59
I have a solution for that, pheraphs Smile...

The point to let commenting, documentation and flags to the side of the IDE, RAD etc is that you dont need to care about a special formating in your code, for example, like you say, there is a group and they agree on a standar, but what happend if this group let the project and then come new people?, they need to know the standar.

Altough you arent tied to a IDE, then you are tied to grep Smile.


The point here is instead of do a standar each time a new group is unified to do a work, will be best if there exist a standar/description/spec on how to organize a project and suchs things, in that way, when a IDE/RAD is done, they if whant can follow that spec, and tada you can open the same projects in diferents enviroments (IDEs..), altought I think that the people that do IDES and such things pheraphs will not whant to share the same interface for project control and SW engienering...
Post 09 Dec 2004, 17:59
View user's profile Send private message Reply with quote
rea



Joined: 14 Nov 2004
Posts: 92
rea 12 Dec 2004, 01:22
Altought there no exist such specification over project management and SW engienering --> aka how to manage docs directly specificated for IDEs RADs ISEs (Integrated Software Enviroment I have readed some like a software suit Wink)

I gues for the moment would be usefull to have multiple comments because there no exist such specifications and ther no exist such enviroments that implement them Wink and pheraphs they will never exist?? we will see Mr. Andersond Very Happy.
Post 12 Dec 2004, 01:22
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 16 Dec 2004, 17:15
Woooaaahhhhhh!!! Shocked

This poll really fueled the fire of assembly language (although it is only about block comments Laughing )

I see that many of you like block comments (not all), but have problems with its readability/implementation. I have already implemented many things into my copy of Flat Assembler for myself, and thus I may say that implementing block comments may not be as easy as adding just a new instruction, especially not with nested comment blocks. But this is why I polled this poll Rolling Eyes , to find out if there is a need at all and if some of Fasm's makers would implement it into Fasm. I think that it time for Privalov and JohnFound to decde over it.

Thank you all for your numerous feedbacks.

_________________
MCD - the inevitable return of the Mad Computer Doggy

-||__/
.|+-~
.|| ||
Post 16 Dec 2004, 17:15
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 16 Dec 2004, 17:17
I think that if block comments won't be implemented into Fasm, than there should be at least the "toggle comment" feature implemented into the official release of the Fasm IDEs.
Post 16 Dec 2004, 17:17
View user's profile Send private message Reply with quote
kake_zinger



Joined: 15 Jul 2004
Posts: 51
kake_zinger 16 Dec 2004, 19:52
My support goes for the ;{ .... ;} format. Or anything similar as long as it starts with a ;
Post 16 Dec 2004, 19:52
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 16 Dec 2004, 20:19
Okay, but it's strange that Privalov has not posted anything about it yet.
I wanna hear your opinion, too. (Perhaps he just had too many other things to do or private problems, I have no clue)
Post 16 Dec 2004, 20:19
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 16 Dec 2004, 20:47
Anything starting with a semicolon could possibly break existing assembly sources, and thus wouldn't be smart. In my opinion, if block comments are to be implemented, it would be smarter to make something fasm-specific that fasm handles without problems, rather than something that could make fasm choke on normal asm syntax. Of course neither would be a problem to fix, but oh well Smile
Post 16 Dec 2004, 20:47
View user's profile Send private message Visit poster's website Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias 17 Dec 2004, 08:39
I am in complete agreement with fudder. I liked the tasm feature of commencing block comments with ^ after which, I always added BEGIN COMMENT, and then terminating the comment with another carat symbol ^, preceded by END COMMENT.
MCD asks about Privalov's opinion on the subject. I can assure you, both from our private conversations together in Krakovia, and in writing, he DISAGREES with me, at least on this point. He prefers to use the semicolon, only for the most fundamental, i.e. minimalist, notation. He is not opposed to clarification and documentation, but feels that verbosity detracts from readability, and is most properly elaborated EXTERNALLY, in another file. Smile regards, tom tobias
Post 17 Dec 2004, 08:39
View user's profile Send private message Reply with quote
rea



Joined: 14 Nov 2004
Posts: 92
rea 17 Dec 2004, 18:55
Why not only have a continue line???

; single comment

; a comment \
with more than one line \
or other one

Alotught that will break people that some time have puted a comment like:
; x thing \
sub eax, ecx

but the \ only take like continuation the next line, then a comment like:

; x think \

sub eax, ecx ; will not take this line like continuation, the anterior line (blank) is the continuation

Pheraphs the anterior ; x thing \ will be puted when you have a comment of much lines and then you decide to delete them missing tha you need delete the continuation character mark, that will be a problem Wink.
Post 17 Dec 2004, 18:55
View user's profile Send private message Reply with quote
Kain



Joined: 26 Oct 2003
Posts: 108
Kain 18 Dec 2004, 04:04
KISS

; regular comment


;;
block comment
;;

This is used in RosAsm. Works like a charm.
Post 18 Dec 2004, 04:04
View user's profile Send private message Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias 18 Dec 2004, 08:11
Kain inquires about using two ordinary symbols sequentially to indicate a block comment. I disagree, because I am a mediocre typist, who frequently makes mistakes. I am also both uncoordinated, and not very nimble, consequently, I frequently would accidently introduce a double semicolon, without realizing it, and waste hours trying to figure out what was wrong. A unique symbol will decrease inadvertant typographic mistakes. To my way of thinking, a unique symbol, like the carat, IS easier to read, and requires fewer key strokes than a double semicolon! (KISS = keep it simple stupid). One should also remember the fact that some of us are not gifted as programmers, therefore, some of us, occasionally make mistakes in our code. In such a case, we must EDIT our code. What happens when the editing process accidently leaves a semicolon at the terminus of one line, and then, another semicolon is deliberately inserted in the first column on the adjacent line to explain some modification of the code? Since, by definition, the block comment is not line oriented, the parser will have to be pretty clever to distinguish the two sequential semicolons separated only by a carriage return Smile
Post 18 Dec 2004, 08:11
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.