visual studio 2010 to follow strict OOP rules - visual-studio-2010

I am trying to learn coding that follow strict OOP concepts and best practices while writing a program.
Is there any feature/option in VS2010 that can allow only best programing practice else give error??
Thanks in advance

Not much it helps but there is something you can do.
In Solution Explorer right click to project and select properties, there will be a tab named "Compile". There you can edit warning and errors options.
There is "Option Strict" property, so make sure you change it to "ON". And below that there is a list you can specify warning configurations. Change any of them "warning" or "error"
I hope this will help you. Good luck with your learning.

Related

Display CodeLens above attributes

It is quite annoying to see codelens reference between the field and field's attributes. It requires to add a lot of additional spaces around to make everything readable. Is it possible to display CodeLens reference above the attributes?
No, this is currently not possible.
If you'd like to see this, I suggest you give the product team a shout-out on the Visual Studio UserVoice and post back the link as a comment to this answer. I'd suggest not to move the code lens information, but to suggest the location to be made configurable :).
Though I can't disclose any details, I've seen your feedback before and I know it has been considered, but rejected.
This is an old question but as an update to #jessehouwing this is Visual Studio team answer:
Dear supporters for this suggestion
Thank you for your feedback on this idea.
We designed the Code Lens indicator to be as close to the actual
function declaration as possible, to allow you to make a better
cognitive connection with it. At one point during the development of
Code Lens, we actually tried locating it above the attributes as this
suggestion requests. It looked great in simple cases, but
unfortunately it started to feel “disconnected” from the declaration
when more attributes were added. It really looked strange at around
three attributes, but started feeling a bit odd around two.
Here’s a pathological “real world” case which illustrates this -
https://github.com/dotnet/roslyn/blob/master/src/VisualStudio/CSharp/Impl/CSharpPackage.cs#L26
Imagine the indicator above the attributes in this case.
For this reason, we’re declining this suggestion at present.
Thanks! Mark Wilson-Thomas Program Manager, Visual Studio Editor Team
So sadly it won't be fixed, but after reading the whole answer, I have to agree.

Code smells reporting/tracking tool

I was wondering if you know any tools that help keep track of "code smells". So that team members could report some finding in the code and then possibly vote on the most problematic ones (in terms of future project development).
Any experiences?
Have you looked at find bugs or check style? Both of these are pretty good for this.
I would also recommend pmd. These let you analyse common problems such as not setting method parameters final.
Lastly, I'd recommend using Sonar as this will highlight any code errors in order of priority. Such as code that is knowingly going to through a NPE, it will highlight this to you and can be integrated with Jenkins.
All these together can really help you move towards the "Clean Code" mantra.

Someone to explain the mechanics for DSL language creation "in plain english"

Basically the problem is that I'm starting doing somme development of Visual Studio 2010 extensions and language definitions are rather complex, so anyone giving a small intro and pointing some good docs would be great
Thanks in advance,
EDIT My basic problem is that I want to define a simple language to create some models on Visual Studio 2k10 and generate some source code using such models. The problem is where can I find some nice books, or do I have to dig into MSDN to unveil the mask... :)
Again, thanks
Have you tried starting with the documentation here? If you found this difficult to start with, how could we make it easier to follow?

Class view in Visual studio

I see that I would benefit from using the class view in visual studio.
It would give me better overview over my classes, their methods and make it easier for me to see where and when to refactor my class. I assume that it would give me a better structure and enhance the readability of my code.
But....
I find it to awkward to use. I tried to get use it instead of solution explorer, It basically stranded before beginning. I find no similar functionality like "Track Active item in solution explorer".
Any idea on getting started on using the class view or that I just should forget it and stick to solution explorer and stay ignorant? ;)
Some years ago some people were sure that writing code will no longer exists and everything is going to be UML modeling, so I guess they were wrong.. its great power is initial model(as it name tells). Personally I found it slow clicking with the mouse and prefer writing my classes with coding..
The most important thing is to be productive. My advice is to try it (it helps in design), but if you don't feel comfortable with it, don't worry, a lof of good programmers don't know that it even exists :)

.Net XML comment into API Documentation

Is there an easy way to produce MSDN-style documentation from the Visual Studio XML output?
I'm not patient enough to set up a good xslt for it because I know I'm not the first person to cross this bridge.
Also, I tried setting up sandcastle recently, but it really made my eyes cross. Either I was missing something important in the process or it is just way too involved.
I know somebody out there has a really nice dead-simple solution.
I'm reiterating here because I think my formatting made that paragraph non-inviting to read:
I gave sandcastle a try but had a really hard time getting it set up.
What I really have in mind is something much simpler.
That is, unless I just don't understand the sandcastle process. It seemed like an awful lot of extra baggage to me just to produce something nice for the testers to work with.
You're looking for Sandcastle
Project Page: Sandcastle Releases
Blog: Sandcastle Blog
NDoc Code Documentation Generator for .NET used to be the tool of choice, but support has all but stopped.
Have a look at Sandcastle, which does exactly that. It's also one of the more simpler solutions out there, and it's more or less the tool of choice, so in the long run, maybe we could help you to set up Sandcastle if you specify what issues you encountered during setup?
You should also use the Sandcastle Help File Builder. It provides you with a ndoc like GUI for generating help files so you don't have to do anything from a command prompt.
Welcome to the Sandcastle Help File Builder Project
I've just set up Sandcastle again. Try installing it (the May 2008 release) and search for SandcastleGui.exe or something similar (it's in the examples folder or so).
Click Add Assembly and add your Assembly or Assemblies, add any .xml Documentation files (the ones generated by the compiler if you enabled that option) and then Build.
It will take some time, but the result will be worth the effort. It will actually look up stuff from MSDN, so your resulting documentation will also have the Class Inheritance all the way down to System.Object with links to MSDN and stuff.
Sandcastle seems a bit complicated at first, especially when you want to use it in an automated build, but I am absolutely sure it will be worth the effort.
Also have a look at Sandcastle Help File Builder, this is a somewhat more advanced GUI for it.
Follow this simple 5 step article and you are pretty much done. As a bonus you can use H2Viewer to view Html Help 2.x files.
I use NDoc3

Resources