Announcement
Collapse
No announcement yet.
April Fools' Or Should Wayland Switch Away From Using C?
Collapse
X
-
Originally posted by cipri View Post
Heartbleed was also caused by a "skilled c developer".
cipri
- Likes 3
Comment
-
Originally posted by cipri View PostThis is like I do my c++17 gui framework. The wayland part I hide in a "unsafe class". It's very sad, that wayland is forcing me to use "reinterpet_cast", which is something like a little time-bomb. At least I found a way to put the unsafe stuff more tightly together instead of spreading it all over the framework.
It means if something goes wrong (likes leaks and crashes) it will be because of the framework, and not because of the user of the framework.
With c++ you can have the same speed (or faster!) and having at the same time more safety.
The c example of wayland clients/servers could look in c++ easier to follow with less code, better structured....
There is a good reason why you barely find applications based on wayland directly! Gnome and KDE are working since years on wayland support and it's still not ready. If lib-wayland would be done with c++14 and being well designed, writing wayland clients would be a triviality! It would be easier than using QT [since QT has old style c++ api].
cipri
Write X using a higher level programming language, people will complain it's not flexible and interoperable enough. Write X using a lower level programming language, people will complain of the learning curve and the effort it takes to develop for it.
And here comes the shocking newsflash: this is what engineering is all about, trying to come up with a solution that will please a sufficient number of people, knowing fully well you can't please everybody no matter what. If there was a way to reliably order the quality of solutions, an algorithm would have been made by now to do it, rendering most engineers jobless.
And even shorter: there's no "best" solution. There's a best solution within some given constraints. When the constraints change, so does the solution. (now let's see debianxfce wrap his head around that)
- Likes 6
Comment
-
Originally posted by bug77 View Post
Age old false problem.
Write X using a higher level programming language, people will complain it's not flexible and interoperable enough. Write X using a lower level programming language, people will complain of the learning curve and the effort it takes to develop for it.
And here comes the shocking newsflash: this is what engineering is all about, trying to come up with a solution that will please a sufficient number of people, knowing fully well you can't please everybody no matter what. If there was a way to reliably order the quality of solutions, an algorithm would have been made by now to do it, rendering most engineers jobless.
And even shorter: there's no "best" solution. There's a best solution within some given constraints. When the constraints change, so does the solution. (now let's see debianxfce wrap his head around that)
Comment
-
Originally posted by bug77 View Post
Age old false problem.
Write X using a higher level programming language, people will complain it's not flexible and interoperable enough. Write X using a lower level programming language, people will complain of the learning curve and the effort it takes to develop for it.
And here comes the shocking newsflash: this is what engineering is all about, trying to come up with a solution that will please a sufficient number of people, knowing fully well you can't please everybody no matter what. If there was a way to reliably order the quality of solutions, an algorithm would have been made by now to do it, rendering most engineers jobless.
And even shorter: there's no "best" solution. There's a best solution within some given constraints. When the constraints change, so does the solution. (now let's see debianxfce wrap his head around that)
Check how many microcontrollers are written in c, and how horrible the code looks.
I have written a framework in c++14, that let's me write beautiful code that is very short (compared to c code), very expressive, easy to maintain.
Why nearly all use c? I guess because they were (like me) teached like this [and then these guys are also writing tutorials also in c, and the new generation is also used to write c code. It take some thinking to notice: why, c++ works in that case even better, I have code generation at compile time, I can use constexpr to have also evaluation at compile time - means, I can getter faster code than with c, etc...... Imagine also the benefits of c++17.....
I would like to see that the linux world starts to rewrite old code - so that we can build on safer libraries. Let's stop with c, and use it just in very specific places. You even don't need c for writing the kernel: check out for example this: http://okmij.org/ftp/cpp-digest/toy_OS.txt
cipri
- Likes 1
Comment
-
Comment