Quantcast
Channel: Objects and instance variables in loops - Code Review Stack Exchange
Browsing latest articles
Browse All 3 View Live

Answer by Steven Doggart for Objects and instance variables in loops

The reason that the first example would be considered problematic when multiple threads are involved, is because in that example, a Person object maintains state (i.e. data) and it has methods that act...

View Article



Answer by Ivaylo Slavov for Objects and instance variables in loops

In sample1, as you call it, you have an instance field which you change. Therefore, the Person class you are using is mutable. Mutable classes are prominent to concurrency issues if a single instance...

View Article

Objects and instance variables in loops

Is there anything wrong with doing this:Public Class Form1 Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load For value As Integer = 0 To 1000000 Dim p As New...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images