Click here to Skip to main content
15,889,281 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Been there done that... Pin
trønderen5-Oct-20 3:13
trønderen5-Oct-20 3:13 
GeneralRe: Been there done that... Pin
Jörgen Andersson5-Oct-20 2:02
professionalJörgen Andersson5-Oct-20 2:02 
GeneralRe: Been there done that... Pin
Mircea Neacsu5-Oct-20 1:04
Mircea Neacsu5-Oct-20 1:04 
GeneralRe: Been there done that... Pin
Sander Rossel5-Oct-20 1:33
professionalSander Rossel5-Oct-20 1:33 
GeneralRe: Been there done that... Pin
Mircea Neacsu5-Oct-20 2:01
Mircea Neacsu5-Oct-20 2:01 
GeneralRe: Been there done that... Pin
Jörgen Andersson5-Oct-20 2:06
professionalJörgen Andersson5-Oct-20 2:06 
GeneralRe: Been there done that... Pin
Mircea Neacsu5-Oct-20 2:33
Mircea Neacsu5-Oct-20 2:33 
GeneralRe: Been there done that... Pin
trønderen5-Oct-20 3:12
trønderen5-Oct-20 3:12 
To me, that is a matter of software design philosophy.
A date is not a float, it is a date. So it should not be stored as a float but as a date.

I also shiver at old C, where you coded an infinite loop as "while (1) ...". A logical value is not an integer! And weekdays are Monday, Tuesday, ... Sunday, not integers 0..6 (or 1..7).

Some tools force you to handle data values as being of a different type/class than they are from a semantic point of view. We'll just have to accept that - and wrap it up so that you see as little as possible of that misleading, "wrong" type. (Even in K&R C, you could #define true and false.) If e.g. a database system does not provide a proper Date value, you may be forced to convert it to some acceptable representation when written, and back when read. Your application code should never see that, but treat it as a date type/class.

Couldn't your database write/read wrappers convert dates to/from floats? There is a principal difference between measuring and counting. Would you store NumberOfApples as a float, too? Days are discrete, countable units. They should be treated as countable values, not as measurement values. They should be integers (whether a day count from a given zero, or a multi-field year-month-day value), or, if this is not feasible, as a closed set of string values (e.g. as an ISO 8601 string). But not as a measurement value!
GeneralRe: Been there done that... Pin
Mircea Neacsu5-Oct-20 3:41
Mircea Neacsu5-Oct-20 3:41 
GeneralRe: Been there done that... Pin
Jörgen Andersson5-Oct-20 3:45
professionalJörgen Andersson5-Oct-20 3:45 
GeneralRe: Been there done that... Pin
Jörgen Andersson5-Oct-20 3:43
professionalJörgen Andersson5-Oct-20 3:43 
GeneralRe: Been there done that... Pin
obermd5-Oct-20 3:38
obermd5-Oct-20 3:38 
GeneralRe: Been there done that... Pin
Sander Rossel5-Oct-20 4:05
professionalSander Rossel5-Oct-20 4:05 
GeneralWeekend Thought of the day Pin
Sandeep Mewara3-Oct-20 21:48
mveSandeep Mewara3-Oct-20 21:48 
GeneralRe: Weekend Thought of the day Pin
Richard Andrew x644-Oct-20 2:21
professionalRichard Andrew x644-Oct-20 2:21 
GeneralRe: Weekend Thought of the day Pin
kmoorevs4-Oct-20 7:18
kmoorevs4-Oct-20 7:18 
GeneralRe: Weekend Thought of the day Pin
Richard Andrew x644-Oct-20 9:12
professionalRichard Andrew x644-Oct-20 9:12 
GeneralRe: Weekend Thought of the day Pin
DRHuff4-Oct-20 4:31
DRHuff4-Oct-20 4:31 
GeneralRe: Weekend Thought of the day Pin
Amarnath S4-Oct-20 21:34
professionalAmarnath S4-Oct-20 21:34 
GeneralChanging EULAs - who bothers? Pin
dandy723-Oct-20 3:08
dandy723-Oct-20 3:08 
GeneralRe: Changing EULAs - who bothers? Pin
Gerry Schmitz3-Oct-20 3:38
mveGerry Schmitz3-Oct-20 3:38 
GeneralRe: Changing EULAs - who bothers? Pin
dandy723-Oct-20 3:57
dandy723-Oct-20 3:57 
GeneralRe: Changing EULAs - who bothers? Pin
Gerry Schmitz3-Oct-20 6:53
mveGerry Schmitz3-Oct-20 6:53 
GeneralRe: Changing EULAs - who bothers? Pin
dandy723-Oct-20 8:35
dandy723-Oct-20 8:35 
GeneralRe: Changing EULAs - who bothers? Pin
TheGreatAndPowerfulOz4-Oct-20 8:24
TheGreatAndPowerfulOz4-Oct-20 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.