Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Objects Object-Oriented Programming Fields

Joe Whitehead
Joe Whitehead
2,179 Points

Variable naming conventions

In the previous course, C# Basics, it was taught that variables use camelCase for their naming conventions and Methods/Classes will use PascalCase - yet in this example you have named your Width and Height variables in the Map class with PascalCase, using capital letters at the start. Is this a mistake or is there a difference in what variable naming convention you use when setting class variables to be accessed by other classes?

1 Answer

Joe Whitehead
Joe Whitehead
2,179 Points

So it seems if I was patient enough for 1 more video the tutor explains that Method and public instance variables should always begin with a capital letter. Although almost any other article/support forum I have looked at suggests it should all be camelCase for any variable.