Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #129666 > unrolled thread

Need some help getting to my feet

Started byDan Purgert <dan@djph.net>
First post2018-04-24 13:39 +0000
Last post2018-04-27 00:23 -0700
Articles 20 on this page of 131 — 31 participants

Back to article view | Back to comp.lang.c


Contents

  Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-24 13:39 +0000
    Re: Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-24 16:38 +0100
      Re: Need some help getting to my feet Real Troll <real.troll@trolls.com> - 2018-04-24 13:40 -0400
    Re: Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-04-24 08:38 -0700
      [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-24 18:06 +0000
        Re: [Solved] Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-04-25 07:33 -0700
          Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-25 07:49 -0700
          Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-25 21:28 +0000
            Re: [Solved] Need some help getting to my feet antispam@math.uni.wroc.pl - 2018-04-28 14:26 +0000
              Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-28 20:25 +0000
                Re: [Solved] Need some help getting to my feet antispam@math.uni.wroc.pl - 2018-04-29 15:12 +0000
                  Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-29 16:49 +0100
                    Re: [Solved] Need some help getting to my feet antispam@math.uni.wroc.pl - 2018-04-30 15:30 +0000
                      Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-30 17:06 +0100
                      Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-30 09:12 -0700
                      Re: [Solved] Need some help getting to my feet C W Rose <cwr@seckford.org> - 2018-05-02 15:19 +0100
                        Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-02 07:54 -0700
                        Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-05-03 12:45 +0000
                        Re: [Solved] Need some help getting to my feet antispam@math.uni.wroc.pl - 2018-05-05 14:22 +0000
                          Re: [Solved] Need some help getting to my feet Steve Carroll <frelwizzen@gmail.com> - 2018-05-05 08:42 -0700
                          Re: [Solved] Need some help getting to my feet C W Rose <cwr@seckford.org> - 2018-05-07 16:34 +0100
                            Re: [Solved] Need some help getting to my feet Steve Carroll <frelwizzen@gmail.com> - 2018-05-07 09:37 -0700
                    Re: [Solved] Need some help getting to my feet Wouter Verhelst <w@uter.be> - 2018-05-04 10:19 +0200
                      Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-05-04 11:31 +0100
                  Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-29 08:53 -0700
                  Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-29 18:14 -0700
        Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-25 08:54 -0700
          Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-25 09:24 -0700
            Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-25 18:10 +0100
              Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-25 10:48 -0700
              Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) gazelle@shell.xmission.com (Kenny McCormack) - 2018-04-25 19:23 +0000
                Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) Bruce S <bruces42@hotmail.com> - 2018-04-25 16:55 -0600
                  Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-04-25 16:03 -0700
                    Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) Bruce S <bruces42@hotmail.com> - 2018-04-25 18:02 -0600
                      Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-04-25 17:14 -0700
                        Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) Bruce S <bruces42@hotmail.com> - 2018-04-26 13:31 -0600
                  Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) gazelle@shell.xmission.com (Kenny McCormack) - 2018-04-26 03:27 +0000
                  Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) Dan Purgert <dan@djph.net> - 2018-04-26 11:06 +0000
            Re: [Solved] Need some help getting to my feet 1alvinalbrecht1@gmail.com - 2018-04-25 18:41 -0700
              Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-26 07:26 -0700
          Re: [Solved] Need some help getting to my feet Spiros Bousbouras <spibou@gmail.com> - 2018-04-25 16:26 +0000
          Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-25 21:50 +0100
            Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-26 01:47 -0700
              Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-26 02:18 -0700
              Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-26 11:18 +0100
                Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-26 11:33 +0100
                  Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-26 05:26 -0700
                  Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-27 00:09 +0100
                Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-26 09:14 -0700
                  Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-26 10:26 -0700
                  Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-27 00:02 +0100
                    Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-27 02:35 -0700
                      Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-27 11:34 +0100
                        Re: [Solved] Need some help getting to my feet mark.bluemel@gmail.com - 2018-04-27 04:14 -0700
                        STDIO.H vs stdio.h (Was: [Solved] Need some help getting to my feet) gazelle@shell.xmission.com (Kenny McCormack) - 2018-04-27 13:08 +0000
                          Re: STDIO.H vs stdio.h (Was: [Solved] Need some help getting to my feet) Manfred <noname@invalid.add> - 2018-04-27 18:52 +0200
                      Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-27 07:08 -0700
                      Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 10:36 -0700
                        Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-27 19:04 +0100
                          Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 11:26 -0700
                            Re: [Solved] Need some help getting to my feet scott@slp53.sl.home (Scott Lurndal) - 2018-04-27 18:45 +0000
                        Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-30 03:43 -0700
                          Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-30 09:10 -0700
                            Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-30 23:32 -0700
              Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-26 07:33 -0700
                Re: [Solved] Need some help getting to my feet jameskuyper@verizon.net - 2018-04-26 08:38 -0700
        Re: [Solved] Need some help getting to my feet already5chosen@yahoo.com - 2018-04-27 03:30 -0700
          Re: [Solved] Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-04-27 08:41 -0700
          Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-27 17:04 +0000
            Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 11:06 -0700
              Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-27 20:15 +0000
                Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 13:47 -0700
                  Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-27 22:06 +0100
                    Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 14:51 -0700
                      Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-28 00:25 +0100
                        Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 17:23 -0700
                          Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-28 01:39 +0100
                            Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 19:22 -0700
                        Re: [Solved] Need some help getting to my feet Wouter Verhelst <w@uter.be> - 2018-05-04 10:36 +0200
                          Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-05-04 11:21 +0100
                            Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-05-04 04:03 -0700
                              Re: [Solved] Need some help getting to my feet David Brown <david.brown@hesbynett.no> - 2018-05-04 14:03 +0200
                            Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-05-04 09:19 -0700
                              Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-05-04 11:00 -0700
                                Re: [Solved] Need some help getting to my feet David Brown <david.brown@hesbynett.no> - 2018-05-05 18:39 +0200
                                  Re: [Solved] Need some help getting to my feet Steve Carroll <frelwizzen@gmail.com> - 2018-05-07 16:23 -0700
                  Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-28 12:11 +0000
                Re: [Solved] Need some help getting to my feet luser droog <luser.droog@gmail.com> - 2018-04-27 14:12 -0700
                  Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-28 12:21 +0000
              Re: [Solved] Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-05-04 13:31 +0000
                Re: [Solved] Need some help getting to my feet luser droog <luser.droog@gmail.com> - 2018-05-04 17:19 -0700
                Re: [Solved] Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-05-18 21:55 -0700
                  Re: [Solved] Need some help getting to my feet already5chosen@yahoo.com - 2018-05-21 03:26 -0700
                    Re: [Solved] Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-06-14 03:00 -0700
                      Mixing declarations and statements in C code (Was: [Solved] Need some help getting to my feet) gazelle@shell.xmission.com (Kenny McCormack) - 2018-12-26 06:43 +0000
                    Re: [Solved] Need some help getting to my feet Anton Shepelev <anton.txt@g{oogle}mail.com> - 2018-12-26 19:02 +0300
                      Re: [Solved] Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-12-31 18:01 +0000
                      Re: [Solved] Need some help getting to my feet Richard Damon <Richard@Damon-Family.org> - 2018-12-31 17:16 -0500
                        Re: [Solved] Need some help getting to my feet Bart <bc@freeuk.com> - 2018-12-31 22:44 +0000
                          Re: [Solved] Need some help getting to my feet Ike Naar <ike@iceland.freeshell.org> - 2019-01-01 19:14 +0000
                            Re: [Solved] Need some help getting to my feet rbowman <bowman@montana.com> - 2019-01-01 13:14 -0700
                              Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2019-01-01 12:49 -0800
                                Re: [Solved] Need some help getting to my feet rbowman <bowman@montana.com> - 2019-01-01 15:55 -0700
                                  Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2019-01-01 16:05 -0800
                                    Re: [Solved] Need some help getting to my feet rbowman <bowman@montana.com> - 2019-01-01 22:17 -0700
                            Re: [Solved] Need some help getting to my feet Bart <bc@freeuk.com> - 2019-01-01 20:25 +0000
            Re: [Solved] Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-05-04 11:48 +0000
    Re: Need some help getting to my feet Ed Kellett <e@kellett.im> - 2018-04-24 16:40 +0100
      Re: Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-24 11:01 -0700
    Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-24 15:50 +0000
      Re: Need some help getting to my feet Spiros Bousbouras <spibou@gmail.com> - 2018-04-24 17:21 +0000
    Re: Need some help getting to my feet Real Troll <real.troll@trolls.com> - 2018-04-24 13:20 -0400
      Re: Need some help getting to my feet Real Troll <real.troll@trolls.com> - 2018-04-24 13:30 -0400
    Re: Need some help getting to my feet Spiros Bousbouras <spibou@gmail.com> - 2018-04-24 17:42 +0000
      Re: Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-24 18:26 +0000
        Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-25 19:19 +0000
          Re: Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-25 21:30 +0000
            Re: Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-25 22:55 +0100
            Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-27 08:49 +0000
      Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-25 15:37 +0000
        Re: Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-25 09:27 -0700
          Re: Need some help getting to my feet Wouter Verhelst <w@uter.be> - 2018-04-26 13:22 +0200
            Re: Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-26 09:21 -0700
            Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-27 08:16 +0000
              Re: Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-04-27 09:36 -0700
                Re: Need some help getting to my feet Wouter Verhelst <w@uter.be> - 2018-05-04 10:41 +0200
        Re: Need some help getting to my feet Spiros Bousbouras <spibou@gmail.com> - 2018-04-28 14:27 +0000
    Re: Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-24 11:09 -0700
      Re: Need some help getting to my feet C W Rose <cwr@seckford.org> - 2018-04-25 18:59 +0100
        Re: Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-26 10:42 -0700
          Re: Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-27 00:23 -0700

Page 6 of 7 — ← Prev page 1 2 3 4 5 [6] 7  Next page →


#139329 — Re: [Solved] Need some help getting to my feet

Fromrbowman <bowman@montana.com>
Date2019-01-01 13:14 -0700
SubjectRe: [Solved] Need some help getting to my feet
Message-ID<g91vueFt63lU1@mid.individual.net>
In reply to#139327
On 01/01/2019 12:14 PM, Ike Naar wrote:
> On 2018-12-31, Bart <bc@freeuk.com> wrote:
>> There are quite a few issues with having declarations scattered
>> anywhere, such as having to locate the declaration for name (which will
>> involve scanning every line backwards to the top of a function).
>
> Often those declarations are not "scatterd anywhere", they are
> just a few lines above the point where the name is used so
> there is no need to scroll back to the top of the function.
>

At times when I'm modifying existing code I will put the new 
declarations in the block where they are used. It's a signal to future 
maintenance programmers that the block wasn't original functionality and 
was added for some reason. We use Subversion so they can easily do 'svn 
blame' to find the bug reference.

[toc] | [prev] | [next] | [standalone]


#139334 — Re: [Solved] Need some help getting to my feet

FromKeith Thompson <kst-u@mib.org>
Date2019-01-01 12:49 -0800
SubjectRe: [Solved] Need some help getting to my feet
Message-ID<lntvisksqz.fsf@kst-u.example.com>
In reply to#139329
rbowman <bowman@montana.com> writes:
> On 01/01/2019 12:14 PM, Ike Naar wrote:
>> On 2018-12-31, Bart <bc@freeuk.com> wrote:
>>> There are quite a few issues with having declarations scattered
>>> anywhere, such as having to locate the declaration for name (which will
>>> involve scanning every line backwards to the top of a function).
>>
>> Often those declarations are not "scatterd anywhere", they are
>> just a few lines above the point where the name is used so
>> there is no need to scroll back to the top of the function.
>
> At times when I'm modifying existing code I will put the new 
> declarations in the block where they are used. It's a signal to future 
> maintenance programmers that the block wasn't original functionality and 
> was added for some reason. We use Subversion so they can easily do 'svn 
> blame' to find the bug reference.

I don't see how that signals that the code was added later.  Why wouldn't
it have been written that way in the first place?

-- 
Keith Thompson (The_Other_Keith) kst@mib.org  <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#139338 — Re: [Solved] Need some help getting to my feet

Fromrbowman <bowman@montana.com>
Date2019-01-01 15:55 -0700
SubjectRe: [Solved] Need some help getting to my feet
Message-ID<g929cvFm1bU1@mid.individual.net>
In reply to#139334
On 01/01/2019 01:49 PM, Keith Thompson wrote:
> rbowman <bowman@montana.com> writes:
>> On 01/01/2019 12:14 PM, Ike Naar wrote:
>>> On 2018-12-31, Bart <bc@freeuk.com> wrote:
>>>> There are quite a few issues with having declarations scattered
>>>> anywhere, such as having to locate the declaration for name (which will
>>>> involve scanning every line backwards to the top of a function).
>>>
>>> Often those declarations are not "scatterd anywhere", they are
>>> just a few lines above the point where the name is used so
>>> there is no need to scroll back to the top of the function.
>>
>> At times when I'm modifying existing code I will put the new
>> declarations in the block where they are used. It's a signal to future
>> maintenance programmers that the block wasn't original functionality and
>> was added for some reason. We use Subversion so they can easily do 'svn
>> blame' to find the bug reference.
>
> I don't see how that signals that the code was added later.  Why wouldn't
> it have been written that way in the first place?
>

Because it wasn't :) I'll admit it is a special case but we have several 
hundred thousand lines of code going back over 20 years. The convention 
was, and still is for new functions, to declare all variables at the top 
of a function. A block with variable declarations stands out.

Obviously it would be meaningless if the stylistic convention was to 
declare variables in the blocks.

The arguments one way or the other do seem a little weak. I use Vim so 
if a variable suddenly appears # tracks it down pretty rapidly.

Again a special case and not C, but I chiefly use C++ with ESRI 
ArcObjects. It's COM based, depends heavily on smart pointers for 
interfaces, and tends to be verbose. Declaring the smart pointer at the 
point where you're going to magically say something like 'pFWS = pWS;' 
helps.

What I'm really saying is do what makes sense in the particular instance 
rather than saying 'Thou shalt declare all variables at the top.'

If I were writing the commandments there would be a 'Thou Shalt Not 
write 'float a, b, c, d, *e ,f ....'  That is as good a way to hide the 
variable you're looking for as any.

[toc] | [prev] | [next] | [standalone]


#139342 — Re: [Solved] Need some help getting to my feet

FromKeith Thompson <kst-u@mib.org>
Date2019-01-01 16:05 -0800
SubjectRe: [Solved] Need some help getting to my feet
Message-ID<lnpntfly8t.fsf@kst-u.example.com>
In reply to#139338
rbowman <bowman@montana.com> writes:
[...]
> The arguments one way or the other do seem a little weak. I use Vim so 
> if a variable suddenly appears # tracks it down pretty rapidly.
[...]

vim's "#" command jumps backward to the nearest occurrence of the
current word.

"gd" jumps directly to its declaration.  It doesn't always work
perfectly, but it's very useful when it does.

-- 
Keith Thompson (The_Other_Keith) kst@mib.org  <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#139352 — Re: [Solved] Need some help getting to my feet

Fromrbowman <bowman@montana.com>
Date2019-01-01 22:17 -0700
SubjectRe: [Solved] Need some help getting to my feet
Message-ID<g92vouF54ctU1@mid.individual.net>
In reply to#139342
On 01/01/2019 05:05 PM, Keith Thompson wrote:
> "gd" jumps directly to its declaration.  It doesn't always work
> perfectly, but it's very useful when it does.

I'll have to try that. Usually I find the variable fairly fast going 
backwards or use the square bracket to get to the head of the function 
and N to search forward if it's a heavily used variable.

There are a lot of Vim tricks and I've gotten used to a subset over the 
years. I should make a new year's resolution to learn some of the 
alternatives.

[toc] | [prev] | [next] | [standalone]


#139332 — Re: [Solved] Need some help getting to my feet

FromBart <bc@freeuk.com>
Date2019-01-01 20:25 +0000
SubjectRe: [Solved] Need some help getting to my feet
Message-ID<l1QWD.82440$Of2.66083@fx03.am4>
In reply to#139327
On 01/01/2019 19:14, Ike Naar wrote:
> On 2018-12-31, Bart <bc@freeuk.com> wrote:
>> There are quite a few issues with having declarations scattered
>> anywhere, such as having to locate the declaration for name (which will
>> involve scanning every line backwards to the top of a function).
> 
> Often those declarations are not "scatterd anywhere", they are
> just a few lines above the point where the name is used so
> there is no need to scroll back to the top of the function.

'Where the name is used' may span dozens of lines. So you need to search 
backwards from where you first see it. And a name might have 
function-wide scope so is declared at the top, but you don't know that 
(even if you glance at the top and see it there because they could be a 
more local declaration), so you still have to check every line, working 
backwards.

It can also happen there are two variables with similar names (call them 
a3947 and a3497 here); you see a3947 being used, glance at the top, and 
see a3497 being declared with no other likely variables in sight. It is 
easy to assume that that is the variable declaration you want.

(Have a look at the 219Kloc source of the amalgamated sqlite3 project, 
which mixes names declared at the top, with names declared within the 
code (not so much, just enough that you HAVE to carefully double-check) 
as well as some very confusing names plus, sometimes, the same name 
reused within different scopes in a function.)

[toc] | [prev] | [next] | [standalone]


#130143 — Re: [Solved] Need some help getting to my feet

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2018-05-04 11:48 +0000
SubjectRe: [Solved] Need some help getting to my feet
Message-ID<slrnpeoi3q.31ka.grahn+nntp@frailea.sa.invalid>
In reply to#129864
On Fri, 2018-04-27, Dan Purgert wrote:
> already5chosen@yahoo.com wrote:
>> On Tuesday, April 24, 2018 at 9:06:50 PM UTC+3, Dan Purgert wrote:
...
>>> Thanks Tim, Ed, Jorgen, and Ben. Given "get K&R" is the prevailing
>>> concensus, I'll start there (maybe I'll get lucky and it's still in that
>>> stash of programming books I kept). I think all the questions back to me
>>> reflect Tim's above, and he had the most - so just sending this one
>>> follow-up.
>>> 
>>
>> No, K&R is definitely *not* a consensus.
>
> When I responded with "solved", there were four (4) people who
> responded.  Not a single one detracted from K&R, beyond I think
> Jorgen* saying it was his least-favorite of the books he recommended.
>
> Things have definitely taken a left turn somewhere, what with all the
> extra discussions that have sprung up.

Things always do around here.

> *Sorry if I'm misattributing this. :)

I think I wrote K&R the only book I can think of.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#129670

FromEd Kellett <e@kellett.im>
Date2018-04-24 16:40 +0100
Message-ID<pbnj53$be5$1@dont-email.me>
In reply to#129666

[Multipart message — attachments visible in raw view] — view raw

On 2018-04-24 14:39, Dan Purgert wrote:
> The only thing is that tutorial mentions that it is "not a replacement
> for a good C book".  I didn't happen to notice any examples of "a good C
> book" in perusing the wiki -- would anyone be able to make some
> suggestions?

I recommend K&R2 <https://www.amazon.co.uk/dp/0131103628>. I've heard
quite a lot of people say it's outdated, and they're right, but the
errors are mostly not fundamental and the exercises are /far/ better
than any of the more modern efforts I've seen.

If you do go with K&R2, be sure to check the errata [1] and do your best
to ignore the somewhat old-fashioned (though standard at the time) uses
of implicit-int.

[1]: <http://www.iso-9899.info/2ediffs.html> (mirrored; original died)

[toc] | [prev] | [next] | [standalone]


#129677

FromSteven Petruzzellis <frelwizzen@gmail.com>
Date2018-04-24 11:01 -0700
Message-ID<2ca5260b-540f-4500-9478-aa851f90b31e@googlegroups.com>
In reply to#129670
On Tuesday, April 24, 2018 at 8:40:27 AM UTC-7, Ed Kellett wrote:
> On 2018-04-24 14:39, Dan Purgert wrote:
> > The only thing is that tutorial mentions that it is "not a replacement
> > for a good C book".  I didn't happen to notice any examples of "a good C
> > book" in perusing the wiki -- would anyone be able to make some
> > suggestions?
> 
> I recommend K&R2 <https://www.amazon.co.uk/dp/0131103628>. I've heard
> quite a lot of people say it's outdated, and they're right, but the
> errors are mostly not fundamental and the exercises are /far/ better
> than any of the more modern efforts I've seen.
> 
> If you do go with K&R2, be sure to check the errata [1] and do your best
> to ignore the somewhat old-fashioned (though standard at the time) uses
> of implicit-int.
> 
> [1]: <http://www.iso-9899.info/2ediffs.html> (mirrored; original died)



No one here has ever read my program, much less found a bug; still, in the dark recesses of my brain, I'm thinking, "My mistakes will come to haunt me". 

Most people in this group do application development either as recreation or as a profession, so I think it unlikely Donny Karcie think of writing macros to be "witch craft". 

If Rhonda Bass calls getting his ass kicked hard for over a decade by everyone (and completely killing his reputation and any reason for people to give credence to anything he has to say) successful 'trolling', then sure... he is a great troll. I can not personally go along with that definition, I use another term. I call that person an utter imbecile. 

To my way of thinking, taking effort getting informed isn't a waste. Declaring you know more than everyone else and trying to convince people that it is true, as Rhonda Bass tries to do? That is a waste ;) 

I have known dogs who argue better than Rhonda Bass does. 

--
My Snoring Solution
http://tinyurl.com/kmqe66h
https://youtu.be/r7wys2JvBD0
Jonas Eklundh Communication

[toc] | [prev] | [next] | [standalone]


#129671

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2018-04-24 15:50 +0000
Message-ID<slrnpdukia.31ka.grahn+nntp@frailea.sa.invalid>
In reply to#129666
On Tue, 2018-04-24, Dan Purgert wrote:
> Hope this isn't too far off the mark for this group -- long story short,
> I'm trying to get back into C programming after not having touched it in
> nearly a decade (since university -- and barely passing, as I recall).

A good idea, but what do you want to do with it?  Unix, Windows,
embedded; to get a job or as a hobby?

> Most of what I'm getting from Google is some variant of "use C++"
> (blogs, random "articles" that're probably trying to sell something,
> etc.).

Not terrible advise, IMHO.

> I did come across the clc-wiki.net "C Tutorial" the other night
> as a potential source to get my wits about me.
>
> The only thing is that tutorial mentions that it is "not a replacement
> for a good C book".  I didn't happen to notice any examples of "a good C
> book" in perusing the wiki -- would anyone be able to make some
> suggestions?

I'd be interested to hear -- I haven't read a book on C since the
mid-1990s.  I've worked with young people recently, but they learned
by osmosis: learning from others, on the job, combined with looking
things up in reference works.

K&R is still good, I suppose, if you fill in with C99 material from
elsewhere.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#129673

FromSpiros Bousbouras <spibou@gmail.com>
Date2018-04-24 17:21 +0000
Message-ID<SIJDC.13761$ta2.3793@fx03.am4>
In reply to#129671
On 24 Apr 2018 15:50:34 GMT
Jorgen Grahn <grahn+nntp@snipabacken.se> wrote:
> On Tue, 2018-04-24, Dan Purgert wrote:
> > Most of what I'm getting from Google is some variant of "use C++"
> > (blogs, random "articles" that're probably trying to sell something,
> > etc.).
> 
> Not terrible advise, IMHO.

Entirely arbitrary one.

[toc] | [prev] | [next] | [standalone]


#129672

FromReal Troll <real.troll@trolls.com>
Date2018-04-24 13:20 -0400
Message-ID<pbnop5$1odt$1@gioia.aioe.org>
In reply to#129666
On 24/04/2018 14:39, Dan Purgert wrote:
>
> The only thing is that tutorial mentions that it is "not a replacement
> for a good C book".  I didn't happen to notice any examples of "a good C
> book" in perusing the wiki -- would anyone be able to make some
> suggestions?

You won't find a "a good C book" because nobody writes them these days.  
C is dead and people have moved on to something like C# which is 
developing very fast by the user community but controlled by Microsoft 
as to what goes into the final code.

C is developed by nobody but you'll always find somebody doing it 
privately as a hobby.  This is no good for people as you want something 
that has a vision and target as to where it wants to go.

C++ is still developed but that too has stalled.  Ask  Lynn McGuire 
<lynnmcguire5@gmail.com> who is keeping an eye on such things.

Go for C# as there are many new books in the pipeline and you can 
download Visual Studio Community edition for free and start programming 
in C#.

Good luck.


[toc] | [prev] | [next] | [standalone]


#129674

FromReal Troll <real.troll@trolls.com>
Date2018-04-24 13:30 -0400
Message-ID<pbnp5q$1p1d$1@gioia.aioe.org>
In reply to#129672
See this recent "Visual Studio Roadmap" from Microsoft:

<https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2018-roadmap>

Microsoft is very active developing the products which the Open Source 
Community should be doing but failed to do so.  So C# is the way to go.



On 24/04/2018 18:20, Real Troll wrote:
> On 24/04/2018 14:39, Dan Purgert wrote:
>>
>> The only thing is that tutorial mentions that it is "not a replacement
>> for a good C book".  I didn't happen to notice any examples of "a good C
>> book" in perusing the wiki -- would anyone be able to make some
>> suggestions?
>
> You won't find a "a good C book" because nobody writes them these 
> days.  C is dead and people have moved on to something like C# which 
> is developing very fast by the user community but controlled by 
> Microsoft as to what goes into the final code.
>
> C is developed by nobody but you'll always find somebody doing it 
> privately as a hobby.  This is no good for people as you want 
> something that has a vision and target as to where it wants to go.
>
> C++ is still developed but that too has stalled.  Ask  Lynn McGuire 
> <lynnmcguire5@gmail.com> who is keeping an eye on such things.
>
> Go for C# as there are many new books in the pipeline and you can 
> download Visual Studio Community edition for free and start 
> programming in C#.
>
> Good luck.
>
>
>

[toc] | [prev] | [next] | [standalone]


#129676

FromSpiros Bousbouras <spibou@gmail.com>
Date2018-04-24 17:42 +0000
Message-ID<I3S7fA3eVIPOrxDyMrQ6cZeSt95Xt@bongo-ra.co>
In reply to#129666
On Tue, 24 Apr 2018 13:39:11 -0000 (UTC)
Dan Purgert <dan@djph.net> wrote:
> Hope this isn't too far off the mark for this group -- long story short,
> I'm trying to get back into C programming after not having touched it in
> nearly a decade (since university -- and barely passing, as I recall).

Was there something in particular you found hard to master ? What material
were you using to learn from ?

[...]

> The only thing is that tutorial mentions that it is "not a replacement
> for a good C book".  I didn't happen to notice any examples of "a good C
> book" in perusing the wiki -- would anyone be able to make some
> suggestions?

It's been many years since I used an introductory C book. When I started
on C I was impatient so instead of picking one good book and reading it
"properly" , I interchanged between 3 books. One was K&R 2nd edition ,
another was a current at the time edition of one of the Deitel books and
the 3rd I think was a C book by Stephen Prata. All 3 were satisfactory
although for my hurried reading the K&R one was likely the least
appropriate and the Deitel book the most appropriate because it goes
slowly over details.

The Deitel books have a huge number of exercises of varying levels of
difficulty. They also tend to have an ongoing programming project where as
you learn more about the language in every chapter , you extend the project.

They are meant to be accessible even to people with 0 programming experience
so for someone who has previous experience , parts may be slow going or
feel too basic.

They go beyond standard C. The edition I used also had an introduction to the
Allegro gaming library. As long as one is aware what is standard C and what
isn't , this isn't a bad thing.

One bad thing is that they have the attitude that there are certain "default"
options for languages to learn after C ; these options include C++ and
perhaps also Java. So the edition I used also had an introduction to C++
(which I didn't read) and later editions I think also have an introduction to
Java.

The attitude that C++ is the obvious next step after C is one that often
appears on this group too and I think it's an unfortunate one because it's
entirely arbitrary. C++ is simply one of many languages one can learn after C
and whether it's the best option depends on one's reason for starting
programming and what their next steps are going to be.

-- 
vim is a communist text editor ; it has a command  :marks

[toc] | [prev] | [next] | [standalone]


#129680

FromDan Purgert <dan@djph.net>
Date2018-04-24 18:26 +0000
Message-ID<slrnpdutmt.jmn.dan@xps-linux.djph.net>
In reply to#129676
Spiros Bousbouras wrote:
> On Tue, 24 Apr 2018 13:39:11 -0000 (UTC)
> Dan Purgert <dan@djph.net> wrote:
>> Hope this isn't too far off the mark for this group -- long story short,
>> I'm trying to get back into C programming after not having touched it in
>> nearly a decade (since university -- and barely passing, as I recall).
>
> Was there something in particular you found hard to master ? What material
> were you using to learn from ?

Honestly, I don't recall the "exact" issues I had with it (it's been ~10
years now).  But, as it turns out, right on top of the pile of "these
might come in handy" programming books was an old course guide.  

Prereq for the (sophomore fall) C class was the previous year's Java
classes, or a different set of 100-level courses, that are unfortunately
not in the book.  I can only assume then that the move to Java for
Freshmen-level CS courses replaced other possibly C courses.  

I'm gonna assume my issues were mainly due to trying to switch gears
from Java / Object Oriented to C / Procedural programming, and it not
going smoothly at that time.

No C books though - must've sold them to a friend or something :(.  Ah
well, Amazon is pretty quick on shipping.

-- 
|_|O|_| Registered Linux user #585947
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5  4AEE 8E11 DDF3 1279 A281

[toc] | [prev] | [next] | [standalone]


#129739

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2018-04-25 19:19 +0000
Message-ID<slrnpe1l61.31ka.grahn+nntp@frailea.sa.invalid>
In reply to#129680
On Tue, 2018-04-24, Dan Purgert wrote:
...
> Prereq for the (sophomore fall) C class was the previous year's Java
> classes, or a different set of 100-level courses, that are unfortunately
> not in the book.  I can only assume then that the move to Java for
> Freshmen-level CS courses replaced other possibly C courses.  
>
> I'm gonna assume my issues were mainly due to trying to switch gears
> from Java / Object Oriented to C / Procedural programming, and it not
> going smoothly at that time.

Not unlikely. Java and C look similar, but the fundamentals are very
different, and how you work with the language is very different.  You
can easily miss the point during a few hurried weeks of classes.

Java didn't exist when I went to university, but it took a really
heavy lab exercise to teach me to use C. (Most earlier classes had
used a functional language, which was fundamentally different in yet
another way.)

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#129751

FromDan Purgert <dan@djph.net>
Date2018-04-25 21:30 +0000
Message-ID<slrnpe1ssh.jmn.dan@xps-linux.djph.net>
In reply to#129739
Jorgen Grahn wrote:
> On Tue, 2018-04-24, Dan Purgert wrote:
> ...
>> Prereq for the (sophomore fall) C class was the previous year's Java
>> classes, or a different set of 100-level courses, that are unfortunately
>> not in the book.  I can only assume then that the move to Java for
>> Freshmen-level CS courses replaced other possibly C courses.  
>>
>> I'm gonna assume my issues were mainly due to trying to switch gears
>> from Java / Object Oriented to C / Procedural programming, and it not
>> going smoothly at that time.
>
> Not unlikely. Java and C look similar, but the fundamentals are very
> different, and how you work with the language is very different.  You
> can easily miss the point during a few hurried weeks of classes.

I'm fairly certain the point of Java is to make one hate the entire
concept of convincing the machine to do anything.  Or maybe drive one to
drink heavily.

I have no idea if it's a good language, what with those classes I had to
attend in college pretty much destroying the language for me.


-- 
|_|O|_| Registered Linux user #585947
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5  4AEE 8E11 DDF3 1279 A281

[toc] | [prev] | [next] | [standalone]


#129752

Frombartc <bc@freeuk.com>
Date2018-04-25 22:55 +0100
Message-ID<gP6EC.16463$tw.93@fx42.am4>
In reply to#129751
On 25/04/2018 22:30, Dan Purgert wrote:
> Jorgen Grahn wrote:
>> On Tue, 2018-04-24, Dan Purgert wrote:
>> ...
>>> Prereq for the (sophomore fall) C class was the previous year's Java
>>> classes, or a different set of 100-level courses, that are unfortunately
>>> not in the book.  I can only assume then that the move to Java for
>>> Freshmen-level CS courses replaced other possibly C courses.
>>>
>>> I'm gonna assume my issues were mainly due to trying to switch gears
>>> from Java / Object Oriented to C / Procedural programming, and it not
>>> going smoothly at that time.
>>
>> Not unlikely. Java and C look similar, but the fundamentals are very
>> different, and how you work with the language is very different.  You
>> can easily miss the point during a few hurried weeks of classes.
> 
> I'm fairly certain the point of Java is to make one hate the entire
> concept of convincing the machine to do anything.  Or maybe drive one to
> drink heavily.
> 
> I have no idea if it's a good language, what with those classes I had to
> attend in college pretty much destroying the language for me.

About 20 years ago I downloaded Java using a dial-up modem. It was 28MB, 
divided into 20 downloads of 1.4MB each, corresponding to 20 floppy 
disks. It took ages.

Then when I wanted to actually use it, it turned out I still needed 
documentation, another 20MB download. Which is where I gave up.

I think you need Java to program Android apps. If that's the case, then 
I guess I'm not going to be writing any such apps (but there's a dozen 
extra hoops as well to jump through so it's never going to happen).

It's one of those languages suitable for other people to use.

-- 
bartc

[toc] | [prev] | [next] | [standalone]


#129846

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2018-04-27 08:49 +0000
Message-ID<slrnpe5p11.31ka.grahn+nntp@frailea.sa.invalid>
In reply to#129751
On Wed, 2018-04-25, Dan Purgert wrote:
> Jorgen Grahn wrote:
>> On Tue, 2018-04-24, Dan Purgert wrote:
>> ...
>>> Prereq for the (sophomore fall) C class was the previous year's Java
>>> classes, or a different set of 100-level courses, that are unfortunately
>>> not in the book.  I can only assume then that the move to Java for
>>> Freshmen-level CS courses replaced other possibly C courses.  
>>>
>>> I'm gonna assume my issues were mainly due to trying to switch gears
>>> from Java / Object Oriented to C / Procedural programming, and it not
>>> going smoothly at that time.
>>
>> Not unlikely. Java and C look similar, but the fundamentals are very
>> different, and how you work with the language is very different.  You
>> can easily miss the point during a few hurried weeks of classes.
>
> I'm fairly certain the point of Java is to make one hate the entire
> concept of convincing the machine to do anything.  Or maybe drive one to
> drink heavily.
>
> I have no idea if it's a good language, what with those classes I had to
> attend in college pretty much destroying the language for me.

I suspect Java isn't very good, but my point was just that it's
/different/ from C.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#129719

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2018-04-25 15:37 +0000
Message-ID<slrnpe1860.31ka.grahn+nntp@frailea.sa.invalid>
In reply to#129676
On Tue, 2018-04-24, Spiros Bousbouras wrote:
...
> The attitude that C++ is the obvious next step after C is one that often
> appears on this group too

Like in my reply elsewhere in the thread (although I think I wrote
it's "not terrible advise", and wouldn't have mentioned it at all,
if the OP hadn't brought it up).

> and I think it's an unfortunate one because it's
> entirely arbitrary. C++ is simply one of many languages one can learn after C
> and whether it's the best option depends on one's reason for starting
> programming and what their next steps are going to be.

It's not arbitrary; C++ keeps most of what's interesting about C:
- the APIs
- the object model (things can live on the stack or in the heap)
- the static typing
- the toolchains

There are many useful languages, but no others have that much in
common with C.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


Page 6 of 7 — ← Prev page 1 2 3 4 5 [6] 7  Next page →

Back to top | Article view | comp.lang.c


csiph-web