any1 got some quick c# vids/tutorials for people who are familiar with c++ (i.e main differences)? i need to write a small gui application to view/alter my sql database in c# and a lot of stuff is pretty confusing to me and i have to do this shit till saturday(well i dont HAVE TO but it would be very nice) so i dont really have time to google shit for 10 hours
well thats kinda the problem - i dont know
visual studio is way smarter than me so it fixes up most of my shit so far but sooner or later i will get stuck because i dont know about some fundamental thing and assume it just works the same way it does in c++
I was actually serious, if you're gonna half ass shit and avoid learning languages/technologies properly, just give up entirely. That's not how you do it.
I don't know what year you are, but at some point people start dropping out, or worse yet, they manage to finish the university only to go flipping burgers when they realize they have no skills they can monetize because they never learned anything.
If you aren't willing to put time to properly learn things, you probably shouldn't have put 3000 hours into dota.
And yes, you are a moron.
i will get stuck because i dont know about some fundamental thing and assume it just works the same way it does in c++
Yes, and this is why you need to learn shit properly.
C++ and C# are designed and approached in entirely different ways, both conceptually and practically, they use entirely different frameworks to accomplish things, and most similarities between C++ and C# are surface level, I do believe you'll learn C# faster if you know no C++ because the 'knowledge' projected onto another language will be a red herring. C# used to be way more similar to C++ but the languages have seriously drifted apart over the years.
doesn't work even though the list gets properly filled - it doesn't get displayed in the gui
did u check what the list contains? i'd imagine the problem would be the fields in the first code, change them to properties like u did in the 2nd one and it should work as well
^my TA salary is actually tiny, I really use it only to get paid benefits and make some connections, other than that I work in a small team and do extra freelance stuff.
did u check what the list contains? i'd imagine the problem would be the fields in the first code, change them to properties like u did in the 2nd one and it should work as well
yes thats why i said it gets properly filled and yea obviously the {get; set;} statements were the culprit im just not sure why it works(or what it does) and doing it via constructor doesn't but whatever it works now
yes thats why i said it gets properly filled and yea obviously the {get; set;} statements were the culprit im just not sure why it works(or what it does) and doing it via constructor doesn't but whatever it works now
Those things are called accessors, and the reason you define them in C# is so you don't have to make separate getter/setter functions which are a serious anti-pattern in OOP. With accessors, you just need to define how your attribute can be approached, and it allows for a more consistent and sensible syntax than using something.setSomething(value).
When you put { get; set; } after an attribute, you're saying "you can use this to access the value, but also set the value". You can also define specific getters and setters if you want, as functions, inside those brackets, and they will still work with the object.attribute convention.
without at least {get;} , outside code can't actually get that attribute's values, so it won't be displayed
anyways, C# allows you to define getters and setters like this
int _number;
public int Number
{
get
{
return this._number;
}
set
{
this._number = value;
}
}
This does the same thing as:
public int Number {get; set;}
Note that in previous example, get and set are defined as functions (methods of the object). Both examples function the same way, but as you can see, you can modify the first example to do something less basic.
public string name; should still work for other implementations, no? (although u'd still make it private with get/set due to convention and shit) i just assume that his datagridview or whatever requires the get to display that data
@faw in C# you want to work under the smallest number of assumptions possible, which is why declaration of hierarchy/dependencies/visibility is so strict
public string Name;
This means there is no access restriction whatsoever. This means that the get/set accessors are implemented and usable from anywhere and is equivalent to adding the {get; set;} to
string name
The reason {get; set;} is often used is because defining them right away makes changes more streamlined in case you want to expand upon the functionalities of accessors, and because most variables won't actually have a public setter (it's arguably anti-OOP a lot of the time), people write code very explicitly.
Again, there's stuff like:
public string Name { get; private set; }
This one has publicly available getter meaning you can use Object.Name to get the value, but you can't do Object.Name = something to set it. This however does mean that you can set the value directly in the class it was defined in. This is analogous to having private setters and public getters in Java or C++.
anyway c# is garbage and idk why any1 would bother learning that shit
to learn the CRAFT?
Because there's a metric fuckton of code written in C# and C# isn't going anywhere. Javascript is garbage too, but hey, it's literally everywhere and it pays well.
But creating an object x with field public string name; that gets initialized by a constructor should work just fine without any explicit get and set, no? Just directly changing / accessing the field Object.name should work just fine generally?
Ofc it's garbage, just wondering if it works in c# just like in java or if you'll have to explicitly code a get and set.
hey there are OR and AND gates but also XOR NOR NAND XASDASDNG ANDOR SUCK A DOR
> literally my class filled with monkeys unable to understand jack shit bout Logic Gates :'D
what teh fuck guys
[video]https://2ch.hk/vg/src/28124245/15410927132840.mp4[/video]
:ok:
nice mp4 video
brokeBack
any1 got some quick c# vids/tutorials for people who are familiar with c++ (i.e main differences)? i need to write a small gui application to view/alter my sql database in c# and a lot of stuff is pretty confusing to me and i have to do this shit till saturday(well i dont HAVE TO but it would be very nice) so i dont really have time to google shit for 10 hours
use google
MAYBE
google scholar 4Head
@today's active lifestyles
if this is how you approach the craft, give up right away, it's not for you
what "main differences" do u mean? i think c# is pretty similar to java rather than c++ so mb i can help
ok thanks withdrawing documents from my uni tomorrow (moron)
well thats kinda the problem - i dont know
visual studio is way smarter than me so it fixes up most of my shit so far but sooner or later i will get stuck because i dont know about some fundamental thing and assume it just works the same way it does in c++
I was actually serious, if you're gonna half ass shit and avoid learning languages/technologies properly, just give up entirely. That's not how you do it.
I don't know what year you are, but at some point people start dropping out, or worse yet, they manage to finish the university only to go flipping burgers when they realize they have no skills they can monetize because they never learned anything.
If you aren't willing to put time to properly learn things, you probably shouldn't have put 3000 hours into dota.
And yes, you are a moron.
Yes, and this is why you need to learn shit properly.
dunno, the main differences would probably be that u dont need to use garbage collection & there are full and easy to use GUI frameworks
syntax and shit should be fairly similar
dabbed on
C++ and C# are designed and approached in entirely different ways, both conceptually and practically, they use entirely different frameworks to accomplish things, and most similarities between C++ and C# are surface level, I do believe you'll learn C# faster if you know no C++ because the 'knowledge' projected onto another language will be a red herring. C# used to be way more similar to C++ but the languages have seriously drifted apart over the years.
Let me teach you your new favorite word:
i dont think he needs namespaces for a small project like that
just shit a gui and submit it
u can take ur nice little lecture u just wrote up and shove it up your ass, okay?
not really, already got dabbed on by syntax/basics(i assume)
this piece aka how i would do it in cpp
+
doesn't work even though the list gets properly filled - it doesn't get displayed in the gui
however, if i change it to
+
works just fine
LMAO
did u check what the list contains? i'd imagine the problem would be the fields in the first code, change them to properties like u did in the 2nd one and it should work as well
I'll have a cheeseburger with fries. Make them salty. Thanks.
at least you can retire early on your huge TA salary
^my TA salary is actually tiny, I really use it only to get paid benefits and make some connections, other than that I work in a small team and do extra freelance stuff.
yes thats why i said it gets properly filled and yea obviously the {get; set;} statements were the culprit im just not sure why it works(or what it does) and doing it via constructor doesn't but whatever it works now
Those things are called accessors, and the reason you define them in C# is so you don't have to make separate getter/setter functions which are a serious anti-pattern in OOP. With accessors, you just need to define how your attribute can be approached, and it allows for a more consistent and sensible syntax than using something.setSomething(value).
When you put { get; set; } after an attribute, you're saying "you can use this to access the value, but also set the value". You can also define specific getters and setters if you want, as functions, inside those brackets, and they will still work with the object.attribute convention.
without at least {get;} , outside code can't actually get that attribute's values, so it won't be displayed
if this is how you approach the craft, give up right away, it's not for you
^my brain is deformed to the point that when I am annoyed by people not knowing shit I have to explain it to them
is that why you're a teacher?
no idea
anyways, C# allows you to define getters and setters like this
This does the same thing as:
Note that in previous example, get and set are defined as functions (methods of the object). Both examples function the same way, but as you can see, you can modify the first example to do something less basic.
ye what he said
public string name; should still work for other implementations, no? (although u'd still make it private with get/set due to convention and shit) i just assume that his datagridview or whatever requires the get to display that data
anyway c# is garbage and idk why any1 would bother learning that shit
to learn the CRAFT?
@faw in C# you want to work under the smallest number of assumptions possible, which is why declaration of hierarchy/dependencies/visibility is so strict
This means there is no access restriction whatsoever. This means that the get/set accessors are implemented and usable from anywhere and is equivalent to adding the {get; set;} to
The reason {get; set;} is often used is because defining them right away makes changes more streamlined in case you want to expand upon the functionalities of accessors, and because most variables won't actually have a public setter (it's arguably anti-OOP a lot of the time), people write code very explicitly.
Again, there's stuff like:
This one has publicly available getter meaning you can use Object.Name to get the value, but you can't do Object.Name = something to set it. This however does mean that you can set the value directly in the class it was defined in. This is analogous to having private setters and public getters in Java or C++.
Because there's a metric fuckton of code written in C# and C# isn't going anywhere. Javascript is garbage too, but hey, it's literally everywhere and it pays well.
But creating an object x with field public string name; that gets initialized by a constructor should work just fine without any explicit get and set, no? Just directly changing / accessing the field Object.name should work just fine generally?
Ofc it's garbage, just wondering if it works in c# just like in java or if you'll have to explicitly code a get and set.
In a lot of cases, it'll be the same thing.
However, if you're wondering why you should define properties rather than public variables, there's a good answer/discussion here:
https://stackoverflow.com/questions/1180860/public-fields-versus-automatic-properties
Why you do my boy triple dirty like that, only I can do him dirty
But thats gay
gay okay according to dbuff
its okay to be gay, let's rejoice with the boys in a gay way
ew
the fook
WeirdChamp
indeed people here gay n retarded
damn mixtures gone wrong :'D
see me in melty blood
hey there are OR and AND gates but also XOR NOR NAND XASDASDNG ANDOR SUCK A DOR
> literally my class filled with monkeys unable to understand jack shit bout Logic Gates :'D
https://www.youtube.com/watch?time_continue=33&v=WShCN-AYHqA
warcraft 3 remake pogchamp
snorestone ResidentSleeper
mobile game...