4 ms·
> you can have functions like pdf_page_cmd_l(page, x, y) oh, no, please don't. just use c++ and you can have namespaces or classes to control visibility - the
by zabzonk 4y ago
> you can have functions like pdf_page_cmd_l(page, x, y)
oh, no, please don't.
just use c++ and you can have namespaces or classes to control visibility - there is no need to take on all the other c++ stuff if you don't want it.
- qsort 4y agoEven if you're using C++ internally, you're likely exposing a C API behind extern C, so you don't have access to those features at the API boundary.
- lelanthran 4y agoBut then it stops being a general tool that is used by python, PHP, java, lisp, C++, rust, nim, zig, lisp and becomes a specific tool for C++ programs.
- synergy20 4y agoC is truly the only universal common denominator for all other languages, C++ indeed is only for itself.
- wruza 4y agoHow would you use that in this case? These cmd_l ops are just similar ops to different objects, like pen on paper vs. brush on canvas. They don’t operate on a single type of object. I’d say that C++ way is a bad idea here, because it usually begs for some compoinherimorphism with operator overloads that makes things 10x worse for the cost of one additional signature.
- cozzyd 4y agoAside from the interlanguage interop issues, c++-like visibility control (via private) makes ABI compatibility essentially impossible.