Skip to main content
58 votes
Accepted

How much time should you spend planning a commit before writing code?

Firstly: when coding for a living, especially as a junior in a team, typically not much design work is needed. This is because you'll be working in an existing code base. Chances are, you'll often be ...
tjalling's user avatar
  • 684
45 votes

How much time should you spend planning a commit before writing code?

I would like to change your perspective for a moment. Commits are not something you plan. Commits, especially in the early stages of figuring out a problem, are little more than save-points along a ...
Greg Burghardt's user avatar
29 votes
Accepted

Why doesn't Git set the file time?

It's because it would break every build system like make, maven, gradle, etc. that depends on file modification times to know what needs to be rebuilt. If a git checkout or a git pull pulls in ...
Karl Bielefeldt's user avatar
28 votes

How much time should you spend planning a commit before writing code?

You mention live stream YouTubers as a standard to live up to, as if they would make up stuff on the spot, type it in and are done. That is not how it goes. They planned and practiced too beforehand ...
Martin Maat's user avatar
  • 18.4k
12 votes

What is the best practice for saving TimeZones in the database?

You want to store something that doesn't change all the time (or twice a year). The time zone database https://en.wikipedia.org/wiki/List_of_tz_database_time_zones is exactly the right thing. So you ...
gnasher729's user avatar
  • 45.9k
11 votes
Accepted

Is Program Running Time Affected by File Size?

In theory, yes file size can affect the running time of a program. However, the affect it has is probably so insignificant you should never have to worry about it. There are a few reasons for this: ...
Jesse Good's user avatar
11 votes

Why do many programming languages and applications use integer instead of floating point to represent time?

The core idea behind floating point numbers is that you have some number of bits for the mantissa, and then some number of bits to tell where the decimal point is, and of course a bit for the sign. ...
Theraot's user avatar
  • 9,151
10 votes
Accepted

How to store sequential timespans in a database?

Not storing the end date and using the start date of a different record/row make each individual row hard to reason about. Querying gets harder. SQL Server 2012 introduced LEAD and LAG to help with ...
Flater's user avatar
  • 52.5k
10 votes

How much time should you spend planning a commit before writing code?

At the moment I'm spending more time planning out a commit than actually writing code No one cares how you spent your time. They care about what you made (if you're lucky). This is making me unhappy,...
candied_orange's user avatar
9 votes
Accepted

Data from devices with unreliable clocks

There's actually quite a bit you can do to recover something close to the actual time of most of your events. Android gives you a few useful tools to work with, notably broadcast intents sent when ...
Blrfl's user avatar
  • 20.4k
9 votes

Are group time estimates standard?

There are only problems here. What you describe is not group estimation. There are consensus-based estimation techniques - Wideband Delphi was developed in the 1970s and Planning Poker rose to ...
Thomas Owens's user avatar
  • 83.3k
8 votes

Distinction between "timestamp" and "datetime"

No. Usually a datetime is data type or data structure, as a means of storing moments in memory/disk. A timestamp is an individual record that indicates an instant in time that something took place, ...
whatsisname's user avatar
  • 27.6k
8 votes
Accepted

Fastest way to generate (machine wide) unique 64 bit timestamps on Windows

You mentioned in the comments you're OK to compress the timestamp to 52 bits. Few other people mentioned you can negotiate smaller process Ids. I'm expanding on these ideas with one way to generate ...
nokola's user avatar
  • 196
8 votes

How do I determine how long a refactoring effort will take?

As with any project the only truthful time estimate is far more about how much patience you have with the problem then it is about its difficulty. Think about it this way. If I only gave you a day to ...
candied_orange's user avatar
7 votes

How much time should you spend planning a commit before writing code?

If I don't do this amount of planning, I just end up writing code that will have to be undone before I commit, and this just messes up my project, because don't like wasting any code I've already ...
Ray's user avatar
  • 209
7 votes

How much time should you spend planning a commit before writing code?

You're discovering the difference between "programming" and "development". Developing an application is so much more than churning out some code. All the different little units of ...
James D's user avatar
  • 413
6 votes

Appropriate way to handle timezone for embedded/IoT devices

IGNORE THE TIMEZONE OF THE DEVICE Report your answers in UTC. In almost ANY situation where you are displaying or reporting on time based data, the timezone of interest will NOT be the timezone ...
Lewis Pringle's user avatar
6 votes

Using Gregorian Year vs using Mean Tropical Year

If you are going to write a generic tool conversion which might be used in different contexts, and you don't know the precise use cases for which the tool will be used (or you expect different groups ...
Doc Brown's user avatar
  • 209k
6 votes

High-cardinality UUID: how/where to store?

Ten years ago I would have used a integer value for the timeseries id in the database, and a separate table to map the UUID as a string (or other public id) to the internal id. Now we have UUID types ...
Pete Kirkham's user avatar
  • 1,888
6 votes

Are group time estimates standard?

Our team assigns time estimates to tasks (not stories) in a group setting, [..] [..] so one of us will give an estimate This is contradictory. If one person gives an estimate, it's not done "in ...
Flater's user avatar
  • 52.5k
5 votes
Accepted

Should I inject a Thread.sleeper as a dependency to make unit test easer?

Is this a reasonable/good practice? Absolutely. Justification: time is an input. If you don't consider time an input value, think about it until you do - it is an important concept John ...
VoiceOfUnreason's user avatar
5 votes

What is time complexity of update in binary heap?

I'm going to disagree a bit with Scara95. With out context of your answer this seems like whether or not your answer is wrong could possibly be a matter of pedantry. Technically, yes, its not O(N) + ...
Krupip's user avatar
  • 1,300
5 votes

Why do many programming languages and applications use integer instead of floating point to represent time?

Time is an infinite sort of thing. You can go indefinitely into the past, eventually hit the big bang. And maybe you could stop there, but nothing is stopping you. Likewise you can go indefinitely ...
Telastyn's user avatar
  • 109k
5 votes
Accepted

Can Time be a Primary Actor in the Hexagonal Architecture?

Let us look into Alistair Cockburn's description of the Hexagonal architecture: A ‘’primary actor’’ is an actor that drives the application (takes it out of quiescent state to perform one of its ...
Doc Brown's user avatar
  • 209k
5 votes

When does a *fixed delay* make sense?

Yes. To delay to give time for completion prior to checking. Yes. To animate, because humans see in the order of ~80hz. Yes. To throttle, running at 100% isn't always the right option. No. There is ...
Kain0_0's user avatar
  • 16.2k
5 votes

How much time should you spend planning a commit before writing code?

I did a test. I wrote an average-sized line of code with a timer running. It took about 7 seconds. Let's do some math. If my working time is 37.5 hours per week, 47 non-vacation weeks per year, that ...
juhist's user avatar
  • 2,579
4 votes
Accepted

Is a procedure's complexity a function of how many nested loops it has?

Big O notation is used to get an idea for what will happen to execution time as number of items to process increases. Loops are the easiest example of how something increases multiplicatively. Simply ...
Ryathal's user avatar
  • 13.4k
4 votes

Should I inject a Thread.sleeper as a dependency to make unit test easer?

I will say this over and over: Relying on timing causes slow and fragile tests If you need to ensure a task has completed, then you need some other synchronization mechanism than simply relying on ...
Berin Loritsch's user avatar
4 votes
Accepted

How do I know a product is in the "will_expire" state?

This is the classic age problem. You want to know how old your customers are. Should you check every customer every day to see if it's their birthday? No. Don't even store anyone's age. Store their ...
candied_orange's user avatar
4 votes
Accepted

How do you manage date-ranges, when datatypes include time?

If possible, do not to use a data type with a higher precision than "one day" if you do not need a better precision. If your database, or your programming language only provides you with a data type ...
Doc Brown's user avatar
  • 209k

Only top scored, non community-wiki answers of a minimum length are eligible