• Blog
  • Info Support
  • Career
  • Training
  • International Group
  • Info Support
  • Blog
  • Career
  • Training
  • International Group
  • Search
logo InfoSupport
  • Latest blogs
  • Popular blogs
  • Experts
      • All
      • Bloggers
      • Speakers
  • Meet us
  • About us
    • nl
    • en
    • .NET
    • 3D printing
    • Advanced Analytics
    • Agile
    • Akka
    • Alexa
    • Algorithms
    • Api's
    • Architectuur
    • Artificial Intelligence
    • ATDD
    • Augmented Reality
    • AWS
    • Azure
    • Big Data
    • Blockchain
    • Business Intelligence
    • Chatbots
    • Cloud
    • Code Combat
    • Cognitive Services
    • Communicatie
    • Containers
    • Continuous Delivery
    • CQRS
    • Cyber Security
    • Dapr
    • Data
    • Data & Analystics
    • Data Science
    • Data Warehousing
    • Databricks
    • DataOps
    • Developers life
    • DevOps
    • Digital Days
    • Digital Twin
    • Docker
    • eHealth
    • Enterprise Architecture
    • Event Sourcing
    • Hacking
    • Infrastructure & Hosting
    • Innovatie
    • Integration
    • Internet of Things
    • Java
    • Machine Learning
    • Microservices
    • Microsoft
    • Microsoft Bot Framework
    • Microsoft Data Platform
    • Mobile Development
    • Mutation Testing
    • Open source
    • Pepper
    • Power BI
    • Privacy & Ethiek
    • Python
    • Quality Assistance & Test
    • Quality Assurance & Test
    • Requirements Management
    • Scala
    • Scratch
    • Security
    • SharePoint
    • Software Architecture
    • Software development
    • Software Factory
    • SQL Server
    • SSL
    • Start-up
    • Startup thinking
    • Stryker
    • Test Quality
    • Testing
    • TLS
    • TypeScript
    • Various
    • Web Development
    • Web-scale IT
    • Xamarin
    • All
    • Bloggers
    • Speakers
Home » Back to basics (or rather: What they all will be laughing at in a century) Part I
  • Back to basics (or rather: What they all will be laughing at in a century) Part I

    • By Erno de Weerd
    • .NET 18 years ago
    • .NET 0 comments
    • .NET .NET
    Back to basics (or rather: What they all will be laughing at in a century) Part I

    You might be aware or even take for granted that the two classes that are being used by most programmers today are both called Object. In Java and in .NET these two are the root of all (evil): all types implemented by genius developers around the world are based upon Object.

     

    I don’t know whether you’ve ever tried to explain the difference between a class and its instantiation (an object) But when a class (mind you the most important, omniscient class of all) is called Object this doesn’t get any simpler.

     

    But it gets better: as any starting Object Orientation adept should be able to tell you it is very important to place methods in the right level in an inheritance structure. Not to low -> you don’t want to copy code in siblings. Not to high -> to prevent classes having methods that are not really applicable. So let’s take a look at a method of Object that is present in Java as well as in .NET: ToString() or toString()

     

    ToString is said to give a string, that is a textual, representation of the object. So for instance: a class called Person (that derives from Object) implements this method so objects of type Person show the name of the particular person. Now I wonder… what made the guru’s decide that ALL objects have a string representation? Wouldn’t be an ToInteger as feasible? Or ToXml? Or ToBinary…

     

    Oh yes, I see the use of ToString while debugging but is that a valid reason to ruin an interface? Speaking of interfaces: why not have an IObject instead of an Object…

     

    One last remark that has been haunting me for 5 years now: Consider this picture (you can find it in the most respectable .NET books and courses but this one comes from an MSDN article on the Common Type System:

     


     

    See how ValueType inherits from Object… isn’t Object a reference type (is it?) then how can Value type be not a reference type? Boxing is real… But all nice inheritance rules (a cow IS an animal) seem to be broken…

     

     

    Share this

Erno de Weerd

View profile

Related IT training

Go to training website

Related Consultancy solutions

Go to infosupport.com

Related blogs

  • Configuring SQL Server encrypted connections using Powe…

    Configuring SQL Server encrypted connections using Powe… Léon Bouquiet - 1 month ago

  • Where to position SpecFlow in the Test Pyramid?

    Where to position SpecFlow in the Test Pyramid? Ronald Bosma - 4 months ago

  • Building a custom Kubernetes operator in C#

    Building a custom Kubernetes operator in C# Willem Meints - 8 months ago

Data Discovery Channel

  • Data+AI Summit 2023

  • Blijf je Azure cloud omgeving de baas met CloudXcellence

  • MLOps

Nieuwsbrief

* verplichte velden

Contact

  • Head office NL
  • Kruisboog 42
  • 3905 TG Veenendaal
  • T +31 318 552020
  • Call
  • Mail
  • Directions
  • Head office BE
  • Generaal De Wittelaan 17
  • bus 30 2800 Mechelen
  • T +32 15 286370
  • Call
  • Mail
  • Directions

Follow us

  • Twitter
  • Facebook
  • Linkedin
  • Youtube

Newsletter

Sign in

Extra

  • Media Library
  • Disclaimer
  • Algemene voorwaarden
  • ISHBS Webmail
  • Extranet
Beheer cookie toestemming
Deze website maakt gebruik van Functionele en Analytische cookies voor website optimalisatie en statistieken.
Functioneel Always active
De technische opslag of toegang is strikt noodzakelijk voor het legitieme doel het gebruik mogelijk te maken van een specifieke dienst waarom de abonnee of gebruiker uitdrukkelijk heeft gevraagd, of met als enig doel de uitvoering van de transmissie van een communicatie over een elektronisch communicatienetwerk.
Voorkeuren
De technische opslag of toegang is noodzakelijk voor het legitieme doel voorkeuren op te slaan die niet door de abonnee of gebruiker zijn aangevraagd.
Statistieken
De technische opslag of toegang die uitsluitend voor statistische doeleinden wordt gebruikt. De technische opslag of toegang die uitsluitend wordt gebruikt voor anonieme statistische doeleinden. Zonder dagvaarding, vrijwillige naleving door uw Internet Service Provider, of aanvullende gegevens van een derde partij, kan informatie die alleen voor dit doel wordt opgeslagen of opgehaald gewoonlijk niet worden gebruikt om je te identificeren.
Marketing
De technische opslag of toegang is nodig om gebruikersprofielen op te stellen voor het verzenden van reclame, of om de gebruiker op een website of over verschillende websites te volgen voor soortgelijke marketingdoeleinden.
Manage options Manage services Manage vendors Read more about these purposes
Voorkeuren
{title} {title} {title}