Author Topic: No static in C# interfaces  (Read 3813 times)

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
No static in C# interfaces
« on: November 12, 2011, 02:42:03 AM »
It's probably telling that I've never run into this problem until now, but I'm really ticked off about it.

C# interfaces can't be implemented as static, and cannot require a member to be static. The excuse is that interfaces should describe behavior, not implementation detail. Ok, that's fine, but by not allowing me to implement a behavior as static YOU ARE FORCING ME TO FOLLOW AN IMPLEMENTATION DETAIL.

 :frustration: :frustration: :frustration: :frustration: :frustration: :frustration:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1366
    • View Profile
  • Rated:
Re: No static in C# interfaces
« Reply #1 on: November 12, 2011, 08:22:46 AM »
You were already doomed to that when you selected C#. It's called customer lock-in. The same thing applies when you select Objective-C on Apple platforms.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

kren.Z

  • Guest
Re: No static in C# interfaces
« Reply #2 on: November 12, 2011, 08:23:43 AM »
I went over interfaces and OOP in Java but never really understood it, let alone actually implement any of it. Now that I'm starting to write bigger programs I have to find ways to break up my code (for my own sake) and find myself saying "Hey, this approach would be useful!".  I'm not yet that good of a programmer to have gripes about a specific language lol.

What's great about C# (from your standpoint)? I hear a lot of good things about it...
« Last Edit: January 28, 2014, 01:24:50 PM by krenZ »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

kren.Z

  • Guest
Re: No static in C# interfaces
« Reply #3 on: November 12, 2011, 08:33:55 AM »
Wondering what you guys prefer/recommend/use for Source Control. Right now I'm thinking mercurial [http://mercurial.selenic.com/] and Git/Git Hub.

I need something with great merge capabilities. e.g. 2 people working on different parts of the same file.
« Last Edit: January 28, 2014, 01:24:52 PM by krenZ »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: No static in C# interfaces
« Reply #4 on: November 12, 2011, 09:09:56 AM »
What's great about C# (from your standpoint)? I hear a lot of good things about it...

C# is VB with semi-colons. I hated it for a long time, but was pretty much forced to move to it. MS platform web applications all but require it. The only thing I like about it is WPF. I am kind of happy that it's a managed language because having reliable GC is great for desktop apps.

When it comes to real heavy lifting, C# is not the best idea. There is overhead associated with it and I hear that the crap thrown in from the CLR to perform reflection really bloats the app. That and when it comes to memory intensive stuff, like large image processing, the managed parts get in the way like an elephant in your driveway.

So to answer your question directly...

What is great about C#? There are lots of good paying jobs that require it.  :lolsign:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: No static in C# interfaces
« Reply #5 on: November 12, 2011, 09:17:02 AM »
You were already doomed to that when you selected C#. It's called customer lock-in. The same thing applies when you select Objective-C on Apple platforms.

QFT


Wondering what you guys prefer/recommend/use for Source Control. Right now I'm thinking mercurial [http://mercurial.selenic.com/] and Git/Git Hub.

I need something with great merge capabilities. e.g. 2 people working on different parts of the same file.

I recommend Subversion because it has the easiest interface and smallest learning curve. Right now I use yesterday's garbage known as Starteam.

Git is popular, but I've had nothing but bad experiences with it. When interacting with a coworker who was proficient with its command line, everything we tried to do took about 5 times longer than we expected, so we stopped and switched everything to SVN.

I hear CVS is a great option. (but I've been shopping at Walgreens lately)
« Last Edit: November 12, 2011, 09:53:42 AM by peewee_RotA »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1366
    • View Profile
  • Rated:
Re: No static in C# interfaces
« Reply #6 on: November 12, 2011, 10:28:12 AM »
SVN is the most mature. Subversion is supplanting it but it's essentially SVN. Git is the newest, IIRC and Xcode 4 on the Apple platform automatically creates a git repository for projects when you create them so it's a no-brainer there. Xcode also interfaces to SVN/Subversion seamlessly. I love the side by side comparison and log views in Xcode.

On PC there are plugins for SVN/Subversion and git for Visual Studio and interfacing to an existing project is simple but creating a new one can be a bit of a pain in the GUI. I use AnkhSVN in VS 2010 Ultimate and WinMerge is my preferred comparison tool on the PC getting the tools set up where you can use them without distracting from the development task is 90% of the job.

Ultimately you end up using all of them if you fool with FOSS because the FOSS community uses all of them.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: No static in C# interfaces
« Reply #7 on: November 12, 2011, 10:45:13 AM »
WinMerge is my preferred comparison tool on the PC getting the tools set up where you can use them without distracting from the development task is 90% of the job.

I forgot to mention that. Tortoise launches Winmerge seamlessly when it comes to comparisons.

I do have to mention, I have both Winmerge and the Starteam 2006 compare tool on my work computer and for how unbearably bad that starteam is, it's compare tool is really good. Even better than winmerge.  :purpleshock:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: No static in C# interfaces
« Reply #8 on: November 16, 2011, 08:03:10 AM »
Another thing that has always ticked me off about C#:

You are expected never to use destructors (because garbage collection is unpredictable and 90% of the time the objects you are cleaning up have already been deleted), however the concept of a destructor is vital to OOP...

So they added the concept of the disposable object. :frustration:


So they took the tire off the existing wheel, reinvented a new wheel, and decided that you have to provide your own axles and brakes.
« Last Edit: November 16, 2011, 08:04:55 AM by peewee_RotA »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline quadz

  • Loquaciously Multiloquent Member
  • ****
  • Posts: 5352
    • View Profile
  • Rated:
Re: No static in C# interfaces
« Reply #9 on: November 16, 2011, 11:47:26 PM »
the concept of a destructor is vital to OOP...

Hmm...  I'd agree that destructors are vital to RAII.  But I'd say the concept of destructors is orthogonal to OOP.

For instance, Alan Kay coined the term Object Oriented, but I don't recall destructors in Smalltalk. ;)

Indeed, most garbage collected OO languages I'm aware of don't support deterministic destructors, for technical reasons (conservative GC implementations.)


Regards,

quadz

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
"He knew all the tricks, dramatic irony, metaphor, bathos, puns, parody, litotes and... satire. He was vicious."

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: No static in C# interfaces
« Reply #10 on: December 01, 2011, 05:35:30 AM »
In an attempt to abstract themselves into another dimension, common C# practice is to use Interfaces for everything and store concrete implementations in localized and easily "extendable" places.

Although this is a very clean approach, there is an issues when debugging.

msvc2010 C# only provides a "Go to Definition" button. This definition takes you directly to the declaration in the Interface. Yes I understand why. But the problem is that MSVC++ IDEs provide both a "Go To Definition" and "Go To Declaration."

By this understanding, interfaces can never have any definitions. Although it may not be possible to find the actual Definition of the concrete object that was assigned somewhere in the code, directing me to something that can never ever contain a definition is a useless and frustrating functionality that is contrary to it's historical use.

 :frustration:






the concept of a destructor is vital to OOP...

Hmm...  I'd agree that destructors are vital to RAII.  But I'd say the concept of destructors is orthogonal to OOP.

For instance, Alan Kay coined the term Object Oriented, but I don't recall destructors in Smalltalk. ;)

Indeed, most garbage collected OO languages I'm aware of don't support deterministic destructors, for technical reasons (conservative GC implementations.)


Regards,

quadz

You're right that I used the wrong term. It's a very basic need to be able to establish a lifetime of objects in order to properly clean up. In managed languages the memory concerns are not the issue, so cleaning up the memory during destruction is not necessary. However, a large number of objects still need lifetimes. Anything dealing with databases or IO need to have a cleanup even if the program crashes.

So not only is there this added Disposable interface concept in order to account for this, the cleanest method to ensure it is an elaborate "lifetime manager" built into the Unity Container. Although the lazy programmer can always just add giant try/catch/finally around the bootstrapper.  :nana:
« Last Edit: December 01, 2011, 06:04:57 AM by peewee_RotA »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

 

El Box de Shoutamente

Last 10 Shouts:

 

RyU

September 03, 2024, 05:15:49 PM
And wow Derrick is still playing lol
 

RyU

September 03, 2024, 05:15:15 PM
Just know yesterday is gone and soon tomorrow will be gone too  :)
 

Lejionator

August 08, 2024, 07:28:01 PM
It's tiem to QuakeCon!!!  ;)

https://www.youtube.com/watch?v=ThQd_UJaTys
 

ImperiusDamian

July 26, 2024, 09:34:53 PM
In nomine Quake II et Id Software et Spiritus John Carmack, Amen.
 

QuakeDuke

July 26, 2024, 05:10:30 PM
Hey, shout, summertime blues
Jump up and down in you blue suede shoes
Hey, did you rock and roll? Rock on!!  ...QD
 

Yotematoi

July 24, 2024, 01:31:20 PM
Ayer me mato 5 veces para robarme en la vida real hará lo mismo? [img]<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid0wXU2VgS7atesBcSoMz5BWMJCJajeZFVT6GzSU6TtpJGddN9kLTvWNgcZaskkbKFQl&amp;show_text=true&amp;width=500
https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid0wXU2VgS7atesBcSoMz5BWMJCJajeZFVT6GzSU6TtpJGddN9kLTvWNgcZaskkbKFQl&show_text=true&width=500" width="500"
 

Yotematoi

July 24, 2024, 01:25:59 PM
hi ya está la basura de Martin, se cambió el nombre es un ladron estupido, asi llegó a 10000[img]<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&amp;show_text
https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&show_text
 

Yotematoi

July 24, 2024, 01:25:59 PM
hi ya está la basura de Martin, se cambió el nombre es un ladron estupido, asi llegó a 10000[img]<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&amp;show_text
https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&show_text
 

-Unh0ly-

July 05, 2024, 05:20:36 AM

Show 50 latest
Welcome, Guest. Please login or register.
September 20, 2024, 02:44:05 PM

Login with username, password and session length