Naming for Namespace, Class, and Variables

subaru_sti

Active member
Joined
Jul 4, 2009
Messages
34
Programming Experience
Beginner
Hello.

I'm new to OOP and am racking my brain over what to name stuff... I have read a lot of different articles on standards and when to use nouns and different case, etc... I'm stumped when it comes to a real world example. In the code below, the namespace is called "Navigation" which I think is correct. Then I have a class called "Heading", which by definition is the direction a person/vehicle is truly pointing towards. I think that is also named correctly. In the code below, I have four things I have named: _WhatToName1, WhatToName2, WhatToName3, and WhatToName4.


The value that gets passed in and stored is a double between 0 and 360 -- essentially the degree value from a circle. For WhatToName3 and WhatToName4, I have seen a lot of places that just use "value" as the name. Is that standard?

VB.NET:
Namespace Navigation
    Public Class Heading
        Private _WhatToName1 As Double

        Public Sub New(ByVal WhatToName3 As Double)
            Me.WhatToName2 = WhatToName3
        End Sub

        Public Property WhatToName2() As Double
            Get
                Return _WhatToName1
            End Get
            Set(ByVal WhatToName4 As Double)
                _WhatToName1 = WhatToName4
            End Set
        End Property
    End Class
End Namespace

As I am just learning, I want to make sure that I start naming stuff correctly so that it can be easily reused and understood.

Thanks in advance for your help,

Stephen
 
Actually, given that you're moving at a particular angle I would think Heading or Bearing would be the most appropriate property name. I know you mentioned Heading before but I'm not going to read back to find out where.
 
Back
Top