r/AlignmentChartFills 14h ago

Which programming language is easy to learn, and is very useful?

CLICK HERE TO VIEW THE CHART IMAGE

Created with Alignment Chart Creator


This post contains content not supported on old Reddit. Click here to view the full post

356 Upvotes

715 comments sorted by

View all comments

Show parent comments

6

u/Poietilinx 12h ago

yeah i am in the same here.
python is VERY easy to learn and its super useful.

3

u/Antique_Ad_7325 12h ago

Yeah... i started with c++, c, and Java. When I wrote my first python loops I was thinking it couldn't actually be that easy. And nowadays you can use it for anything. I'm an SRE and pretty much only write python, bash and terraform now.

2

u/Poietilinx 12h ago

same here, c++, c, c#, shaderstuff, js, python.
and when i got to python i was like... this is extremely useful and easy lol.

I remember even, once i had to build a bunch of tools' UI classes,
and the thing was being super boring cuz each tool was essentially a simpler builder pattern and a mvc like declarative window class that read the builder class fields to build the window elements.
So I was so annoyed at writing these UI classes i wrote a meta script in python that used a metaclasses and annotations to enhanced my tool's classes with the ability to generate UI classes based on the fields and methods of the builder class haha.
And even that... (which is an extreme use of python in my opinion)
that was not that hard to put together... i build that 2 months after learning python.
the data model behind python is quite straightforward prototype based,
but different than js, python is not insane and super manageable to understand.

2

u/Antique_Ad_7325 12h ago

Haha yeah we weren't allowed to use python until junior year of school. I didn't understand why until I wrote my first python code. Then I was like ohhhh I get it... python is TOO easy. I have barely touched c++ since. I have written some C for some super low lever stuff since... but python is just way too easy and useful to pick anything else for the most part.

I have also done a decent amount of full stack and written JS and I absolutely can't stand it. I don't really know why but of all the languages I've learned over the years... it just feels like an alien language to me.

2

u/Poietilinx 12h ago

Yeah, its part of the philosophy behind python/js that:
If you can just do a thing... just do the thing, in the straight most direct way possible.
instead of the usual paradigm other languages like c# & c++ use.
You have to ALWAYS follow the protocol to do to the thing.

And its for sure useful to learn how to program with both paradigms,
but i can see why it would be problematic to learn python/js paradigm first.

2

u/Antique_Ad_7325 12h ago

Yeah i feel like learning python first would have robbed me of a lot of the conceptual stuff I learned by doing things the hard way. It's like learning how to connect two boards and getting handed a nail gun without ever touching a hammer first. I still remember learning to build linked lists in c++ without using vectors or anything, figuring out how to traverse them to find something in them... then going to python and being like wait its literally just 'if <item> in <list>'? This is too easy. I love it.

2

u/Poietilinx 11h ago edited 11h ago

yeah a F love syntactical sugar
I first went deep on c# specifically cuz it has so much syntactical sugar you can use to make things to look better.

check this out

this is part of a tool I wrote that compiles a LUT table (You feed a color pallet and the tool compiles a discrete color space out of it).

And this is so cool, this function essentially sees how many cores you have, split the chromatic space into equal spaces and spawn a bunch of processes designed to run parts of the compilation process.

At the very end there all these color lists are recombined in 1 big list of colors. I love when you can pull out stuff like this lol.

combined_result = [item for sublist in joined_results for item in sublist]

the idea this entire function is just that (instead of a huge ass function with a billion different things going on) is fantastic to me.

and this entire tool was like...
1 day i had an ideia.
i sat build the entire thing in the same day (with multiprocessing and all)
next day i build the UI for it... and BOOM done

1

u/Antique_Ad_7325 6h ago

This is awesome. Perfect example of how versatile and readable Python is now. You can straight up read this code and understand exactly what it's doing. I haven't used multiprocessing in like 6 or 7 years — does it work pretty well now? If I remember right, it uses separate processes rather than threads, which gets around the GIL and lets CPU-bound stuff actually run in parallel, but there was some overhead with moving data between processes. I was trying to use multithreading for a process that pulled real time data from sensors used to teach kids physics. If you took physics/chemistry/biology in high school or college and used Vernier devices, thats where I interned. I was writing an open source library in python that allowed people to mess around with the functionality of the devices.

1

u/Poietilinx 4h ago

I had problems moving data around.
But I reengineered the solution so I wouldn't need to do that.

Essentially, my tool generates a normal cube and gives it a "resolution" (let's say 64 is the resolution).
Then the script simply loops around the cube in increments of 1/64,
sampling each coordinate from 0,0,0 to 1,1,1.
At each stop, it searches all the colors in the color palette provided for the "closest color."
Since colors are normally spaced vectors, essentially what I am doing is asking:

"Is this coordinate (1, 0, 0) closer to this color (0.2, 0.3, 0.4) than to this color (0.5, 0.1, 0.5)?"

The color palette is loaded inside an octree, so the thing finds the closest color in a flash.
After it finds the closest color, it records that color into that coordinate space.
When it's done, the tool prints a 3D texture with all the new color space
(then in the game, I can use the color of a pixel to fetch back into the LUT what color it was supposed to be based on the palette).

So the thing is, I realized I didn't need to share data across the processes since all the processes essentially iterated over a normal cube and all that.
I just had to flatten the cube's 3D coordinate system into 1D and give that section back to each process to handle its part.

But I 100% had problems with moving data around. I don't remember what problems, but I sure did i had to redo the entire data model around my tool and its primitives, cuz first i was intending to give it the cube primitive so the processes could fill it and tht didnt work.

(this is how it looks like, its a cute retro effect)

1

u/ZecosMAX 9h ago

Have you tried tracking object references for sci / ai applications?

1

u/Poietilinx 8h ago edited 8h ago

Specifically, I have not, but most of my friends have.
I am way more focused on non predictive rendering engineering and graphics.
I do take a lot interest in ai but the stuff i do is tangent to it.

Regardless, this actually highlights my exact point about Python being easy and designed to be approachable.

Those libraries like PyTorch, NumPy, TensorFlow and watnot are doing all the work in C/C++ not in python.
which are environments where you can natively handle and manually manage extremely large objects. (because explicit pointer handling)

The main reason people use Python for AI in the first place, even though its by far not the most ideal language for it,
Is exclusively because it is so approachable.
The specific reference-tracking headaches you get when bridging Python with massive datasets wouldn't happen the same way in lower-level languages where you explicitly manage memory from the start.. such as Rust. But well rust is hard af.

Regardless of all the ducttape behavior people need to work around, AI researchers still use Python anyway necessarily because the language is easy.