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


Groups > comp.lang.java.programmer > #39243

Re: How bad i are my coding skills?

Newsgroups comp.lang.java.programmer
Date 2019-12-30 05:13 -0800
References <28133f49-0465-447d-9a34-062fb8c82ea1@googlegroups.com> <qu54ek$v56$1@dont-email.me> <5d7de6a8-eb4a-462c-989a-1c27a714aa03@googlegroups.com> <qubgn5$11v8$1@gioia.aioe.org>
Message-ID <cf27eafa-a408-4cd5-9159-efdbaab9e7eb@googlegroups.com> (permalink)
Subject Re: How bad i are my coding skills?
From chad altenburg <cdalten@gmail.com>

Show all headers | View raw


On Sunday, December 29, 2019 at 4:34:57 PM UTC-8, Arne Vajhøj wrote:
> On 12/27/2019 11:13 AM, Eric Douglas wrote:
> > not sure what 'off by one' issues are
> 
> Usually this means code like a[i+2] that should have been either
> a[i+1] or a[i+3].
> 
> Wikipedia has some slightly different examples 
> https://en.wikipedia.org/wiki/Off-by-one_error
> but I associate it with the array index calculation being one off.
> 
> BTW, such an error happening is actually revealing a code smell. Data
> structures and code logic should be written so that it is very difficult
> to make such an error.
> 

And I don't know of any sane and rational method to go about doing it. It goes like this. Internally, the data has the format like

[StartHour, StartMinute, StartAmOrPm, EndHour, EndMinute, EndAmOrPm]

Now what happens say I want to add a flag to switch this data because I want to take the day off. Yes, I can clear the data. But I would still need an additional piece of data added to this format so when if I traverse of this list, the app knows to do whatever when it sees the "day off" flag.

Likewise, what happens if I want to take a day off, and still get paid? Maybe I want to do this because I want to use some paid personal time (PTO) off before the end of the year. This is because my PTO might not carry over to the following year.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2019-12-26 14:46 -0800
  Re: How bad i are my coding skills? Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-12-27 09:28 -0500
    Re: How bad i are my coding skills? Eric Douglas <e.d.programmer@gmail.com> - 2019-12-27 08:13 -0800
      Re: How bad i are my coding skills? Arne Vajhøj <arne@vajhoej.dk> - 2019-12-27 13:11 -0500
      Re: How bad i are my coding skills? Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-12-27 13:33 -0500
        Re: How bad i are my coding skills? Arne Vajhøj <arne@vajhoej.dk> - 2019-12-27 13:47 -0500
          Re: How bad i are my coding skills? Eric Douglas <e.d.programmer@gmail.com> - 2019-12-27 11:14 -0800
            Re: How bad i are my coding skills? Arne Vajhøj <arne@vajhoej.dk> - 2019-12-27 16:09 -0500
              Re: How bad i are my coding skills? Martin Gregorie <martin@mydomain.invalid> - 2019-12-27 23:10 +0000
                Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2019-12-27 16:58 -0800
      Re: How bad i are my coding skills? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2019-12-30 01:27 +0100
      Re: How bad i are my coding skills? Arne Vajhøj <arne@vajhoej.dk> - 2019-12-29 19:34 -0500
        Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2019-12-30 05:13 -0800
          Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2019-12-30 05:46 -0800
            Re: How bad i are my coding skills? Martin Gregorie <martin@mydomain.invalid> - 2019-12-30 14:48 +0000
            Re: How bad i are my coding skills? Arne Vajhøj <arne@vajhoej.dk> - 2019-12-30 15:11 -0500
              Re: How bad i are my coding skills? Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-12-30 15:55 -0500
                Re: How bad i are my coding skills? Arne Vajhøj <arne@vajhoej.dk> - 2019-12-30 18:51 -0500
                Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2019-12-31 05:10 -0800
            Re: How bad i are my coding skills? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-01-02 04:20 +0100
          Re: How bad i are my coding skills? Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-12-30 08:51 -0500
            Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2019-12-30 10:25 -0800
  Re: How bad i are my coding skills? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2019-12-30 01:25 +0100
    Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2019-12-30 05:07 -0800
      Re: How bad i are my coding skills? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-01-02 04:27 +0100
        Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2020-01-02 05:46 -0800
          Re: How bad i are my coding skills? Eric Sosman <esosman@comcast-dot-net.invalid> - 2020-01-02 10:43 -0500
            Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2020-01-03 04:54 -0800
              Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2020-01-03 05:00 -0800
                Re: How bad i are my coding skills? Eric Sosman <esosman@comcast-dot-net.invalid> - 2020-01-03 11:05 -0500
                Re: How bad i are my coding skills? chad altenburg <cdalten@gmail.com> - 2020-01-03 13:54 -0800
              Re: How bad i are my coding skills? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-01-05 18:00 +0100

csiph-web