🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #3209

Re: Do any employers use Modula-2?

#3209
From: Douglas Evan Cook
Date: Mon, 29 Jan 1996 21:27
100 lines
5900 bytes
On Mon, 29 Jan 1996, Jim Simmons wrote:

> On Fri, 19 Jan 1996, Douglas Evan Cook wrote:
> >
> >Although the government <says> it uses Ada, that really isn't the whole
> >story.  Ada is such a HUGE language, it takes years to compile.  So the
> >place where I worked looked for a good substitute that produces good solid
> >transportable code in which they could prototype their system, and so all
> >of the coding I did was in Modula II.  After I was done, somebody else
> >went through and translated, line for line, my M2 programs into the Ada
> >that most of the government seems to want.  We kept the M2 versions, and
> >they are used as well, but we had to create Ada versions for the
> >departments that only used Ada.
> 
>  Sounds like a typical government approach. And we pay for it!

I think it saves a whole lotta time, and when final products get written 
in both M2 and Ada, it makes sense to write the libraries first in the 
"lighter" language and then translate them, so you have libraries in both 
languages.  Seems good to me.  Sorry if you don't like it - got any 
better ideas?

> >We used M2 as the original development
> >platform because it is self-documenting (well-written code reads like a
> >good novel in M2, and comments are usually not needed within modules),
> 
>  What shit!  Please do not perpetuate this attitude.
>  Everyone knows their own code better than their own privates...
>  until you forget, then it might as well be gibberish.

I wasn't talking about MY code.  I went through over 40,000 lines of 
OTHER PEOPLE'S code while I was working, and my job was to port the 
program to Windows.  Just looking at the well written code (good variable 
names, well structured) and the occasional comment (usually there was a 
comment at the beginning of public procedures, and there were comments 
next to potentially confusing stuff) was enough for me to understand what 
was going on.  The code I wrote probably needed more comments, since I 
wasn't as good at writing M2 code as they were (and I also had a lot of 
pressure on me to cover a lot of territory, so I didn't go back and 
change variable names to fit their function as much as I should have), 
but I think people understood it anyway.

> >(as opposed to Ada) has a quick debug-compile-test cycle.  Until I
>                                                             ^^^^^^^^
> >graduate (at which point I don't have a clue where I will be working), M2
>  ^^^^^^^^^
>  This explains the bit about non-commented code.
>  You won't work for me with that attitude. Whatever language, be it C, C++
>  Modula-2 or Pascal. It makes no difference.
>  I hate to use the phrase, but I will anyway :-), "in the real world"
>  you have to maintain code as well as write it, and so does everyone
>  else.  No one ever seems to get around to writing real documentation
>  outside the actual program (who said I was perfect :-( not me) and 
>  even when they do it is rare technical documentation that gets anywhere
>  near the level of detail you can reach in code.

THAT IS WHAT I WAS DOING!  I maintained code, 8-12 hours a day for 2 
months.  I found that M2 required less commenting than the equivalent C 
code.  I did not find that it required none.  Sorry for the 
miscommunication.  The last few days of work, I wrote the comment headers 
for my routines.  I comment where it helps.  My point was that M2 is easy 
to read and understand if used correctly.  In M2, you do

  FOR j := 1 TO fooTop DO
    foo := 0;
  END;

In C you do (forgive the exact syntax - I'm a little rusty)

  for (fooPtr=foo;;fooPtr==foo+fooTop)
    fooPtr* = 0;

and you probably could use a comment or two if it were any more complex.  
I guess I'm not fluent enough in C to be able to come up with great 
examples, but the C code that I see has so many thousands of screwball 
constructs that you probably need a comment for every basic operation.  
In well-written M2, you need a comment for every exported procedure and a 
comment for every confusing part.

>  Sorry if this sounds a bit acerbic, but this is one very good yet
>  very simple habit to get into, and the longer you code the more you
>  will appreciate it - even if you are the only one that ever reads
>  your own code. In a year's time it might as well have been a stranger.
> 
>  More and more employers nowadays are asking for samples of code, or
>  even watching you produce code, before they hire you.
>  Clean, well commented code can hardly do you any harm.

I appreciate the advice and will take it into consideration.  However, 
meaningless comments turn an employer off, since they can see that you 
have wasted time commenting something that is obvious.  I like to think I 
have found a good balance.  And the balance for M2 is a lot lighter on 
the comments than C, if you ask me - I will comment a lot more in my C 
code than I will in M2.

============================================================
Douglas Cook, undergraduate in Computer Science at BYU
------------------------------------------------------------
This sentence is false.
============================================================
Technical Details
Message-ID: <Pine.HPP.3.91.960129140627.8419E-100000@foggy.cs.byu.edu>
Path: arc1-ca.pugleaf.net!foggy.cs.byu.edu!cookd
References: <carvaines.1-1801961238310001@slip7-4.acs.ohio-state.edu> <Pine.HPP.3.91.960119111432.23852A-100000@clear.cs.byu.edu> <310c7337.53494d4d4f4e53@simmons.actrix.gen.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!foggy.cs.byu.edu!cookd
From: Douglas Evan Cook <cookd@cs.byu.edu>
Newsgroups: comp.lang.modula2
Subject: Re: Do any employers use Modula-2?
Date: Mon, 29 Jan 1996 14:27:15 -0700
Organization: Brigham Young University
Message-ID: <Pine.HPP.3.91.960129140627.8419E-100000@foggy.cs.byu.edu>
References: <carvaines.1-1801961238310001@slip7-4.acs.ohio-state.edu> <Pine.HPP.3.91.960119111432.23852A-100000@clear.cs.byu.edu> <310c7337.53494d4d4f4e53@simmons.actrix.gen.nz>
NNTP-Posting-Host: foggy.cs.byu.edu
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
In-Reply-To: <310c7337.53494d4d4f4e53@simmons.actrix.gen.nz>