I frequently type un-compilable code or comments to myself...
-
...to remind myself of my thoughts when I quit last time, but this comment takes the cake: ; DO SOMETHING, I DON'T KNOW WHAT, BUT DO IT HERE..
I was recently told that REM stood for REMark and did the same as
'
in VB or//
in C#... I was very tempted to put something like REM - Losing My Religion above every Class I made :laugh:It's an OO world.
-
...to remind myself of my thoughts when I quit last time, but this comment takes the cake: ; DO SOMETHING, I DON'T KNOW WHAT, BUT DO IT HERE..
-
Few interesting comments : int i=10; //Don't forget //DO NOT REMOVE THIS COMMENT. REMOVING IT WILL AFFECT THE BUILD PROCESS
- Bits and Bytes Rules! 10(jk)
I hate comments that are there just because 'code should be commented'... I see stuff like
' This sub gets info from the database.
Public Sub GetInfoFromDataBase(connString As String)
'blah blah blah...' Open the connection.
conn.Open' Check if the value is not DBNull or Nothing.
If dataRow("someColumn").Value IsNot DBNull.Value AndAlso dataRow("someColumn").Value IsNot Nothing Then
' Do stuff...
End If'etc.
End SubAnd then when there really is a whole lot of unreadable code no one commented it... :~
It's an OO world.
-
I hate comments that are there just because 'code should be commented'... I see stuff like
' This sub gets info from the database.
Public Sub GetInfoFromDataBase(connString As String)
'blah blah blah...' Open the connection.
conn.Open' Check if the value is not DBNull or Nothing.
If dataRow("someColumn").Value IsNot DBNull.Value AndAlso dataRow("someColumn").Value IsNot Nothing Then
' Do stuff...
End If'etc.
End SubAnd then when there really is a whole lot of unreadable code no one commented it... :~
It's an OO world.
Agreed. I really hate it when, in C#, someone just puts the method name where there is supposed to be a summary of what the method does.
/// <summary>
/// Method Name
/// </summary>
public void MethodName()
{
//uncommented code here...
}Just because the code works, it doesn't mean that it is good code.
-
Agreed. I really hate it when, in C#, someone just puts the method name where there is supposed to be a summary of what the method does.
/// <summary>
/// Method Name
/// </summary>
public void MethodName()
{
//uncommented code here...
}Just because the code works, it doesn't mean that it is good code.
C# guidelines. Method names should be descriptive. Why would you need comments?
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
C# guidelines. Method names should be descriptive. Why would you need comments?
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
C# guidelines. Method names should be descriptive. Why would you need comments?
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
It took me a bit longer than I'd like to admit to detect the sarchasm.
-
I hate comments that are there just because 'code should be commented'... I see stuff like
' This sub gets info from the database.
Public Sub GetInfoFromDataBase(connString As String)
'blah blah blah...' Open the connection.
conn.Open' Check if the value is not DBNull or Nothing.
If dataRow("someColumn").Value IsNot DBNull.Value AndAlso dataRow("someColumn").Value IsNot Nothing Then
' Do stuff...
End If'etc.
End SubAnd then when there really is a whole lot of unreadable code no one commented it... :~
It's an OO world.
-
It took me a bit longer than I'd like to admit to detect the sarchasm.
But in the end, you did detect it.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
But in the end, you did detect it.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
I am but a naive human being, and it's going to be my downfall.
-
I hate comments that are there just because 'code should be commented'... I see stuff like
' This sub gets info from the database.
Public Sub GetInfoFromDataBase(connString As String)
'blah blah blah...' Open the connection.
conn.Open' Check if the value is not DBNull or Nothing.
If dataRow("someColumn").Value IsNot DBNull.Value AndAlso dataRow("someColumn").Value IsNot Nothing Then
' Do stuff...
End If'etc.
End SubAnd then when there really is a whole lot of unreadable code no one commented it... :~
It's an OO world.
That (well, the first part) is what you get with coding standards that mandate comments (and function headers, referring to the subthread above). Comments should be there to explain something non-trivial (i.e. that a two second glance at the code won't give you), imo – a summary of a multi-line complex piece of logic, or an explanation as to why you want to do what the code is doing.
-
C# guidelines. Method names should be descriptive. Why would you need comments?
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
Yes, the method names should be descriptive. In my experience the ones who don't use descriptive method names also don't bother to write good comments. Also, sometimes, even a good method name can use a little extra description now and then. ;) :)
Just because the code works, it doesn't mean that it is good code.