Announcement

Collapse
No announcement yet.

systemd Clocks In At More Than 1.2 Million Lines

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by cb88 View Post

    Except a massive amount of C code on Linux throws the type system out the window.. void and casts *everywhere* https://developer.gnome.org/gobject/...ject-Type.html
    Yeah, it's not typesafe. However, casts aren't inherently bad, just like pointers. Casts that tell the compiler to shut up are fine. Casts that attempt to change a type are (potentially) dangerous.

    But, hey, void() is better than the old C where everything defaulted to int/char pointers...

    Comment


    • #22
      I love how someone forgot to set up their clock properly and made commits in the future.

      Comment


      • #23
        Originally posted by Bsdisbetter View Post

        Yeah, it's not typesafe. However, casts aren't inherently bad, just like pointers. Casts that tell the compiler to shut up are fine. Casts that attempt to change a type are (potentially) dangerous.

        But, hey, void() is better than the old C where everything defaulted to int/char pointers...
        Yeah but they are inherently stupid, when you should just be using C with objects or C++ for that...

        Comment


        • #24
          Originally posted by cb88 View Post

          Except a massive amount of C code on Linux throws the type system out the window.. void and casts *everywhere* https://developer.gnome.org/gobject/...ject-Type.html
          OMG...
          What you refer to as "void and casts" are simply function pointers. They allow you to set your own functions - which is needed to implement something like OOP inheritance with GObject.

          Comment


          • #25
            Originally posted by cb88 View Post

            Except a massive amount of C code on Linux throws the type system out the window.. void and casts *everywhere* https://developer.gnome.org/gobject/...ject-Type.html
            All those instances of void mean, the function doesn't return anything. And those pointers, well, at least they aren't void* pointers. They have a type and yes, you can cast the type.


            But that's not specific to C. That is a property of raw pointers and you have the same behavior in c#.

            Comment


            • #26
              Originally posted by cb88 View Post

              Yeah but they are inherently stupid, when you should just be using C with objects or C++ for that...
              Horses for courses. I don't have a problem with the way gObject is implemented. I guess it comes down to it started out in C (probably because that's what the developers knew) and perhaps outgrew itself.
              I'm sure you can fork it off and start a c++ port...

              Comment


              • #27
                Thank you Lennart, I really appreciate this thing, ignore the haters, listen to the genuine critics.

                Comment


                • #28
                  Originally posted by Cape View Post

                  SO MUCH THIS!
                  Making GTK in C was a mistake. You need more tools to manage memory when you bring in advanced GUIs and especially when you need to pass around weird big data structures.
                  ??tools?? ??advanced GUIs??? ???? A data structure is just an address in memory. You 'pass around' using pointers.

                  Comment


                  • #29
                    Originally posted by microcode View Post
                    Thank you Lennart, I really appreciate this thing, ignore the haters, listen to the genuine critics.
                    Those that agree with him.

                    Comment


                    • #30
                      Originally posted by Cape View Post
                      Making GTK in C was a mistake. You need more tools to manage memory when you bring in advanced GUIs and especially when you need to pass around weird big data structures.
                      Its not that straight forwards. C has defined calling standard. C++ does not. Job went object c because they believed that would be better.

                      The hard reality there is not a good programming language for writing GUI. Every language you choose you have historically had to compromise something.


                      Comment

                      Working...
                      X