←back to thread

345 points splitbrain | 1 comments | | HN request time: 0.248s | source
Show context
OsrsNeedsf2P ◴[] No.41837682[source]
I love how simple this is- Barely 100 lines or C++ (ignoring comments). That's one thing that makes me prefer X11 over Wayland.
replies(8): >>41837906 #>>41838181 #>>41838339 #>>41838393 #>>41838489 #>>41838500 #>>41838693 #>>41844644 #
sim7c00 ◴[] No.41838181[source]
there's very little code because there's very little error handling / sanity checking. not saying X11 isn't hackable and cool, but a lot of code gets bloated and complex (and robust!) by not assuming perfect usage.

for example. run ./clipscreen 1 2 3 4

replies(1): >>41838209 #
splitbrain ◴[] No.41838209[source]
True. If something goes wrong this will just crash. But to be fair, the only error handling I could think of would probably just exit with a vague error message... Pull requests to make it more robust welcome anyway!
replies(2): >>41839220 #>>41839375 #
1. sim7c00 ◴[] No.41839375[source]
haha yeah, its ok for a tool its really cool honestly :p just commenting on the 'so little code' might be good to check if the x y etc. are within the screen / set resolution perhaps.