[Info-vax] C versus Macro-32 readability, was: Re: Listeners in VMS Basic

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Thu Jul 15 14:15:39 EDT 2021


On 2021-07-14, Dave Froble <davef at tsoft-inc.com> wrote:
>
> I disagree about your opinion about comments in C, or any other 
> language.  Why?  At least for me, I can get some idea what is happening 
> by reading comments, always, well usually, easier to read than code, in 
> any language.
>

As I have already mentioned, I use comments in code a lot.

However, you need far less of those comments in higher level languages
and the comments are more geared towards giving an overview of what a
section of code does along with things to look out for in the problem
being implemented.

In your Macro-32 code, the comments are much more mechanical and low-level
due to how far less obvious assembly language code is even when compared
to C.

> Having to figure out what code is doing will always be less productive 
> than good commenting.
>

Agreed. And in a HLL, the language gives you the tools to help express
the problem being solved (even in C) in a way that is simply not
possible in assembly language. This is because the HLL allows you to
express much more _what_ is being done and then let the compiler turn
it into _how_ it is done.

For example, you simply don't care about CPU registers in a HLL
(unless you are writing very low-level systems code). You instead
focus on variables which you can assign meaningful names to instead
of having to worry about managing a limited number of generically
named CPU registers.

You also have the abstract data structures in C and other HLLs where
you express _what_ you want and then let the compiler worry about
turning it into the _how_.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.



More information about the Info-vax mailing list