d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Thread Help > Application Class Nullreference
Prev12
Add Reply New Topic New Poll
Member
Posts: 14,631
Joined: Sep 14 2006
Gold: 575.56
Sep 21 2016 09:22pm
you might be right actually... i was thinking i do it all the time at work because of MVVM and WebAPI but when i'm doing queries like that i usually end up adding whatever i created in the loop to a different list
gonna try it later maybe
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 21 2016 09:40pm
Quote
it's been a few years, but i think c# throws an error and won't let you do that at all. i dont have visual studio anymore, but try running it:


oops, i meant it gives a compile error*

This post was edited by carteblanche on Sep 21 2016 09:44pm
Member
Posts: 14,631
Joined: Sep 14 2006
Gold: 575.56
Sep 21 2016 10:44pm
ya, i understood

hey carte, you know about game of life, i cant decide on which data structure i like more,
creating a multi dimensional array for the grid rows/columns and running a nested loop to check them
or
a single dimensional array of objects that have row/column attributes and looping a switch on the index?

the single array is how i'm leaning cuz it seems like a smaller growth rate but the multidimensional array definitely looks a lot cleaner on the screen

This post was edited by Ideophobe on Sep 21 2016 10:45pm
Member
Posts: 7,324
Joined: Dec 22 2002
Gold: 1,261.00
Sep 23 2016 10:01am
Quote (carteblanche @ Sep 21 2016 07:03pm)

i'm always iffy describing it like that since java is always pass by value. for objects, it's the "value of reference". in c you can pass a reference and another function can change what the reference points to, but java you cannot. you just get the value that the reference points to.

referring to them always as reference can be a little confusing since it depends on what you mean by reference (do you mean the pointer or the result from the pointer?). usually in non-formal environments we know what you mean, but i'd be careful about using that term to teach someone how it works.


Why are you iffy describing it like that? All object variables are references to the object, there's no other or more formal way to say it that I can think of.
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll