suggested diet for WINDOWS.INC :)

Started by Shantanu Gadgil, March 14, 2005, 10:30:40 AM

Previous topic - Next topic

Shantanu Gadgil

Hi hutch, I replaced the spaces and replaced them with TABs (for proper alignment/indentation) :)

Surprising results :)
before: 1,138,852
after: 905,997

The indentation could be improved but I am happy for now :)

By the way, I am using version 1.27d
To ret is human, to jmp divine!

hutch--

I used to supply a toy that removed all of the spare spaces which dropped the file size by a couple of hundred K but the readability of the main include file over-rides the size saving.

This current version is built in parts after a reasonable amount of work to get the sequential dependencies correct so its not going to change in a hurry.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

pbrennick

The problem with tabs is that everbody uses a different setting causing a complete loss of formatting unless you just happen to use the exact same setting as the author.  This is caused by the rule used to expand tabs.  As a result, I stopped using tabs a long time ago and use spaces with a fixed pitch font.  This absolutely guarantees that my source will look the same on all editors that also are set to a fixed pitch font.  That is why all code I put on this board looks very professional where as those posts using tabs looks ugly.

Just a note on tabs.
Paul

MichaelW

I also stopped using tabs in my code long ago. It is actually slightly faster to edit code with the tabs intact, but in my view this tiny advantage does not justify making the code difficult to read for anyone who uses tab settings that differ significantly from my own. BTW, SMF, currently, does not correctly handle tabs in posted code.
eschew obfuscation

Ghirai

Well, you could also say at the beginning of your source something like "This should be viewed with a tabsize of x" :P
MASM32 Project/RadASM mirror - http://ghirai.com/hutch/mmi.html

Mark Jones

I'm working on a little utility to convert between various tab and space formattings just because of this caveat. Assembler is tedious enough without formatting anomalies. :)
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Mark Jones

 Here's what I've came up with so far in regards to the source format Tab/Space converter. Actually I guess this is my first real application. :U

Did I hear that Hutch had made something like this already?

[attachment deleted by admin]
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

hutch--

Utility seems to work OK Mark. I just tested it on the current version and its output is reasonably readable.

The toy I used to provide did something different, it removed any additional spacing so that you would only ever have a single space and it was purely to get the size down while keeping the original as reference. The readability is very poor on the result but it drops the size from 1136852 bytes to 854582 bytes

I just ratted through the archive of 3 dev boxes and found the original called HCOMPACT.EXE.



[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Mark Jones

 Oooh neat. Indeed, the tabbed version of windows.inc is about 22kB bigger than the monospaced version, and the readibility is retained. Maybe we can put windows.inc on a diet?
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Shantanu Gadgil

Yes!!! I am totally for the"diet"!

Thank you all for the support :)
To ret is human, to jmp divine!