Announcement

Collapse
No announcement yet.

DAV1D: A New AV1 Video Decoder From The VideoLAN Developers

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

  • #81
    Originally posted by andreano View Post

    Being so careful about memory management that you're no longer writing idiomatic C++.

    Case in point: Slices.

    * If your codebase consists of functions that operate on arrays, this is a profoundly influential concept (to your function signatures anyway).
    * My impression of codec code is: Arrays. And functions. And pages and pages of static const arrays.

    Go and Rust have slices. C++17 has only string slices (std::string_view), but you can of course implement your own generic slice<T> yourself. Or stick with pointers and sizes like it's C → problem solved.
    Or use boost -- as always

    Originally posted by andreano View Post

    For those that may not know; this is the wrong way to write functions that take array-like arguments:


    Code:
    void f1(const std::string&);
    void f2(const std::vector<T>&);
    It highly depends on what you're doing.

    Comment


    • #82
      Originally posted by Weasel View Post
      Yeah the right way is:
      Code:
      void f1(const char*);
      void f2(const T*);
      // and so on
      ...obviously, high level abstractions for interfaces are retarded.
      Sweet, a programing tip from our favourite C troll. But I'm really disappointed. Such high level stuff as typed pointers is retarded. Void* should be enough for a real 1337 h4x0r like you?!?!

      Comment


      • #83
        Originally posted by oleid View Post
        Sweet, a programing tip from our favourite C troll. But I'm really disappointed. Such high level stuff as typed pointers is retarded. Void* should be enough for a real 1337 h4x0r like you?!?!
        The sad part is, that you're actually serious in thinking I'm a troll for this when I was dead serious. What a shame software must be these days with such guidelines.

        Also static typing isn't an abstraction since they literally compile to the same thing and are only useful for compilation purposes, you can cast them anyway if you need something else.

        Comment


        • #84

          No, the sad part is, that you're dead serious.


          Also static typing isn't an abstraction since they literally compile to the same thing and are only useful for compilation purposes.

          sure it's an abstraction, albeit zero cost. Like iterators in combination with folds in some programming languages. Or optional data types, which compile down to pointers (null pointer in the none-case). And like most abstractions, they exist to help the programmer and sometimes even the compiler to reason about code.

          Comment


          • #85
            First time I hear someone say that static typing is an abstraction. Usually, abstraction is supposed to give you less stuff to think about. Static typing is the opposite of that.

            But static typing doesn't affect code generation and I don't mean only "cost" here, I mean literally the implementation of the standard library. There's no guarantee two standard libraries have the same implementation (e.g. GCC and Clang). With raw types, it's perfectly fine to mix them in interfaces. So no, it's not the same.

            Comment


            • #86
              Originally posted by Weasel View Post
              First time I hear someone say that static typing is an abstraction. Usually, abstraction is supposed to give you less stuff to think about. Static typing is the opposite of that.
              It's an abstraction over the raw bytes in memory.

              Comment

              Working...
              X