Click here to Skip to main content
15,888,461 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: A server to communicate with a robot Pin
Eddy Vluggen19-Dec-14 5:32
professionalEddy Vluggen19-Dec-14 5:32 
GeneralRe: A server to communicate with a robot Pin
cocoonwls21-Dec-14 19:04
cocoonwls21-Dec-14 19:04 
GeneralRe: A server to communicate with a robot Pin
Eddy Vluggen22-Dec-14 2:59
professionalEddy Vluggen22-Dec-14 2:59 
GeneralRe: A server to communicate with a robot Pin
cocoonwls22-Dec-14 14:45
cocoonwls22-Dec-14 14:45 
GeneralRe: A server to communicate with a robot Pin
Eddy Vluggen23-Dec-14 7:48
professionalEddy Vluggen23-Dec-14 7:48 
AnswerRe: A server to communicate with a robot Pin
Keld Ølykke4-Jan-15 12:42
Keld Ølykke4-Jan-15 12:42 
AnswerRe: A server to communicate with a robot Pin
manoranjan10-Jan-15 11:22
manoranjan10-Jan-15 11:22 
QuestionNever use pure built in types Pin
D4rkTrick11-Dec-14 6:23
professionalD4rkTrick11-Dec-14 6:23 
Hi,

instead of using types like int, float or bool, I came to the thinking of typedeffing/classing all the built in types to what they actually represent in the code. (in language, that support this feature)

e.g. (c++)
C++
typedef int Age;
typedef int Number
Age ageOfAPerson;
Number donatedMoney
...


Reasons for doing so:
* having full control over what type the variable really represents.
scenarios:
- an ID is a *number* at first and changes to have letters in it later
- the System (connected with a database) was not designed for having so many users and now we're running out of IDs (getting closer to max-integer)

* throughout all code it's rather easy to see which variables represent the same functional meaning.

* range-changes can be made rather easy: just change the typedef

* deciding that one former "just-variable" should be a class with a function or some range checking can be implemented rather easy.

* avoid uncareful castings(anti-temptating): it's easy to cast a "integer" to an "unsigned integer". But it's rather hard to cast a "second" to a "user-id", even if both is an "integer" behind the scenes.

On the cons-side of course, we have a massive overhead (at first)

what do you think about that?

Would be pleased to hear some experiences or opinions Smile | :)

regards
AnswerRe: Never use pure built in types Pin
Richard MacCutchan11-Dec-14 6:43
mveRichard MacCutchan11-Dec-14 6:43 
GeneralRe: Never use pure built in types Pin
D4rkTrick21-Dec-14 8:18
professionalD4rkTrick21-Dec-14 8:18 
AnswerRe: Never use pure built in types Pin
den2k8811-Dec-14 7:37
professionalden2k8811-Dec-14 7:37 
GeneralRe: Never use pure built in types Pin
jschell12-Dec-14 12:29
jschell12-Dec-14 12:29 
GeneralRe: Never use pure built in types Pin
den2k8814-Dec-14 0:09
professionalden2k8814-Dec-14 0:09 
GeneralRe: Never use pure built in types Pin
jschell16-Dec-14 12:37
jschell16-Dec-14 12:37 
AnswerRe: Never use pure built in types Pin
jschell12-Dec-14 12:26
jschell12-Dec-14 12:26 
GeneralRe: Never use pure built in types Pin
D4rkTrick21-Dec-14 8:17
professionalD4rkTrick21-Dec-14 8:17 
QuestionHow to avoid backend stored procedures Pin
nstk8-Dec-14 21:24
nstk8-Dec-14 21:24 
JokeRe: How to avoid backend stored procedures Pin
Brady Kelly12-Dec-14 5:52
Brady Kelly12-Dec-14 5:52 
AnswerRe: How to avoid backend stored procedures Pin
Eddy Vluggen12-Dec-14 7:27
professionalEddy Vluggen12-Dec-14 7:27 
AnswerRe: How to avoid backend stored procedures Pin
Dominic Burford23-Dec-14 1:35
professionalDominic Burford23-Dec-14 1:35 
QuestionRearchitecting BackgroundWorker based to Task based? Pin
Matt T Heffron17-Nov-14 12:49
professionalMatt T Heffron17-Nov-14 12:49 
AnswerRe: Rearchitecting BackgroundWorker based to Task based? Pin
Richard Deeming18-Nov-14 2:45
mveRichard Deeming18-Nov-14 2:45 
AnswerRe: Rearchitecting BackgroundWorker based to Task based? Pin
Gerry Schmitz18-Nov-14 7:00
mveGerry Schmitz18-Nov-14 7:00 
QuestionRemote Desktop Connection Pin
Non Sequitur11-Nov-14 3:43
Non Sequitur11-Nov-14 3:43 
SuggestionRe: Remote Desktop Connection Pin
ZurdoDev11-Nov-14 5:27
professionalZurdoDev11-Nov-14 5:27 

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.