Skip to main content
"Attribute" mentioned
Source Link
Doc Brown
  • 214.2k
  • 34
  • 394
  • 604

"I'm wondering if there is a widely accepted convention for naming base classed in OOP"

Short answer: no, there is not.

If you want to read something directly out of the name of a class, you need to consult the programming guidelines of your team or organization. There are only very few widely accepted naming conventions, and even those don't apply to "OOP in general", but usually to a specific language ecosystem.

For example, in C#, I would usually expect a type name starting with a single I to be an interface (though not every team names gives interfaces always an I prefix; it is a convention suggested by Microsoft). For a class ending with the word Exception I would expect it to be a derivation of System.Exception. And (as mentioned in a comment by @Blake, thanks), attribute classes in C# usually end with the suffix Attribute. In Python, the PEP 8 style guide suggests to let exception classes (which represent errors) end with the name Error.

Specifically for C#, I guess that list is complete. I cannot remember to have seen a naming style "broadly accepted" across teams and organizations, where part of a class name induces a clear semantics.

"I'm wondering if there is a widely accepted convention for naming base classed in OOP"

Short answer: no, there is not.

If you want to read something directly out of the name of a class, you need to consult the programming guidelines of your team or organization. There are only very few widely accepted naming conventions, and even those don't apply to "OOP in general", but usually to a specific language ecosystem.

For example, in C#, I would usually expect a type name starting with a single I to be an interface (though not every team names gives interfaces always an I prefix; it is a convention suggested by Microsoft). For a class ending with the word Exception I would expect it to be a derivation of System.Exception. In Python, the PEP 8 style guide suggests to let exception classes (which represent errors) end with the name Error.

Specifically for C#, I guess that list is complete. I cannot remember to have seen a naming style "broadly accepted" across teams and organizations, where part of a class name induces a clear semantics.

"I'm wondering if there is a widely accepted convention for naming base classed in OOP"

Short answer: no, there is not.

If you want to read something directly out of the name of a class, you need to consult the programming guidelines of your team or organization. There are only very few widely accepted naming conventions, and even those don't apply to "OOP in general", but usually to a specific language ecosystem.

For example, in C#, I would usually expect a type name starting with a single I to be an interface (though not every team names gives interfaces always an I prefix; it is a convention suggested by Microsoft). For a class ending with the word Exception I would expect it to be a derivation of System.Exception. And (as mentioned in a comment by @Blake, thanks), attribute classes in C# usually end with the suffix Attribute. In Python, the PEP 8 style guide suggests to let exception classes (which represent errors) end with the name Error.

Specifically for C#, I guess that list is complete. I cannot remember to have seen a naming style "broadly accepted" across teams and organizations, where part of a class name induces a clear semantics.

deleted 40 characters in body
Source Link
Doc Brown
  • 214.2k
  • 34
  • 394
  • 604

"I'm wondering if there is a widely accepted convention for naming base classed in OOP"

Short answer: no, there is not.

If you want to read something directly out of the name of a class, you need to consult the programming guidelines of your team or organization. There are only very few widely accepted naming conventions, and even those don't apply to "OOP in general", but usually to a specific language ecosystem.

For example, in Java or C#, I would usually expect a type name starting with a single I to be an interface (though not every team names gives interfaces always an I prefix; for C#, it is a convention suggested by Microsoft). For a class ending with the word Exception I would expect it to be a derivation of java.lang-Exception or   System.Exception. In Python, the PEP 8 style guide suggests to let exception classes (which represent errors) end with the name Error.

Specifically for C#, I guess that list is complete. I cannot remember to have seen a naming style "broadly accepted" across teams and organizations, where part of a class name induces a clear semantics.

"I'm wondering if there is a widely accepted convention for naming base classed in OOP"

Short answer: no, there is not.

If you want to read something directly out of the name of a class, you need to consult the programming guidelines of your team or organization. There are only very few widely accepted naming conventions, and even those don't apply to "OOP in general", but usually to a specific language ecosystem.

For example, in Java or C#, I would usually expect a type name starting with a single I to be an interface (though not every team names gives interfaces always an I prefix; for C#, it is a convention suggested by Microsoft). For a class ending with the word Exception I would expect it to be a derivation of java.lang-Exception or System.Exception. In Python, the PEP 8 style guide suggests to let exception classes (which represent errors) end with the name Error.

Specifically for C#, I guess that list is complete. I cannot remember to have seen a naming style "broadly accepted" across teams and organizations, where part of a class name induces a clear semantics.

"I'm wondering if there is a widely accepted convention for naming base classed in OOP"

Short answer: no, there is not.

If you want to read something directly out of the name of a class, you need to consult the programming guidelines of your team or organization. There are only very few widely accepted naming conventions, and even those don't apply to "OOP in general", but usually to a specific language ecosystem.

For example, in C#, I would usually expect a type name starting with a single I to be an interface (though not every team names gives interfaces always an I prefix; it is a convention suggested by Microsoft). For a class ending with the word Exception I would expect it to be a derivation of   System.Exception. In Python, the PEP 8 style guide suggests to let exception classes (which represent errors) end with the name Error.

Specifically for C#, I guess that list is complete. I cannot remember to have seen a naming style "broadly accepted" across teams and organizations, where part of a class name induces a clear semantics.

deleted 5 characters in body
Source Link
Doc Brown
  • 214.2k
  • 34
  • 394
  • 604

"I'm wondering if there is a widely accepted convention for naming base classed in OOP"

Short answer: no, there is not.

If you want to read something directly out of the name of a class, you need to consult the programming guidelines of your team or organization. There are only very few widely accepted naming conventions, and even those don't apply to "OOP in general", but usually to a specific language ecosystem.

For example, in Java or C#, I would usually expect a type name starting with a single I to be an interface (though not every team names gives interfaces always an I prefixprefix; for C#, it is a convention suggested by Microsoft). For a class ending with the word Exception I would expect it to be a derivation of java.lang-Exception or System.Exception. In Python, the PEP 8 style guide suggests to let exception classes (which represent errors) end with the name Error.

Specifically for C#, I guess that list is complete. I cannot remember to have seen a naming style "broadly accepted" across teams and organizations, where part of a class name induces a clear semantics.

"I'm wondering if there is a widely accepted convention for naming base classed in OOP"

Short answer: no, there is not.

If you want to read something directly out of the name of a class, you need to consult the programming guidelines of your team or organization. There are only very few widely accepted naming conventions, and even those don't apply to "OOP in general", but usually to a specific language ecosystem.

For example, in Java or C#, I would usually expect a type name starting with a single I to be an interface (though not every team names gives interfaces always an I prefix). For a class ending with the word Exception I would expect it to be a derivation of java.lang-Exception or System.Exception. In Python, the PEP 8 style guide suggests to let exception classes (which represent errors) end with the name Error.

Specifically for C#, I guess that list is complete. I cannot remember to have seen a naming style "broadly accepted" across teams and organizations, where part of a class name induces a clear semantics.

"I'm wondering if there is a widely accepted convention for naming base classed in OOP"

Short answer: no, there is not.

If you want to read something directly out of the name of a class, you need to consult the programming guidelines of your team or organization. There are only very few widely accepted naming conventions, and even those don't apply to "OOP in general", but usually to a specific language ecosystem.

For example, in Java or C#, I would usually expect a type name starting with a single I to be an interface (though not every team names gives interfaces always an I prefix; for C#, it is a convention suggested by Microsoft). For a class ending with the word Exception I would expect it to be a derivation of java.lang-Exception or System.Exception. In Python, the PEP 8 style guide suggests to let exception classes (which represent errors) end with the name Error.

Specifically for C#, I guess that list is complete. I cannot remember to have seen a naming style "broadly accepted" across teams and organizations, where part of a class name induces a clear semantics.

deleted 5 characters in body
Source Link
Doc Brown
  • 214.2k
  • 34
  • 394
  • 604
Loading
added 68 characters in body
Source Link
Doc Brown
  • 214.2k
  • 34
  • 394
  • 604
Loading
added 119 characters in body
Source Link
Doc Brown
  • 214.2k
  • 34
  • 394
  • 604
Loading
Source Link
Doc Brown
  • 214.2k
  • 34
  • 394
  • 604
Loading