4 ms·
It's faster to read the comments than to both trace and digest the code, no matter how understandable it is. Then you have incomplete experience with developme
by stcredzero 17y ago
It's faster to read the comments than to both trace and digest the code, no matter how understandable it is.
Then you have incomplete experience with development environments. Debug/trace is so easy in VisualWorks Smalltalk, that a lot of people use it to comment by including example code snippets meant to be debugged. Yes, let me say it again: debugging is so easy you can use it to comment! For the right kind of situation, this can indeed be the best way to comment code. Sometimes no description is going to be as helpful as just seeing an example of it happen.
Does this apply to other environments? Not necessarily. In VisualWorks, it's usually no problem to spawn off multiple "hypothetical" debug sessions, with no consequence, even if you are already in the debugger. A lot of people also prefer to code in the debugger. If the cost of debugger use were different, then it would not be so.
- dbz 17y agoI disagree with pretty much everything you said- except anything which is your opinion- I can't disagree with that. I've worked with different development environments and even if my experience is incomplete, it is still experience and I know the usefulness of a debugger. I also know how useful it is to comment out lines of code which will help the reader understand the code's process (and my thought process). However, I disagree entirely that a debugger is better than a few well placed (or a lot of well placed) comments. Comments allow you not to have to digest and understand the code, and with a debugger you will still need to digest code. No matter how "good" you are at using a debugger. Comments are gold when used appropriately, and we (the person you are responding to and I) are only referring to the good type of comments. Bad comments are as good as giant commented out sections of code that belong to another program.
- stcredzero 17y agoI disagree with pretty much everything you said- except anything which is your opinion- I can't disagree with that. Actually, you don't disagree with everything I said. I don't see how you can, unless you have an encyclopedic knowledge of Smalltalk systems. You apparently disagree with a more extreme misreading of it. You're likely using rules of thumb developed while working in other environments, which may not be as universal as you think. A synopsis of what I actually said: I know of one context where sometimes debugging is easier than reading comments. What is it that you think I said which you disagree with? Comments allow you not to have to digest and understand the code, and with a debugger you will still need to digest code. Sometimes even the underlying concept is hard to grok from a written description, but easier to see played out. Sometimes the concept can be more difficult than any part of the code. Also, if your debugger is friendly enough, digesting running, tweakable, explorable code can be considerably easier than a static reading. No matter how "good" you are at using a debugger. I have been teaching an intro class where some egghead Wall Street quant spontaneously exclaimed: "Oh my gosh, this debugger is MAGIC!" From the assumptions you carry around, it seems likely you just lack the same kind of experience. The order of magnitude is about the same as going to GDB from no debugger at all.
- foldr 17y agoWhy do you have such a bee in your bonnet about Smalltalk? Are we not allowed to discuss the pros and cons of various commenting styles in other programming languages without you stopping by to evangelize? People who brag about their "encyclopedic" knowledge are usually about as welcome as encyclopedia salesmen.
- stcredzero 17y agoLook at the context again. Was I bragging about my knowledge, or questioning the amount of specific relevant experience of the other poster? Now, what was your point again?
- foldr 17y ago>Was I bragging about my knowledge, or questioning the amount of specific relevant experience of the other poster? Yes. I suppose bragging is a matter of interpretation, but you were certainly questioning his experience. E.g. you said: > From the assumptions you carry around, it seems likely you just lack the same kind of experience. Implying that the OP held mistaken views on commenting due to his lack of experience with Smalltalk debuggers. >Now, what was your point again? I was really asking a question rather than making a point. (I would say something about reading comprehension, but ...)
- stcredzero 17y agoPlease re-read this post. You've capitulated to the point I was making, which refutes your "bragging" claim. Now perhaps I should make a point about "writing comprehension."
- foldr 17y agoI have no idea which "point" you are referring to, please write more clearly.
- dbz 17y ago