Click here to Skip to main content
15,902,635 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Code analysis sucks Pin
BryanFazekas24-Oct-19 0:41
BryanFazekas24-Oct-19 0:41 
GeneralRe: Code analysis sucks Pin
#realJSOP24-Oct-19 0:58
professional#realJSOP24-Oct-19 0:58 
GeneralRe: Code analysis sucks Pin
johannesnestler24-Oct-19 1:23
johannesnestler24-Oct-19 1:23 
GeneralRe: Code analysis sucks Pin
Dean Roddey24-Oct-19 6:26
Dean Roddey24-Oct-19 6:26 
GeneralPerhaps ... Re: Code analysis sucks Pin
Davie2124024-Oct-19 4:38
Davie2124024-Oct-19 4:38 
GeneralRe: Perhaps ... Re: Code analysis sucks Pin
Dean Roddey24-Oct-19 6:24
Dean Roddey24-Oct-19 6:24 
GeneralRe: Perhaps ... Re: Code analysis sucks Pin
Davie2124024-Oct-19 7:26
Davie2124024-Oct-19 7:26 
GeneralRe: Code analysis sucks Pin
Steve Naidamast24-Oct-19 7:36
professionalSteve Naidamast24-Oct-19 7:36 
I never use any form of code analysis tool, though I have tried a few in the past. Such tools, as you pointed out, merely throw up a voluminous amount of errors and warnings, most of which are meaningless. And I have never found such an issue that I would rewrite my code in such a fashion.

I have been coding for nearly 5 decades and if by that time you have not developed a clean, efficient style of development, you are not going to. And a code analysis tool will not help you much.

What code analysis tools find are those issues applied against the set of paradigms a the vendor of a particular tool want you to follow. Such paradigms are neither correct or incorrect. If you want to follow them that is perfectly fine.

However, most developers do their work from a very personal standpoint and take pride in their work from such a position. As a result, such development will often find the issues that you found with Visual Studio's Code Analyzer tool.

And again, mist such issues are meaningless.

There are some exceptions to this however where such tools demonstrate the more efficient method of developing your logic. However, a lot of this is all relative. For example, I still use ArrayLists quite heavily in my code. Why would I do this when it is already known that List<t> collections are more efficient as the following description from StackOverflow demonstrates?



>
Yes, pretty much. List<t> is a generic class. It supports storing values of a specific type without casting to or from object (which would have incurred boxing/unboxing overhead when T is a value type in the ArrayList case). ArrayList simply stores object references. As a generic collection, List<t> implements the generic IEnumerable<t> interface and can be used easily in LINQ (without requiring any Cast or OfType call).



ArrayList belongs to the days that C# didn't have generics. It's deprecated in favor of List<t>. You shouldn't use ArrayList in new code that targets .NET >= 2.0 unless you have to interface with an old API that uses it.

<<<

Because whether you use an ArrayList or a List<t> is one, a personal preference, and two only efficient in the amount of data being processed. So for example, if I use an ArrayList to process 50 stored structures in a for-each loop, do you really think that by using a List<t> collection it will make such a process more efficient to the end user? Highly unlikely, since all such processes are done in milliseconds and people who insist that others follow the List<t> protocol when there is no need to are merely wasting everyone's time.

Of course, if you plan to process several thousand objects in such a loop than the use of the List<t> collection makes a
lot more sense.

But for me, the amount of data I process in an ArrayList is just as efficient as if I had used a List<t> collection type.

And finally, all of my code can be read and understood by a person less experienced than I than if I had coded it with modern or current standards that have added levels of such obscurity as to make most such such code rather arcane in my view.

Given this, then using a code analyzer serves its purpose if you are intent on developing using current paradigm approaches to your development. And in most such tools, you can turn off a lot of the rules they go by. However, this can be a lot of work and almost to the point of not making it worth the effort. And trying to enter the rules listing in Visual Studio 2019 to review the number of settings that should be able to modified appears to keep crashing the IDE.
Steve Naidamast
Sr. Software Engineer
Black Falcon Software, Inc.
blackfalconsoftware@outlook.com

GeneralRe: Code analysis sucks Pin
Dean Roddey24-Oct-19 15:54
Dean Roddey24-Oct-19 15:54 
QuestionHow do you know when the TOTD is a Dad joke? PinPopular
littleGreenDude23-Oct-19 6:56
littleGreenDude23-Oct-19 6:56 
GeneralThought of the Day Pin
OriginalGriff23-Oct-19 4:51
mveOriginalGriff23-Oct-19 4:51 
GeneralRe: Thought of the Day Pin
musefan23-Oct-19 5:02
musefan23-Oct-19 5:02 
GeneralRe: Thought of the Day Pin
Johnny J.23-Oct-19 6:37
professionalJohnny J.23-Oct-19 6:37 
GeneralRe: Thought of the Day Pin
musefan23-Oct-19 21:10
musefan23-Oct-19 21:10 
GeneralRe: Thought of the Day Pin
jeron123-Oct-19 5:18
jeron123-Oct-19 5:18 
GeneralRe: Thought of the Day Pin
Daniel Pfeffer23-Oct-19 5:55
professionalDaniel Pfeffer23-Oct-19 5:55 
GeneralRe: Thought of the Day Pin
Daniel Pfeffer23-Oct-19 5:58
professionalDaniel Pfeffer23-Oct-19 5:58 
GeneralRe: Thought of the Day Pin
W Balboos, GHB23-Oct-19 6:41
W Balboos, GHB23-Oct-19 6:41 
GeneralRe: Thought of the Day Pin
MKJCP24-Oct-19 2:10
MKJCP24-Oct-19 2:10 
GeneralIt's weird when... Pin
Marc Clifton23-Oct-19 2:40
mvaMarc Clifton23-Oct-19 2:40 
GeneralRe: It's weird when... PinPopular
CodeWraith23-Oct-19 2:51
CodeWraith23-Oct-19 2:51 
GeneralRe: It's weird when... Pin
PeejayAdams23-Oct-19 3:13
PeejayAdams23-Oct-19 3:13 
GeneralRe: It's weird when... Pin
CPallini23-Oct-19 3:19
mveCPallini23-Oct-19 3:19 
GeneralRe: It's weird when... Pin
Mike Hankey23-Oct-19 3:24
mveMike Hankey23-Oct-19 3:24 
JokeRe: It's weird when... Pin
Daniel Pfeffer23-Oct-19 4:08
professionalDaniel Pfeffer23-Oct-19 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.