General Discussion

General DiscussionAyy lmao

Ayy lmao in General Discussion
Tribo

    what teh fuck guys

    faw

      [video]https://2ch.hk/vg/src/28124245/15410927132840.mp4[/video]

      faw

        :ok: :cool:

        Tribo

          nice mp4 video
          brokeBack

          one syllable anglo-saxon

            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

            Tribo

              use google
              MAYBE
              google scholar 4Head

              Bu yorum düzenlendi
              Riguma Borusu

                @today's active lifestyles
                if this is how you approach the craft, give up right away, it's not for you

                faw

                  what "main differences" do u mean? i think c# is pretty similar to java rather than c++ so mb i can help

                  one syllable anglo-saxon

                    ok thanks withdrawing documents from my uni tomorrow (moron)

                    one syllable anglo-saxon

                      what "main differences" do u mean?

                      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++

                      Riguma Borusu

                        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.

                        Bu yorum düzenlendi
                        faw

                          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

                          ywn

                            ok thanks withdrawing documents from my uni tomorrow (moron)

                            dabbed on

                            Riguma Borusu

                              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:

                              namespace

                              Bu yorum düzenlendi
                              faw

                                i dont think he needs namespaces for a small project like that

                                just shit a gui and submit it

                                one syllable anglo-saxon

                                  u can take ur nice little lecture u just wrote up and shove it up your ass, okay?

                                  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

                                  not really, already got dabbed on by syntax/basics(i assume)

                                  this piece aka how i would do it in cpp

                                  public string Name;
                                  
                                  public int YearFounded;
                                  public ArtistPiece(string n, int y) {
                                  Name = n;
                                  YearFounded = y;
                                  }

                                  +
                                   
                                  
                                  List<ArtistPiece> persons = new List<ArtistPiece>();
                                  persons.Add(new ArtistPiece("asdasd", 123));
                                  dataGridView1.DataSource = persons;

                                  doesn't work even though the list gets properly filled - it doesn't get displayed in the gui

                                  however, if i change it to

                                  public string Name;
                                  
                                  public string Name { get; set; }
                                  public int YearFounded { get; set; }

                                  +
                                   
                                  
                                  List<ArtistPiece> persons = new List<ArtistPiece>();
                                  persons.Add(new ArtistPiece() { Name = "asdasd", YearFounded = 123 });
                                  dataGridView1.DataSource = persons;

                                  works just fine

                                  ywn

                                    LMAO

                                    faw

                                      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

                                      Riguma Borusu

                                        u can take ur nice little lecture u just wrote up and shove it up your ass, okay?

                                        I'll have a cheeseburger with fries. Make them salty. Thanks.

                                        ywn

                                          at least you can retire early on your huge TA salary

                                          Riguma Borusu

                                            ^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.

                                            one syllable anglo-saxon

                                              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

                                              Riguma Borusu

                                                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

                                                Bu yorum düzenlendi
                                                ywn

                                                  if this is how you approach the craft, give up right away, it's not for you

                                                  Riguma Borusu

                                                    ^my brain is deformed to the point that when I am annoyed by people not knowing shit I have to explain it to them

                                                    DC.MASON

                                                      is that why you're a teacher?

                                                      Riguma Borusu

                                                        no idea

                                                        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.

                                                        Bu yorum düzenlendi
                                                        faw

                                                          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

                                                          faw

                                                            anyway c# is garbage and idk why any1 would bother learning that shit

                                                            ywn

                                                              to learn the CRAFT?

                                                              Riguma Borusu

                                                                @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++.

                                                                Bu yorum düzenlendi
                                                                Riguma Borusu

                                                                  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.

                                                                  adsa21313132

                                                                    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.

                                                                    Riguma Borusu

                                                                      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

                                                                      Aimstrong

                                                                        Aimstrong

                                                                          Totentanz to The King: M ...

                                                                            Why you do my boy triple dirty like that, only I can do him dirty

                                                                            Tribo

                                                                              But thats gay

                                                                              Riguma Borusu

                                                                                gay okay according to dbuff

                                                                                Mekarazium

                                                                                  its okay to be gay, let's rejoice with the boys in a gay way

                                                                                  Guess who

                                                                                    ew

                                                                                    Tribo

                                                                                      the fook

                                                                                      faw

                                                                                        WeirdChamp

                                                                                        Tribo

                                                                                          indeed people here gay n retarded
                                                                                          damn mixtures gone wrong :'D

                                                                                          DC.MASON

                                                                                            see me in melty blood

                                                                                            Tribo

                                                                                              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

                                                                                              faw

                                                                                                warcraft 3 remake pogchamp

                                                                                                感じない

                                                                                                  snorestone ResidentSleeper

                                                                                                  Aimstrong

                                                                                                    mobile game...