Conversation
Edited 5 months ago

looking at some python code and going "ugh, this was written by a java programmer"

YOU DON'T NEED THIS MANY CLASSES, MAN!

3
1
1

I can't just call foobar.someformat.SomeFormat.read('data.file'), I gotta instantiate a BinaryReader and use it to make a SomeFormatReader

2
0
0

@foone you if you saw the original dr blockhead and the impossible course source code probably (its layout was inspired by minecraft so it has a class and in the if __name__ == "__main__" part it does Game().run() like in java (well it has a try/catch for doing an error dialogue))

well i mean in that source code there are worse examples of bad code due to the time constraint but that is one of them

1
0
0

@foone there are also lots of todos with swears

1
0
0

@tauon I think that's true of much good software

0
0
0

oh god, SomeFormat is an abstract base class, and I need to use a different class for it to work

1
0
0

@foone omg I feel this. trying to use Qt in Python is how I learned what a nightmare idiomatic C++ is BlobCat_Googly_NotLikeThis

pure OOP is a scourge on software everywhere

0
0
0

@foone You post some weird stuff every day. But that is definitely a weird API design choice, even for something you posted about.

1
0
0

@wrosecrans @foone
Especially since `open(filename, "b")` is how you're supposed to spell "BinaryReader" in python.

1
0
0

the worst thing is that I don't know if this code even works. am I using it wrong? or is it written wrong?

1
0
0

oh god there's dynamic code generation

1
0
0

python programmer pro-tip:
if your packages/modules/namespace system is so complicated that you need to dynamically generate python files containing import lines to handle it, YOUR SYSTEM IS TOO COMPLICATED

2
1
0

bad times is when you see some JSON code with encoding="shift-jis"

0
0
0