Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #39257
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2019-12-31 05:10 -0800 |
| References | (4 earlier) <cf27eafa-a408-4cd5-9159-efdbaab9e7eb@googlegroups.com> <10688a10-1ff9-478d-a9f0-0abcf4726077@googlegroups.com> <qudlkn$11rf$1@gioia.aioe.org> <qudo7r$a2q$1@dont-email.me> <que2hc$t9l$1@gioia.aioe.org> |
| Message-ID | <831faf8c-e30c-4e17-8a6c-6bc81b23fc2f@googlegroups.com> (permalink) |
| Subject | Re: How bad i are my coding skills? |
| From | chad altenburg <cdalten@gmail.com> |
On Monday, December 30, 2019 at 3:51:18 PM UTC-8, Arne Vajhøj wrote: > On 12/30/2019 3:55 PM, Eric Sosman wrote: > > On 12/30/2019 3:11 PM, Arne Vajhøj wrote: > >> On 12/30/2019 8:46 AM, chad altenburg wrote: > >>> And here is the other winner when dealing with memory leaks and off > >>> by one errors. I use the Google Calendar API to check for the current > >>> day. The days representing like Calendar.SUNDAY, Calendar.MONDAY, … > >>> > >>> The problem is that is if Google changes integer value for something > >>> like Calendar.SUNDAY on the next API update, then some of my code > >>> breaks because the value will be off by at least one. Do you have any > >>> ideas how I can prevent something like this from happening? > >> > >> Don't worry about it. > >> > >> Calendar.Xxxday are static final fields. And due to how they are > >> treated in Java, then there is no way Oracle/JCP will ever change the > >> values. > > > > ... and even if they did, a simple recompile would fix it without > > even one character's worth of changes to the source. (Provided you've > > followed Martin Gregorie's advice, of course.) > > It would break binary compatibility for no good reason. That is a no no > in my book. > > Recompile may not fix Chad's problem though. The description is not that > clear but if the problem is related to using week days as array index, > the recompile may not fix the problem. If that is indeed the case then > using week days as keys in a Map would be safer. > I could show you the GitHub link that has *all* the code for the engineering wonder. But I suspect that like most people, you would gasp in horror at the complexity and then criticize the parts of the code that were either auto generated by my IDE or the code that was lifted from the Android docs because the code represents "a best practice".
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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