4 ms·
> A little bit of this also has to do to stick it to all those Luddites on the internet who post "that's impossible" or "you're doing it wrong" to Stack Overflo
by cnity 3y ago
> A little bit of this also has to do to stick it to all those Luddites on the internet who post "that's impossible" or "you're doing it wrong" to Stack Overflow questions... Requesting permissions in the JNI "oh you have to do that in Java" or other dumb stuff like that. I am completely uninterested in your opinions of what is or is not possible. This is computer science. There aren't restrictions. I can do anything I want. It's just bits. You don't own me.
From the wonderful CNLohr's rawdraw justification[0]. I always enjoy these kinds of efforts because they embody the true hacker spirit. This is Hacker News after all!
0: https://github.com/cnlohr/rawdrawandroid?tab=readme-ov-file#why https://github.com/cnlohr/rawdrawandroid?tab=readme-ov-file#...
- wil421 3y agoI like this guys spirit. Once I had to pick up old code from a guy with this spirit and it was f-ing horrible.
- mtillman 3y agoI love this project (from 2014?) and perhaps my favorite part other than the f-u of the whole thing is the commit message "complete refactoring".
- shrimp_emoji 3y agoBeats using Java Think of it as exercise: it sucks up front but you won't end up an obese diabetic on the WALL-E ship later.
- SpaghettiCthulu 3y agoJava is only a nightmare when you have to follow corporate decade-old "best" practices
- bheadmaster 3y agoIn my experience, Java is a nightmare the moment you try to do anything beyond what C++ can (easily) do.
- augusto-moura 3y agoWhich would be?
- bheadmaster 3y agoOk, here are two examples on the top of my head, of fairly trivial programs that are a pain to do right in Java. 1) A program that copies all data from standard input to the standard output. Try to write this without Googling. Simple enough, eh? 2) A program that serves as a middleware between servers and clients, both of which are behind NATs so they connect to your middleware, using gRPC methods. Servers use gRPC streams to maintain a connection, send their ID as the first message, receive request messages, and send reply messages. Clients send ID and request in a message, and receive reply message. I hope you're willing to show me how wrong I am by writing the code :)
- netvl 3y ago1 is really trivial and took me like 5 seconds to write: public class Test { public static void main(String[] args) { System.in.transferTo(System.out); } } 2 is anything but trivial in any language, unless it is some kind of a language specifically designed to build gRPC programs. Never versions of Java are quite pleasant to work with. There are a lots of quality-of-life improvements (switch expression, multi-line string literals, string templates (currently in preview), lots of useful stdlib APIs), as well as quite fundamental additions like Loom. edit: formatting, explanations
- bheadmaster 3y ago> System.in.transferTo(System.out); Ok, that's really convenient :) I suppose it would be much harder to do it without the transferTo function, but that would be beyond the point. I'll instead focus on the example 2. > 2 is anything but trivial in any language, unless it is some kind of a language specifically designed to build gRPC programs. The gRPC protocol here is only an example. Feel free to use any protocol you like. As a counter-example, here's a TCP version in <200 lines of Go: https://gist.github.com/paskozdilar/6871fef7b0b245a0846bd27e386a798a https://gist.github.com/paskozdilar/6871fef7b0b245a0846bd27e... > Never versions of Java are quite pleasant to work with I know this is a typo, but you accidentally wrote something completely true :')