Author Topic: Upfront decision about single file vs separate compilation and procedure design?  (Read 5865 times)

Offline dalfonso01

  • Jr. Member
  • *
  • Posts: 44
Hi,
I am seeing that also a simple move from a single file to a separate compilation to target a library for reuse  requires quite a lot of attention , significant more than in higher level languages.
The same occurs moving code from a block to multiple procedures.

Should I consider the splits better as an upfront decision to make, for any but toy size coding?

Thanks
Fabio D'Alfonso
« Last Edit: May 27, 2014, 12:58:34 PM by dalfonso01 »

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Upfront decision about single file vs separate compilation?
« Reply #1 on: May 27, 2014, 12:56:51 PM »
Hi Fabio,

My naive thinking is that you've got two keywords here, one is "reuse" and the other is "upfront". If "reuse" is a goal, I would think that separate compilation of modules would almost certainly be better. As opposed to writing a big "monofile" first and then deciding to split it up into modules, or writing modules first and then deciding to combine them, I would think that "upfront" would be better - although you could do either without "too" much penalty. That's only halfway through my first cup of coffee...

Best,
Frank


Offline dalfonso01

  • Jr. Member
  • *
  • Posts: 44
Hi,
the same occurs moving code from a block to multiple procedures, and probably my first think came from this more than the split in files.

Yes, nothing really hard, I was just seeing how the operations related to stack and registers' preservation make the task a little more error prone.

Thanks
Fabio D'Alfonso