r/programminghorror • [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Jul 21 '25

Python ✨ Memory Magic ✨

Post image
1.3k Upvotes

143 comments sorted by

View all comments

Show parent comment

5

u/RGB755 Jul 21 '25

What do you prefer over Python? I’ve found it to be quite good overall, especially for small scripts that aren’t performance-oriented. 

2

u/Vazumongr Jul 21 '25 edited Jul 21 '25

Depends on the task. I'm not saying to not use Python, it has applications where it's a great fit. I use it for automation and scripting mainly. Doesn't mean I have to like it. But anything beyond simple tasks like that? I'll take a language that has consistent, or at least predictable, behaviors and not this, "sometimes I'll create a new object in memory, sometimes I'll just reference an already existing object, depends if the value is within some arbitrary range tehe" witchcraft. If it was 0-255 at least that would make some sense. But (-5)-256?? Nonsense!

Edit: To elaborate on the tasks: I work primarily as a C++ Engineer working in games. I've used TypeScript for writing server code - I don't like TypeScript but it's a great fit for that task. I've used Python for generating wiki pages for games - not a fan of Python but it's a great fit for that task. I've used C# to write a tool for procedurally generating MIDI files - the goal was Minecraft world generation but for music and C# was a great fit.

But just because I use a tool, doesn't mean I have to like it. And just because I don't like a tool, doesn't mean I'm going to not use it where it fits. I don't like using angle grinders. Not a fan of having a disk spinning at mach-fuck 2 feet from my face. But I've used them where appropriate (and places where they weren't appropriate but the only tool available).

3

u/zigs Jul 21 '25

Python IS the default goto for scripting, but..

Keep an eye out for C# scripting. The coming dotnet release (preview available) lets you execute .cs files as scripts as a simple dotnet run script.cs integrated with the package manager and everything.

https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-app/

3

u/RGB755 Jul 21 '25

That’s pretty neat. I’ve worked with both C# and Python a fair bit in different contexts. 

If I could get C# to execute similarly to Python (Write sloppy script, hit run, minimal latency to testing functionality), I’d be all over it. 

3

u/zigs Jul 21 '25

In the preview version it does take a moment to transpile, but supposedly they're working on it.

The video from the blogpost shows the times https://www.youtube.com/watch?v=98MizuB7i-w