Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this code gives me deep psychological issues #1

Open
JuhaJGamer opened this issue Jul 20, 2020 · 3 comments
Open

this code gives me deep psychological issues #1

JuhaJGamer opened this issue Jul 20, 2020 · 3 comments

Comments

@JuhaJGamer
Copy link

why is XXXPacketSender even a class
all the code in the whole class could be simplified to

sender_socket = Socket(port, addr)

void loop(Socket sender_socket, String msg) {
    DataOutputStream dout = new DataOutputStream(sender_socker.getOutputStream());
    dout.writeUTF(msg);
    dout.close()
}

why bother with all the class boilerplate when what you need is a function and a socket?
there was never any need for a single-use class like this to begin with

the two sender classes arent even related in any way despite that being the only reason for them to ever exist

what the hell man

@JuhaJGamer
Copy link
Author

and why are there so many imports in each file? why does each thing have to be imported explicitly? what was so wrong with java.net.* that you had to turn it into 16 lines lines of explicit imports?

@videosambo
Copy link
Owner

why is XXXPacketSender even a class
all the code in the whole class could be simplified to

sender_socket = Socket(port, addr)

void loop(Socket sender_socket, String msg) {
    DataOutputStream dout = new DataOutputStream(sender_socker.getOutputStream());
    dout.writeUTF(msg);
    dout.close()
}

why bother with all the class boilerplate when what you need is a function and a socket?
there was never any need for a single-use class like this to begin with

the two sender classes arent even related in any way despite that being the only reason for them to ever exist

what the hell man

I have already reworked code long time ago but I dony hsve time to update this. Yes tye packet sender class is stupid and my reworked version there is actual meaning for class and there is much more fields and settings to control. Even now that tcp sending thing is very broken.

I'l have update for this when I have time.

@JuhaJGamer
Copy link
Author

niice dude

idk i was looking at some repos and came across this and it just
i dont know i thinky i might have broken my brain on the code by accident
it's quite cargo cult-like, where things are calsses because things usually are classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants