Click here to Skip to main content
15,887,676 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Is it to early to quote Shakespeare on this beautiful Friday? Pin
OriginalGriff6-Nov-20 1:25
mveOriginalGriff6-Nov-20 1:25 
GeneralRe: Is it to early to quote Shakespeare on this beautiful Friday? Pin
megaadam6-Nov-20 1:48
professionalmegaadam6-Nov-20 1:48 
AnswerRe: Is it to early to quote Shakespeare on this beautiful Friday? Pin
RickZeeland6-Nov-20 1:16
mveRickZeeland6-Nov-20 1:16 
AnswerRe: Is it to early to quote Shakespeare on this beautiful Friday? Pin
W Balboos, GHB6-Nov-20 1:59
W Balboos, GHB6-Nov-20 1:59 
AnswerRe: Is it to early to quote Shakespeare on this beautiful Friday? Pin
Keith Barrow6-Nov-20 2:04
professionalKeith Barrow6-Nov-20 2:04 
AnswerRe: Is it to early to quote Shakespeare on this beautiful Friday? Pin
Rage6-Nov-20 3:11
professionalRage6-Nov-20 3:11 
AnswerRe: Is it to early to quote Shakespeare on this beautiful Friday? Pin
Daniel Pfeffer6-Nov-20 3:12
professionalDaniel Pfeffer6-Nov-20 3:12 
GeneralEschew obfuscation -- again Pin
rjmoses5-Nov-20 23:23
professionalrjmoses5-Nov-20 23:23 
While tip-toeing through the tulips of LLVM, I came across a section of C++ code that follows:

//===--------------------------------------------------------------------===//
// Instruction creation methods: Compare Instructions
//===--------------------------------------------------------------------===//

Value *CreateICmpEQ(Value *LHS, Value *RHS, const Twine &Name = "") {
return CreateICmp(ICmpInst::ICMP_EQ, LHS, RHS, Name);
}
Value *CreateICmpNE(Value *LHS, Value *RHS, const Twine &Name = "") {
return CreateICmp(ICmpInst::ICMP_NE, LHS, RHS, Name);
}
Value *CreateICmpUGT(Value *LHS, Value *RHS, const Twine &Name = "") {
return CreateICmp(ICmpInst::ICMP_UGT, LHS, RHS, Name);
}

.... And there are about 20 or so similar functions.

My point is not about the code, but rather the "layering" of one-line functions.

Relatively recently, someone made a comment in another about function size (I apologize--I don't remember the thread) and it reminded me of days gone by when we had a recommended function size of 40-60 lines of code.

The reason for the function size at that time was so that a complete function would fit on ONE printed page (maybe two pages for a really complex function).

Paper size was commonly 66 lines x 132 columns. The idea was that each function would be printed on a separate page and you would be able to look at a page to see the complete processing of the function.

Looking at the above code, where a uniquely named function is created for each parameter type adds unnecessary complexity to the code.

Further, these functions, along with many other more complex functions, are in a C++ header file.

IMO, this is the type of coding practice that I personally do not like because it adds a layer of unnecessary complexity.

Just my thoughts....
GeneralRe: Eschew obfuscation -- again Pin
Greg Utas5-Nov-20 23:33
professionalGreg Utas5-Nov-20 23:33 
GeneralRe: Eschew obfuscation -- again Pin
rjmoses6-Nov-20 3:27
professionalrjmoses6-Nov-20 3:27 
GeneralRe: Eschew obfuscation -- again Pin
Gerry Schmitz5-Nov-20 23:46
mveGerry Schmitz5-Nov-20 23:46 
GeneralRe: Eschew obfuscation -- again Pin
MarkTJohnson6-Nov-20 0:53
professionalMarkTJohnson6-Nov-20 0:53 
GeneralRe: Eschew obfuscation -- again Pin
rjmoses6-Nov-20 3:27
professionalrjmoses6-Nov-20 3:27 
GeneralRe: Eschew obfuscation -- again Pin
honey the codewitch6-Nov-20 1:34
mvahoney the codewitch6-Nov-20 1:34 
GeneralRe: Eschew obfuscation -- again Pin
rjmoses6-Nov-20 3:25
professionalrjmoses6-Nov-20 3:25 
GeneralRe: Eschew obfuscation -- again Pin
  Forogar  6-Nov-20 5:12
professional  Forogar  6-Nov-20 5:12 
GeneralRe: Eschew obfuscation -- again Pin
DRHuff6-Nov-20 4:29
DRHuff6-Nov-20 4:29 
GeneralRe: Eschew obfuscation -- again Pin
Rick York6-Nov-20 5:56
mveRick York6-Nov-20 5:56 
GeneralRe: Eschew obfuscation -- again Pin
rjmoses6-Nov-20 23:50
professionalrjmoses6-Nov-20 23:50 
GeneralRe: Eschew obfuscation -- again Pin
Greg Utas7-Nov-20 2:26
professionalGreg Utas7-Nov-20 2:26 
GeneralRe: Eschew obfuscation -- again Pin
rjmoses7-Nov-20 2:40
professionalrjmoses7-Nov-20 2:40 
GeneralSound of the Week Pin
Sander Rossel5-Nov-20 23:15
professionalSander Rossel5-Nov-20 23:15 
GeneralRe: Sound of the Week Pin
yacCarsten6-Nov-20 2:05
yacCarsten6-Nov-20 2:05 
GeneralRe: Sound of the Week Pin
David O'Neil6-Nov-20 7:00
professionalDavid O'Neil6-Nov-20 7:00 
GeneralRe: Sound of the Week Pin
Sander Rossel7-Nov-20 1:24
professionalSander Rossel7-Nov-20 1:24 

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.