Skip to content

Instantly share code, notes, and snippets.

@vwood
Created February 2, 2012 20:44
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vwood/1725650 to your computer and use it in GitHub Desktop.
Save vwood/1725650 to your computer and use it in GitHub Desktop.
Pythonic Java
import java.net.* ;
import java.io.* ;
import java.util.* ;
public class Server {
public static void main( String[] args) {
try {
ServerSocket sock = new ServerSocket(4712,100) ;
while(true) new Handler(sock.accept()).start() ;}
catch(IOException e) {
System.err.println(e) ;};}}
class Handler extends Thread {
public void run() {
Random random=new Random() ;
try {
//yada yada yada
catch(Exception e) {
System.err.println(e) ;};}}
@vwood
Copy link
Author

vwood commented Feb 2, 2012

Thanks to http://stackoverflow.com/questions/237719/what-is-the-most-frustrating-programming-style-youve-encountered

(I didn't want to attribute in a comment, as that would ruin the Python with Java Comments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment