Click here to Skip to main content
15,892,005 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
QuestionSystem Monitoring Pin
aslamkazi24-Jan-21 20:53
aslamkazi24-Jan-21 20:53 
AnswerRe: System Monitoring Pin
Richard MacCutchan24-Jan-21 22:06
mveRichard MacCutchan24-Jan-21 22:06 
QuestionShould this be its own class? Pin
RobertSF18-Jan-21 7:23
professionalRobertSF18-Jan-21 7:23 
AnswerRe: Should this be its own class? Pin
Matthew Dennis18-Jan-21 7:40
sysadminMatthew Dennis18-Jan-21 7:40 
AnswerRe: Should this be its own class? Pin
Richard MacCutchan18-Jan-21 22:18
mveRichard MacCutchan18-Jan-21 22:18 
AnswerRe: Should this be its own class? Pin
Gerry Schmitz19-Jan-21 4:46
mveGerry Schmitz19-Jan-21 4:46 
Questionhtlm Pin
MBC Earth7-Jan-21 1:03
MBC Earth7-Jan-21 1:03 
AnswerRe: htlm Pin
Richard Deeming7-Jan-21 1:14
mveRichard Deeming7-Jan-21 1:14 
GeneralRe: htlm Pin
Pete O'Hanlon7-Jan-21 2:41
mvePete O'Hanlon7-Jan-21 2:41 
GeneralRe: htlm Pin
cmarble8-Feb-21 11:58
cmarble8-Feb-21 11:58 
GeneralRe: htlm Pin
Pete O'Hanlon8-Feb-21 21:56
mvePete O'Hanlon8-Feb-21 21:56 
GeneralRe: htlm Pin
cmarble8-Feb-21 22:39
cmarble8-Feb-21 22:39 
QuestionWhat version should I use Pin
Stevey T5-Jan-21 6:19
Stevey T5-Jan-21 6:19 
AnswerRe: What version should I use Pin
jsc428-Jan-21 2:48
professionaljsc428-Jan-21 2:48 
QuestionDistributed transactions within a microservices architecture Pin
Pelle3021-Dec-20 0:22
Pelle3021-Dec-20 0:22 
AnswerRe: Distributed transactions within a microservices architecture Pin
Gerry Schmitz21-Dec-20 9:19
mveGerry Schmitz21-Dec-20 9:19 
QuestionWhat technologies to use to build a site like Kaggle? Pin
SIDDHARTH_JAIN12-Dec-20 17:50
SIDDHARTH_JAIN12-Dec-20 17:50 
AnswerRe: What technologies to use to build a site like Kaggle? Pin
Gerry Schmitz13-Dec-20 6:11
mveGerry Schmitz13-Dec-20 6:11 
AnswerRe: What technologies to use to build a site like Kaggle? Pin
Richard MacCutchan13-Dec-20 6:34
mveRichard MacCutchan13-Dec-20 6:34 
QuestionShould we duplicate code? Pin
Member 44870839-Dec-20 9:24
Member 44870839-Dec-20 9:24 
I have always had the view that duplication is bad. There are always exceptions, but most of the time I it seems bad to me. Unit tests are one are where I tolerate it more but in production code it's something that I rarely find desirable.

Some people duplicate things two or three times and only eliminate the duplication on the third or fourth time. I really can't understand why somebody would blindly follow this rule. I understand the argument that we may not know how to refactor something if there are aren't enough instances of the duplication but I find that it is rarely the case. At least if you don't know how best to refactor something then keep it simple. The rule seems crazy as why would you do something if you know it's bad? Eliminating duplication is usually quick and, in my opinion, usually makes things much easier to read, particularly when you have half as much code to read/understand.

As an example, imagine we want to format a number as a currency. We could have the following
x.ToString ("£0.##")

Having it once seems fine, but not really more than once. Surely, as a very simple refactor, something like the following would be better?
Format.AsCurrency(x)

Surely the time saved by the readability would outweigh the code of writing it and it solves the problems of duplication.

Deliberately duplicating code doesn't make much sense to me, but maybe I've been working with people who have taken things a bit too far?
AnswerRe: Should we duplicate code? Pin
Pete O'Hanlon9-Dec-20 21:30
mvePete O'Hanlon9-Dec-20 21:30 
AnswerRe: Should we duplicate code? Pin
Gerry Schmitz10-Dec-20 5:45
mveGerry Schmitz10-Dec-20 5:45 
QuestionAdvice for web application technologies / architecture Pin
cpper28-Dec-20 8:46
cpper28-Dec-20 8:46 
AnswerRe: Advice for web application technologies / architecture Pin
DerekT-P10-Dec-20 23:49
professionalDerekT-P10-Dec-20 23:49 
QuestionDesign Pattern advice Pin
Freerk_C16-Nov-20 3:20
Freerk_C16-Nov-20 3:20 

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.