Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8556337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:19:31+00:00 2026-06-11T15:19:31+00:00

Even though .Net allows dynamic invocation (e.g. with reflection, C# dynamic keyword), but when

  • 0

Even though .Net allows dynamic invocation (e.g. with reflection, C# dynamic keyword), but when using a language such as C# we sometimes feel it is necessary to use static typing, in order to prove that our program is correct, and will not have typing issues at runtime.

Sometimes this results in us introducing interfaces or base classes that fee like they are just for purpose of explaining to the compiler that ‘Yes, I know all the objects I pass to this context are going to be understand invoke Method X with arg Y – here, I will prove it to you using an interface definition!’ (For example – .net internally uses IReadChunkBytes interface to allow passing either SteamReadChunkBytes or BufferReadChunkBytes objects to some method or other.)

Other times we create classes or types to serve other purposes which are do not feel very usefully type-y, such as being unique identifiers (a bit like enums) with small attached behavior, or to hold a set of constants, etc.

I’m interested in better understanding what the compiletime, runtime, and other costs are going to be when I face such design decisions where I am asking ‘should I define a new type or interface just in order to solve this problem?’ Obviously there will be two sides to the cost and benefit in each such comparison, but in general we should hopefully see the same costs for ‘define new type’ in each such comparison/disucssion. How do we quantify these costs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:19:33+00:00Added an answer on June 11, 2026 at 3:19 pm

    Almost everything has some runtime cost. The only exception would be things like empty space. The reason is that almost everything gets record in IL image, even local variable names, parameter names, constants. So at least there will be disk cost, virtual memory space cost, working space cost.

    In terms of CPU, more metadata will slow down program startup, token resolution, JIT/NGEN.

    But sometimes adding types can have positive impact on performance too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ASP.NET MVC 2 Dots Replaced With Underscore In Element Name (even though ASP.NET MVC
Even though it is possible to write generic code in C using void pointer(generic
Why is it necessary even though everything is specified in a makefile?
Even though it's not part of HTTP 1.1/RFC2616 webapps that wish to force a
Even though I have a fermi card(gtx 560) I get this error on VS2010:
Even though I've been reading other topics about my kind of problem, I can't
...even though pointers to member functions are strange animals ? I am coding a
One would expect that even though strings are immutable, value-equality and reference-equality would not
In C# you can define delegates anonymously (even though they are nothing more than
I've heard of GAE and even though it doesn't support PHP, people have gotten

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.