Post AxRDTmsyo0w9FCSdTU by wrosecrans@mstdn.social
(DIR) More posts by wrosecrans@mstdn.social
(DIR) Post #AxRCpLInwPNu71FqWu by foone@digipres.club
2025-08-22T19:37:10Z
1 likes, 0 repeats
looking at python and going "ugh, this was written by a java programmer"YOU DON'T NEED THIS MANY CLASSES, MAN!
(DIR) Post #AxRD112B7iH0j72n8C by cinebox@masto.hackers.town
2025-08-22T19:39:14Z
0 likes, 0 repeats
@foone I keep running into the opposite: Python written by C programmers
(DIR) Post #AxRD5QBrXFEPuCfscy by Sivation@wandering.shop
2025-08-22T19:39:17Z
0 likes, 0 repeats
@foone Are they also using the horrible Java trick of Object.Object.Object.... which means you have no hope telling which damn thing caused the exception?
(DIR) Post #AxRD7RVLcU5gYpkhqy by foone@digipres.club
2025-08-22T19:39:34Z
0 likes, 0 repeats
I can't just call foobar.someformat.SomeFormat.read('data.file'), I gotta instantiate a BinaryReader and use it to make a SomeFormatReader
(DIR) Post #AxRDBtXhJjxsg2yTpo by petealexharris@mastodon.scot
2025-08-22T19:40:22Z
0 likes, 0 repeats
@foone Java programmers feel uncomfortable when functions are just walking around naked.
(DIR) Post #AxRDEzTlhYu9xSc3Mm by kkremitzki@mastodon.social
2025-08-22T19:40:10Z
0 likes, 0 repeats
@foone the telltale signs come through, it's like when a German dev accidentally types "Programm"
(DIR) Post #AxRDKcz2FkHjvUvS3U by tauon@possum.city
2025-08-22T19:39:18.150Z
0 likes, 0 repeats
@foone@digipres.club 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
(DIR) Post #AxRDKderkDkI1EUrFw by tauon@possum.city
2025-08-22T19:39:28.970Z
0 likes, 0 repeats
@foone@digipres.club there are also lots of todos with swears
(DIR) Post #AxRDKePewFAyMMOEC0 by foone@digipres.club
2025-08-22T19:42:37Z
0 likes, 0 repeats
@tauon I think that's true of much good software
(DIR) Post #AxRDTmsyo0w9FCSdTU by wrosecrans@mstdn.social
2025-08-22T19:44:26Z
0 likes, 0 repeats
@foone You post some weird stuff every day. But that is definitely a weird API design choice, even for something you posted about.
(DIR) Post #AxRDeuaOW63YJN4XIm by manmachine@mastodon.world
2025-08-22T19:46:26Z
0 likes, 0 repeats
@foone Java programmers can write Java programs in any language!
(DIR) Post #AxRDwqqp8rvfwLJMIK by mctwist@social.accum.se
2025-08-22T19:49:41Z
0 likes, 0 repeats
@foone If my boss sees me use a class, they will complain and then refactor away the class. I do agree with them.
(DIR) Post #AxRE63CqZiEIrhzzl2 by foone@digipres.club
2025-08-22T19:51:20Z
0 likes, 0 repeats
oh god, SomeFormat is an abstract base class, and I need to use a different class for it to work
(DIR) Post #AxRFzgGZ9VZrtApRZo by petealexharris@mastodon.scot
2025-08-22T19:49:02Z
0 likes, 0 repeats
@wrosecrans @foone Especially since `open(filename, "b")` is how you're supposed to spell "BinaryReader" in python.
(DIR) Post #AxRFzhSIjMYhZrKKVU by foone@digipres.club
2025-08-22T20:12:34Z
0 likes, 0 repeats
@petealexharris @wrosecrans exactly!
(DIR) Post #AxRHRRXfacsuHkdBLs by foone@digipres.club
2025-08-22T20:28:52Z
0 likes, 0 repeats
the worst thing is that I don't know if this code even works. am I using it wrong? or is it written wrong?
(DIR) Post #AxRJ9GiVIayxPJ9ydM by foone@digipres.club
2025-08-22T20:47:52Z
0 likes, 0 repeats
oh god there's dynamic code generation
(DIR) Post #AxRJCaFv6sWGsJN3gG by foone@digipres.club
2025-08-22T20:48:30Z
0 likes, 0 repeats
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
(DIR) Post #AxRKEbtA6rDgTNFwNk by foone@digipres.club
2025-08-22T21:00:08Z
0 likes, 0 repeats
bad times is when you see some JSON code with encoding="shift-jis"
(DIR) Post #AxRKTEa33Fr0WkHz0q by miodvallat@hostux.social
2025-08-22T21:02:42Z
0 likes, 0 repeats
@foone jis happens.
(DIR) Post #AxRP3LOPbI4RtfJuwy by silvermoon82@wandering.shop
2025-08-22T21:54:04Z
1 likes, 1 repeats
@foone Also true:
(DIR) Post #AxRSjakhBVAjYfa1po by peter@thepit.social
2025-08-22T22:35:18Z
0 likes, 0 repeats
@foone lmao thank you thank you thank you.
(DIR) Post #AxSBxeTocLUB6wlNEO by henryk@chaos.social
2025-08-23T07:02:05Z
0 likes, 0 repeats
@foone I don't understand. What? Python is the one language where it's *never* necessary to dynamically write out code files. The language is dynamic in its core, everything you want to do, you can do directly.I once built a plugin system for some REPL style interaction which allowed to load/unload plugins. It would dynamically create a new class inheriting from the base and all loaded plugins and then dynamically replace it on objects in memory.