4 ms·
Naming Things Is Hard!
What would you name a variable that has type Promise<Todo> ?
- zzo38computer 2y agoI would think it would depend what the meaning of the variable is? Usually, it is not only the type which is relevant, I think.
- deleted 2y ago[deleted]
- necovek 2y agoI though we were past naming variables by their types? That's what their types are for. So try naming it about what is it promising to have?
- c5n8 2y agoWhat would you name it?
- necovek 2y agoWhat is it going to have as the value?
- c5n8 2y agoa promise that, if fulfilled, will return an object of uncompleted todo
- necovek 2y agoSomething to the tune of "unfinished", "uncompleted"/"incomplete" or — even better — "outstanding". I avoid negatives when I can, so I'd go with `outstandingTask` or `outstanding_task` (or `todo` if that's the term you use throughout the application).
- behnamoh 2y agoI have this convention: <group-name><object-name><object-type> So in your case: ToDoPromise if it's the only todo.
- c5n8 2y agoI could see what group name is. What sets apart object name and object type? Because, both Todo and Promise are object type.