Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by ThrakaAndy · Apr 29, 2014 at 07:24 PM · c#

Why does the C# scripting libraries not conform to .NET naming convensions?

As a person new to Unity, but a seasoned .NET developer, I find it highly annoying that the library was not written to look like everything else provided by .NET.

.NET has had extensive documentation on naming guidelines since its introduction: http://msdn.microsoft.com/en-us/library/ms229042(v=vs.110).aspx

I'm curious as to why it was designed this way? And I assume someone internal would have to answer the question :)

As an example, it seems all public properties are lower cased, which mono.net and ms.net do not do.

Additionally, on the Renderer class, they have the isVisible property, and the enabled property which seems inconsistent. Why not name it isEnabled?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tanoshimi · Apr 29, 2014 at 07:39 PM 0
Share

This is a predo$$anonymous$$antly community forum, so you're unlikely to find an answer to a question that requires "someone internal". However, can you give specific examples of a na$$anonymous$$g convention that Unity uses that you find so annoying? I can't say there's anything that I've ever noticed.

Also, Unity doesn't use .NET as such (and it certainly isn't "provided by" .NET) - it uses $$anonymous$$ono - a cross-platform, implementation of C# and the CLR.

avatar image ThrakaAndy · Apr 29, 2014 at 09:22 PM 0
Share

Granted, but $$anonymous$$ono's implementation of .NET uses the same na$$anonymous$$g conventions. So Unity deviates from that too.

I'm adding some examples in the question.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Owen-Reynolds · Apr 29, 2014 at 10:25 PM

Game programmers tend to come from a much more eclectic background than .NET programmers. Many have used one of: LUA to write WorldOfWarCraft AddOns, or a various python-like in blender/Max/Gimp, or Ogre's C++(?), or Torque's Bash-like language, or one of the many versions of Flash-script. I'd guess many Unity C# programmers don't even "think in" C#.

Having consistent naming isn't as helpful to people who aren't used to it and don't expect it (and weren't aware that there's an official phrase for "try to pick names people will understand.")

For the non-OP, C# is sort-of microsoft's language, and microsoft is a big world. There are older, well-paid professionals who have never used a non-microsoft product. In the corporate world, you work 9 to 5; and if you follow all the programming rules, you can't get into too much trouble. The OP isn't nuts -- just has a different background.

Enabled is writable: dog.enabled=true looks better to me than dog.isEnable=true. Whereas isVisible is read-only.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ThrakaAndy · May 03, 2014 at 03:00 AM 0
Share

Thanks for the good answer.

avatar image
0

Answer by Jeff-Kesselman · Apr 29, 2014 at 07:52 PM

Because the C# naming conventions are really poor and limited.

Basically, they make everything public the same capitalization, which robs you of a lot of visual information.

There are a lot of good things in C#, but MSFT really dropped the ball on the naming conventions.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ThrakaAndy · Apr 29, 2014 at 09:32 PM 0
Share

Regardless of your opinion, that is the standard way things in .NET are named. $$anonymous$$ono is a .NET implementation, and follows that standard. I personally don't find the convention poor, I find it very readable and descriptive. They've opted for descriptive names over meta-marking with capitols or symbols, which I love.

:)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Multiple Cars not working 1 Answer

A node in a childnode? 1 Answer

Admob code question 1 Answer

C# How to Detect Edges of a Collider 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges