Computer Old Farts Forum
 help / color / mirror / Atom feed
From: Wesley Parish <wobblygong@gmail.com>
To: coff@tuhs.org
Subject: [COFF] Re: Of PL/I
Date: Thu, 4 Apr 2024 16:37:23 +1300	[thread overview]
Message-ID: <516a4019-d987-4ca4-ac62-bd6b40841f93@gmail.com> (raw)
In-Reply-To: <mSPnrAvVcsHNW0uK0VN6G4delkn7bYVln9_R9N6aTaGyoPPAMNTTAz9JD7wjHoQAR-nOd0YkzSPhfJK__VkahSwrHO_xfVeiNu2TmO7cy_8=@protonmail.com>

I learn C by reading Tanenbaum and Comer's OS books, and I cannot 
imagine how putting variable declarations anywhere other than the top of 
the function they belong to, would make sense. Unless they are global, 
in which case they go in a suitably global header file.

Wesley Parish

On 4/04/24 06:30, segaloco via COFF wrote:
> On Wednesday, April 3rd, 2024 at 9:18 AM, Paul Winalski <paul.winalski@gmail.com> wrote:
>
>> In the PL/I shops I worked at it was required that all declarations be at the beginning of the scope block.
>>   
>> -Paul W.
> I get (friendly) flack for this from some of my coworkers, context is we're a C# and Java(Type)Script shop.  They poke fun at how I write these languages like a C programmer but I don't ever hear anyone complaining about the readability of my code :)
>
> Declarations anywhere else but the top of blocks irks me, even if the language is totally fine with it.  The only exception is asm, putting all the data and bss at the bottom of assembly units instead.
>
> - Matt G.

  parent reply	other threads:[~2024-04-04  3:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 15:06 [COFF] " Dave Horsfall
2024-04-02 16:40 ` [COFF] " Clem Cole
2024-04-02 17:01   ` Charles H Sauer (he/him)
2024-04-03 16:18     ` Paul Winalski
2024-04-03 17:30       ` segaloco via COFF
2024-04-03 20:44         ` Paul Winalski
2024-04-04  3:37         ` Wesley Parish [this message]
2024-04-04 15:40           ` Paul Winalski
2024-04-04 22:53           ` Peter Pentchev
2024-04-07 23:10     ` Dave Horsfall
2024-04-07 23:25       ` Charles H Sauer (he/him)
2024-04-09 21:41         ` Stuff Received
2024-04-10  0:50           ` [COFF] SNOBOL, ICEBOL, SPITBOL, et al William H. Mitchell
2024-04-10  1:42             ` [COFF] " Dave Horsfall
2024-04-08  1:13       ` [COFF] Re: Of PL/I Paul Winalski
2024-04-02 19:25   ` Stuff Received
2024-04-02 20:31     ` William H. Mitchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516a4019-d987-4ca4-ac62-bd6b40841f93@gmail.com \
    --to=wobblygong@gmail.com \
    --cc=coff@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).