How weird was your first interaction with Python? I learned Python while writing a C++ module.
Posted by Humdaak_9000@reddit | Python | View on Reddit | 42 comments
I was tasked with making some of our C++ code callable from Python. Before I knew Python.
Fortunately, SWIG helped a lot. Unfortunately, it was somewhat akin to performing open-heart surgery on someone you're currently on a first date with.
dhsjabsbsjkans@reddit
I didn't really find it weird. I came from perl. It was a nice change of pace.
Humdaak_9000@reddit (OP)
Nah. Nothing about python is weird, really (except maybe the whitespace).
I'm mostly curious about people whose first interaction with python was weird, like mine. Needing to write an extension module as your literal first interaction with the language? That's weird. And entirely expected as something that could happen to any random software engineer depending on circumstances. Or at least any who know C.
dhsjabsbsjkans@reddit
Got ya. Nope. I actually just wanted to learn it. I started by rewriting every perl script I had in python, then never turned back.
Local-Economist-1719@reddit
my first interaction with python was desperate try to create snake game by the youtube video, i couldnt understand 90% of code if wrote, but i still did the thing
derdlok@reddit
Fv טוטט3 . |נ&]]א]
TheRNGuy@reddit
In SideFx Houdini.
misterfitzie@reddit
i was programming a lot of perl before python, and I remember getting lost in how the namespace/import worked for a bit. probably due to not using packages. another early recolection I have is how python doesn't encourage regexs at all for string parsing. and there's people doing a lot of silly split('-')[2] stuff which would been doing in regex in perl. these days due to json and libraries like pydantic , I don't see nearly any string parsing anymore.
KitchenFalcon4667@reddit
Philosophy of Religion 🫣. My paper was about freedom of will and existence of omniscience (greatness-making properties) being. I wrote about Bayesian Network (Priest Thomas Bayes + Richard Price). My professors asked me to code the network, and so I googled easy language to learn: Python 2.6 was the answer.
rogusflamma@reddit
My first serious interaction with Python was in a data science class. All programming I knew prior to that was C and Linux assembly. One year later I'm using Python for personal projects and I'm beginning to like it
HolidayEmphasis4345@reddit
My first interaction was in 2001. It was a cool little tool for doing scripty stuff. It was odd with its no braces no semicolons, arbitrary precision everything runs…it was useful replacement for sed awk and other stuff… 20 years later it has replaced all of my other languages except for SQL…
BabyJesusAnalingus@reddit
They needed an extra pair of hands on the core language, so I figured I'd help out. 6 years or so later, we went to BeOpen.com as full-time employees (a very odd experience), met Linus, Eric Raymond, Richard Stallman, etc.
I got to negotiate with CNRI to release Python from its restrictive license, and when BeOpen collapsed, we got to pick what assets we wanted as payment in lieu of paychecks. Although Python was small at the time, I chose to own the copyright to Python 2.0 (the version I created; Python 1.6 was still part of CNRI). I still own it, and it's a weird quirk of history.
I intentionally left out "non-revokable" in the license, and if things keep going like they're going at Google and other AI companies, I might have reason to do my first-ever revocation of the license and all derivative works (Python 3.x, etc).
Humdaak_9000@reddit (OP)
Bwaaaahhahaha!
BabyJesusAnalingus@reddit
Not what their reaction will probably be tho lol.
i_Den@reddit
I hit python wall back in 2012, when learned about OpenFlow SDN “software defined networks” and had to pass Coursera course- all of that back then was in almost very early stage, and same as with AI python was used for prototyping and labs and i was complete 0 in development. (But upper-mid sysadmin/netadmin with enough skills in bash, sql, and spreadsheets magic)
david_jason_54321@reddit
My first python script was named python.py. it did not work and it took me a few hours before I submitted my first stack overflow and someone asked if I named it python and they helped me. I look back and realize how dumb it is but as a first time programmer I thought python.py was a great name for my first script.
ThreeSpeedDriver@reddit
The place to put your user level pip config file is ’~/.config/pip/pip.conf’, so ’python.py’ doesn’t seem that bad lol.
Aardshark@reddit
Is python.py not a valid script name? I feel like it is...that was surely not the reason it didn't work for you.
dan4223@reddit
I mean, if you only have one python script, python.py is as good of a name as any.
timsredditusername@reddit
Many, many years in to casually using it at work for automating my job, I made similar mistakes.
Mainly, when trying out a new package from pip, I once (too recently) named my script the same name as the module I was importing.
Muhznit@reddit
As a C/C++ user:
"Wow it's so nice to skip the compilation step. And I get actually readable error messages? This is amazing!"
"Wait this doesn't support switch statements? Garbage."
"Wait it doesn't need switch statements because I can store whatever in a dictionary? Hmmm..."
"Wait it's this easy to write a chatbot? To write a server monitor? To write a web scraper? WHY DID COLLEGE NOT TEACH ME THESE THINGS"
"I write a shitty image recognition app to help me with counterpicks in [REDACTED] and now that helped me get a job at [REDACTED]. It's official, Python is my love language now."
ajslater@reddit
The sometimes unintuitiveness of case logic in match statements still vexes me.
SV-97@reddit
Match expressions in Python are such a mess. I was looking forward to them so much based off my experience with other languages — and now I never use them because they're such a mess.
zurtex@reddit
I find the way to think about them is they're a object pattern matching mini language within Python, that happens to look like Python syntax.
In my mind this turns them from being a mess to a "huh, that's a feature I don't really understand when to use".
They feel a lot like enums to me, they're obviously useful in other languages, and those use cases sort of translate over to Python, but not in a way that I have an intuitive grasp on. There are some places I sprinkle enums these days, I'm sure in 5 years there will be some places I will sprinkle match statements.
Muhznit@reddit
I don't miss switch statements enough to complain about match statements. I mean I use them rarely enough that today is the first time I used one in a month or so, but they have their places sometimes.
figshot@reddit
I found it so weird that leading whitespaces were meaningful. I walked away from it for years.
sybarite86@reddit
Came to Python via Perl and C before that as a college student. Was blown away by how close to pseudocode it looked. Previously, the “game” was to write the most inscrutable one liner. Python changed the game to: how close to English can you get? Implementing a few graph algorithms in Python was sheer poetry.
syklemil@reddit
I also remember some of the "perl poetry" stuff that was incredibly inscrutable. Including some of it that was full of english. That and the golfing I can only hope was some outlet for people who were kinda fed up with following general SWE best practices for maintainable code at work.
syklemil@reddit
I actually don't know how I learned Python. I knew some other languages and at some point I was fiddling with some Python while sysadmining I think, and then at some point I started writing scripts in Python rather than Perl, but I can't really remember when or why or how.
The other languages I know I generally learned through a book or course—read the Llama book for Perl, was taught Java at uni, picked up some other languages or read some books if I thought they seemed interesting.
But Python is more like … a cat that decided it was living with us, and it turned out to be rather sweet.
fatherofgoku@reddit
Haha, that’s a wild first Python project. My first was way simpler — just a small script and even that felt weird coming from C++.
bruschghorn@reddit
It was in 2002. Previously I was programming on calculators, then QBASIC, Turbo Pascal and Turbo C on DOS, then Delphi 3 on Windows. I just got a PowerBook in 2002, with MacOS 9, and I was looking for a programming language. MPW sucked. I tried a few other things but wasn't convinced (I remember Real Basic). And then I found MacPython (here: https://homepages.cwi.nl/\~jack/macpython/index.html). My first reaction was: wait, big integers are builtin and automatic? No need to malloc/free? Bultin lists and dictionaries? I fell in love instantly. It didn't have numpy back then, but there was Numarray and Numeric. I have used it a lot since then for small algo or math programs, system utilities, automation... For any repetitive task, Python is a marvel. Shortly after MacOS 9 I got MacOS X and I could program in C again, and I learned a lot of Java in university. Later I got a Windows laptop, and today I'm on Linux, but I never left Python.
I also recommend this video (David Beazley at PyCon 2014): https://www.youtube.com/watch?v=RZ4Sn-Y7AP8 It conveys very well how you feel with Python.
moonzdragoon@reddit
I'd moved from C to Perl for small personal projects, and after a year or two of Perl scripting, around 2001-2002, I discovered Python (and its support for regex).
Suffice to say, readability was way nicer, transition went very smoothly, never wrote a single line of Perl since 😄
SocksOnHands@reddit
My first exposure to Python was writing a mesh exporter for Blender in 2002.
TedditBlatherflag@reddit
I first saw Python trying to compile something for Gentoo decades ago. There was an Syntax error in the script and I checked the file and found a missing parenthesis. I remember thinking that it was such an easy language to read that I could debug it never seeing it before. Still using Python to this day.
koldakov@reddit
Started learning python when 3 version was introduced. At that time I was like what are you saying considering documentation wasn’t that best and a lot of samples were focused on previous version, but I was using the new one. So embarrassing 😂
wkcif@reddit
I am not a programmer. I learned about python when I needed to write a macrocommand in notepad++, via python script plugin for npp. Not necessarily weird.
MacShuggah@reddit
I started with Python and now I'm spoiled.
shinitakunai@reddit
Same
metadatame@reddit
I wanted to learn Django - figured I'd have to learn this python thing too. Was 2008
thashepherd@reddit
I gotta be honest, I don't even remember learning Python. Obviously at some point I had never used it. Then at some point I was using it regularly. And then at some other point I knew it pretty well.
But I'll be damned if I have any idea which year any of those points occurred in.
big_data_mike@reddit
I came from R so I was super frustrated that all the parentheses and brackets meant totally different things. And I was super frustrated that there was no grep function.
TheWorstePirate@reddit
I did mostly C# with a side of C++ for a long time. When I started at a new company that was taking their first swing at an in-house robotic system, they had an intern who was fumbling through trying to get communication between the robot and a PC. I took a look at what was there to see if I could help. Everything I tried just seemed to work, and with copilot already installed I barely had to think about the new-to-me syntax. It was the coding equivalent of Tony Hawk Pro Skater with cheat codes for unlimited everything.
qTHqq@reddit
I built a little GUI application with PySide Qt or something and all the signals and slots and then finished and worked on other stuff and forgot everything I learned about Python.
I leaned it better later 😂
But it really was funny how little I remembered when I went back to pick up Python again. I was in grad school and most of my daily work was in Matlab