Click here to Skip to main content
15,890,512 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: I don't know why I hate statics so much Pin
Marc Clifton11-Dec-21 3:11
mvaMarc Clifton11-Dec-21 3:11 
GeneralRe: I don't know why I hate statics so much Pin
Slow Eddie11-Dec-21 3:24
professionalSlow Eddie11-Dec-21 3:24 
GeneralRe: I don't know why I hate statics so much Pin
honey the codewitch11-Dec-21 5:53
mvahoney the codewitch11-Dec-21 5:53 
QuestionRe: I don't know why I hate statics so much Pin
Randor 11-Dec-21 6:05
professional Randor 11-Dec-21 6:05 
AnswerRe: I don't know why I hate statics so much Pin
honey the codewitch11-Dec-21 6:15
mvahoney the codewitch11-Dec-21 6:15 
GeneralRe: I don't know why I hate statics so much Pin
Randor 11-Dec-21 6:38
professional Randor 11-Dec-21 6:38 
GeneralRe: I don't know why I hate statics so much Pin
honey the codewitch11-Dec-21 6:43
mvahoney the codewitch11-Dec-21 6:43 
GeneralRe: I don't know why I hate statics so much Pin
PIEBALDconsult11-Dec-21 4:41
mvePIEBALDconsult11-Dec-21 4:41 
"Use the right tool for the right job." -- Scotty et al

I write a lot of library routines, so statics are the norm.

I am also not a fan of singletons as they make no sense from a design viewpoint.
I have yet to see a convincing argument in favor of singletons for anything mission critical.

BUT! As it turns out, I wrote a family of five (!) singletons yesterday. Each implements a MAC address parser with a different level of leniency -- from Strict to Wild West.
This is still essentially a set of library routines, but each is implemented by a different specialized singleton, accessible only via one static class. (I didn't bother with making them lazy; all they contain is a Regular Expression.)
It's sort of like the family of System.StringComparers or System.Text.Encodings.

P.S. -- C# of course.

modified 11-Dec-21 11:45am.

GeneralRe: I don't know why I hate statics so much Pin
Gerry Schmitz12-Dec-21 6:36
mveGerry Schmitz12-Dec-21 6:36 
GeneralRe: I don't know why I hate statics so much Pin
0x01AA11-Dec-21 5:00
mve0x01AA11-Dec-21 5:00 
GeneralRe: I don't know why I hate statics so much Pin
David O'Neil11-Dec-21 5:27
professionalDavid O'Neil11-Dec-21 5:27 
GeneralRe: I don't know why I hate statics so much Pin
honey the codewitch11-Dec-21 5:48
mvahoney the codewitch11-Dec-21 5:48 
GeneralRe: I don't know why I hate statics so much Pin
David O'Neil11-Dec-21 7:44
professionalDavid O'Neil11-Dec-21 7:44 
GeneralRe: I don't know why I hate statics so much Pin
honey the codewitch11-Dec-21 10:04
mvahoney the codewitch11-Dec-21 10:04 
GeneralRe: I don't know why I hate statics so much Pin
PIEBALDconsult11-Dec-21 5:54
mvePIEBALDconsult11-Dec-21 5:54 
GeneralRe: I don't know why I hate statics so much Pin
Greg Utas11-Dec-21 6:17
professionalGreg Utas11-Dec-21 6:17 
GeneralRe: I don't know why I hate statics so much Pin
honey the codewitch11-Dec-21 6:23
mvahoney the codewitch11-Dec-21 6:23 
GeneralRe: I don't know why I hate statics so much Pin
Gerry Schmitz11-Dec-21 6:37
mveGerry Schmitz11-Dec-21 6:37 
GeneralRe: I don't know why I hate statics so much Pin
Gary R. Wheeler11-Dec-21 10:23
Gary R. Wheeler11-Dec-21 10:23 
GeneralRe: I don't know why I hate statics so much Pin
honey the codewitch11-Dec-21 10:27
mvahoney the codewitch11-Dec-21 10:27 
GeneralRe: I don't know why I hate statics so much Pin
honey the codewitch12-Dec-21 4:51
mvahoney the codewitch12-Dec-21 4:51 
GeneralRe: I don't know why I hate statics so much Pin
Super Lloyd11-Dec-21 17:22
Super Lloyd11-Dec-21 17:22 
GeneralRe: I don't know why I hate statics so much Pin
honey the codewitch12-Dec-21 4:48
mvahoney the codewitch12-Dec-21 4:48 
GeneralRe: I don't know why I hate statics so much Pin
Super Lloyd12-Dec-21 5:58
Super Lloyd12-Dec-21 5:58 
GeneralRe: I don't know why I hate statics so much Pin
honey the codewitch12-Dec-21 6:02
mvahoney the codewitch12-Dec-21 6:02 

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.