3 ms·
Cool project! Thank you for sharing, and for using .txt as data format. I think it's by far the most resilient and compatible, and the least user-surprising dat
by forgotmypw17 6y ago
Cool project! Thank you for sharing, and for using .txt as data format. I think it's by far the most resilient and compatible, and the least user-surprising data format we have today.
I have a question about this example:
2018-03-24
First day at my new job
8:30-17:00
-45m Lunch break
Are you in this case creating two entries, one of 8.5 hours and -45 minutes, for that date, or are you applying that -45 to the previous entry?
My other comment is to strongly advise you against using whitespace for syntax, because that makes copy and paste operations much more problem-prone.
- jotaen 6y agoThanks for your feedback, much appreciated. The current model is that every record (i.e. that entire block) can have multiple entries that are added up regardless of order. So the resulting total is the just the sum of the individual time values. (Here: `8h30m + (-45m) = 7h45m`) Regarding whitespace: are you referring to some whitespace specifically (like the indentation) or to whitespace in general? Do you have a concrete idea in mind how you would change the syntax? Curious on your thoughts!
- forgotmypw17 6y agoThe way I would do it is to parse the blocks sequentially, and ignore the indentation. Maybe you are doing that already?
- jotaen 6y agoProblem is (unless I’m misunderstanding you) that the entries must be unanimously distinguishable from the summary text. Consider: 2018-03-27 Tried to do this and that, but had to stop after 30m because of a phone call. 30m Some activity The fourth line could not be told apart from an entry (the fifth line) without indentation or some other special character.
- forgotmypw17 6y agoThat's what I'm talking about. Now, imagine you take that block and copy it from one text file and into another. The meaning is now completely lost. I think that using lines as separators is a better idea. However, it is true that it requires care and brevity when writing your item lines.