Skip to main content
2 of 5
added 229 characters in body
Raystafarian
  • 7.3k
  • 11
  • 15

I keep a text file of my most used excerpts that I can pull from for common mistakes. e.g.

Integers - [integers are obsolete](http://stackoverflow.com/questions/26409117/why-use-integer-instead-of-long/26409520#26409520). According to [msdn](https://msdn.microsoft.com/en-us/library/office/aa164506(v=office.10).aspx) VBA *silently* converts all integers to `long`. 

[Standard VBA naming conventions](https://msdn.microsoft.com/en-us/library/1s46s4ew(v=vs.140).aspx) have `camelCase` for local variables and `PascalCase` for other variables and names.

I tell them what is wrong, a brief reason why it is wrong and links to read if need be. Another example is

Comments - ["code tell you how, comments tell you why"](http://blog.codinghorror.com/code-tells-you-how-comments-tell-you-why/). The code should speak for itself, if it needs a comment, it might need to be made more clear. If not, the comment should describe *why* you're doing something rather than *how* you're doing it. Here are a [few reasons](http://programmers.stackexchange.com/a/254979/125931) to avoid comments all together.



I could easily write a blog post on my website that explains the why or link to another answer of mine - but then they need to sift through the rest of the other answer to find what I'm talking about.

I could link to someone else's why e.g.

Mathieu Guindon (Microsoft Excel MVP, 2018) [reasons](https://rubberduckvba.wordpress.com/2018/01/12/progress-indicator/) that blah blah

For beginner VBA questions I always feel like it's important to give a reference as to what I'm talking about because the majority of beginner VBA questions usually don't have any background in coding in the first place (myself included some 5 years ago).

For something like c# I might want to link to a Jon Skeet answer.

And maybe for something as basic as "you can use such and such namespace" I'm sure I could find a beginner tutorial or even a reference to an article or book that can help with the why of the basics - not the how.


I want to give the asker as much information as they could want even if they don't want it, for the same reason I want to explain what I can at other sites - for future visitors.

It's not like saying

Look at [link]

but more

you should do this because of reason. If you want more reference see [link].

I'm still giving them the why and if the link goes dead my statement still works.

Raystafarian
  • 7.3k
  • 11
  • 15