Message 1 of 8
what's the idea behind the commonly used oDoc, oRule, sText, and oColl in code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I often come across names like these in code: oDoc, oRule, sText and oColl. I was wondering what the idea behind this is. Perhaps it is because I don't have a lot of experience in programming yet, but I don't find it easy to read. Wouldn't it make the code easier to read if the names were a bit more descriptive?
For instance, I find this a lot harder to read:
Dim oAsmDoc As Inventor.AssemblyDocument = ThisDoc.Document Dim oPars As Inventor.Parameters = oAsmDoc.ComponentDefinition.Parameters Dim oList As Collection = New Collection For Each oPar As Inventor.Parameter In oPars If (Left(oPar.Name, 2) = "G_") Then oList.Add(oPar.Name) End If Next
Than this:
Dim this_document As Inventor.AssemblyDocument = ThisDoc.Document Dim own_parameters As Inventor.Parameters = this_document.ComponentDefinition.Parameters Dim own_global_parameters As Collection = New Collection For Each own_parameter As Inventor.Parameter In own_parameters If (Left(own_parameter.Name, 2) = "G_") Then own_global_parameters.Add(own_parameter.Name) End If Next
Thoughts/feedback appreciated.