flat assembler
Message board for the users of flat assembler.

Index > DOS > What Coding Style?

Author
Thread Post new topic Reply to topic
cypher



Joined: 07 Apr 2011
Posts: 51
Location: The cave
cypher 21 May 2011, 05:32
I am looking for a code style. What do you suggest?

_________________
When all in life fails, get weird and disappear into the mountains
Post 21 May 2011, 05:32
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville 21 May 2011, 05:56
cypher wrote:
I am looking for a code style. What do you suggest?
Yours Wink
Seriously, it's very personal.

_________________
FAMOS - the first memory operating system
Post 21 May 2011, 05:56
View user's profile Send private message Visit poster's website Reply with quote
cypher



Joined: 07 Apr 2011
Posts: 51
Location: The cave
cypher 21 May 2011, 06:00
Good suggestion. I adopted to the usual style of FASM. But when it comes to identifier names I have a problem. Which is better to use: camelCase or internal_under_score?
Post 21 May 2011, 06:00
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 21 May 2011, 06:05
CamelCaseIsBetterForMe
but_recently_sometimes_i_use_underscores for the labels I don't want to be very remarkable in the source. Wink
Post 21 May 2011, 06:05
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 21 May 2011, 06:18

And for breakfast, which is better ? tea or coffee? Razz

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 21 May 2011, 06:18
View user's profile Send private message Send e-mail Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 21 May 2011, 21:13
The coding style you choose is less important
than being consistant throughout with that style.
Your coding style will continue to evolve, just be consistant with its usage.
Post 21 May 2011, 21:13
View user's profile Send private message Reply with quote
ctl3d32



Joined: 30 Dec 2009
Posts: 206
Location: Brazil
ctl3d32 21 May 2011, 23:56
Quote:
Your coding style will continue to evolve...

This problem always arises when i'm in the middle of a project.
Post 21 May 2011, 23:56
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 22 May 2011, 01:02
ouadji wrote:

And for breakfast, which is better ? tea or coffee? Razz

Code:
Yahourt_CrèmeDeMarron!:
 call fridge.open
 call yahourt.get
 call creme.open
 call spoon.get
 call ENJOY
    
Post 22 May 2011, 01:02
View user's profile Send private message Visit poster's website Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 22 May 2011, 13:45
edfed, where's the garbage collection? You should call empty_pot.discard (as many times as necessary until cx=0), spoon.rinse, and most importantly, fridge.close (as soon as possible or else your morning process will suffer from water leaks). Very Happy
Post 22 May 2011, 13:45
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 22 May 2011, 18:51
ctl3d32 wrote:
Quote:
Your coding style will continue to evolve...

This problem always arises when i'm in the middle of a project.
"This problem always arises when i'm in the middle of a project ..." Laughing Laughing

thank you ctl3d32, I feel now less alone.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 22 May 2011, 18:51
View user's profile Send private message Send e-mail Reply with quote
cypher



Joined: 07 Apr 2011
Posts: 51
Location: The cave
cypher 25 May 2011, 09:25
JohnFound wrote:
CamelCaseIsBetterForMe
but_recently_sometimes_i_use_underscores for the labels I don't want to be very remarkable in the source.
I do that sometimes too, but don't know when to do it exactly.
ouadji wrote:
And for breakfast, which is better ? tea or coffee?
Agreed. Tea? Can orange juice fit in? Maybe not.
bitshifter wrote:
The coding style you choose is less important
than being consistant throughout with that style.
Your coding style will continue to evolve, just be consistant with its usage.
Brilliant! Never thought of that. But as just as neville said, the same thing happens.

I think it's settled; CamelCase will do for functions, and underscores will work for other names. But I do appreciate edfed's style; it's unique. And Tomasz's style. Although he doesn't comment his code. Isn't it always best to have sufficient and descriptive comments in your code?

--------------------------------------------------------------------------
This helps but it is a bit confusing though: assembly coding style
--------------------------------------------------------------------------
Post 25 May 2011, 09:25
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.