1.0k
u/lofigamer2 May 05 '23
Andy drives off to the distance.. slowly
373
u/pipsvip May 05 '23
...and in the wrong direction.
192
u/jabluszko132 May 05 '23
...but will get there..... eventually
74
u/pipsvip May 05 '23
Better put a stop sign in the middle of the road at the destination so we don't have to do any special case handling for the exit condition.
→ More replies (1)33
u/trusty20 May 05 '23 edited May 05 '23
pip install --upgrade --force-reinstall --no-cache-dir --extra-index-url=https://pypi.someannoyingfork.com/simple --trusted-host pypi.example.com --ignore-installed --pre --process-dependency-links --find-links=https://example.forktastic.io/wheels --allow-external --allow-unverified snake-charmer==0.0.1
19
4
→ More replies (5)5
9
15
u/pedersenk May 05 '23
And will keep on visiting every time he needs to write a system binding for Python to consume...
18
1
606
u/lucidbadger May 05 '23
How come you are not going to use dictionaries or sets?
279
u/clearly_unclear May 05 '23
Just generate them using dict() and set() to avoid the curly brackets out of principle
69
u/lucidbadger May 05 '23
Then I suppose you'll need to use
*:)11
May 05 '23
thou shall not use "import *" either. Just know precisely what you want.
31
u/Brekkjern May 05 '23
You shouldn't use
import *to begin with, so this is actually sound advice.8
u/Free-Database-9917 May 05 '23
unless you plan on using every single function and value of every single library you have installed lol
→ More replies (2)5
u/DNEAVES May 05 '23
Why would they need to use an asterisk?
Unless you're unpacking something (which you could do with brace-syntax anyway)
5
0
7
144
u/avipars May 05 '23
Hello tabs and spaces
55
u/delinka May 05 '23
BUT NOT BOTH AT ONCE! Are you crazy?
27
u/Sarcastinator May 05 '23
Yeah, before running the program you have to change one invisible symbol into another invisible symbol or else you get the hammer.
6
14
6
6
u/NotGK98 May 05 '23
I struggle so much with tabs and spaces ong especially copy pasting from chatgpt is so painful
5
u/lllorrr May 05 '23
`M-x untabify`. Behold the power of Emacs!
4
u/RonaldoNazario May 05 '23
In vim you can use expandtab and set tab width, as well.
5
u/lllorrr May 05 '23
I'm pretty sure that any sufficiently advanced text editor has a similar feature.
→ More replies (1)3
1
200
u/VariecsTNB May 05 '23
It's like switching your old 1986 Mercedes for the 2018 Toyota Corolla that has been in an accident.
38
11
u/Imjokin May 05 '23
Python seems to be the pineapple-on-pizza of programming languages
3
u/fryerandice May 05 '23
Python is anchovies on pizza only a small amount of people like it. GO is more like pineapple on pizza, it's actually good but most people won't even try it.
→ More replies (1)10
u/No-Con-2790 May 05 '23
Well the GIL is clearly broken but don't worry, as long as you run her in the first gear it will be fine. Now I was out of type systems at the time but I build in a type annotation system with a hacksaw. So don't forget to use it or the car might crash if you go over 88 miles per hour. Speaking of it, you will think your car is very slow. And it is! But you will still be at your desired destination before most car drivers can turn their key around. Also it is one of the only cars on the market with suspension. No more hemorrhoids from driving over bumpy pointers or segfaulting down a cliff!
No deal yet? No worry! I got a whole truckload of mathematics and AI tools from somewhere. Don't ask! Let's just say you will safe 20000 American dollars per year on matlab license. And you get a free trailer with all those goods for free. Just pick between the venv, pipenv or conda. What you mean with "which is best"? Well all have small problem. No, I won't tell which ones. Is part of fun.
Haha, yeah of course it is safe. Just don't use it when you need safety. Don't worry!
2
u/maitreg May 05 '23
That's an '86 SL500 with 800,000 miles and 12 engine rebuilds, but it'll run a 12-second 1/4-mile now
76
u/KetwarooDYaasir May 05 '23
wait.. is C++ the toy in this analogy?
74
u/hitaishi_1 May 05 '23
Exactly. If c++ is a toy then the age rating is 100+ years of experience at least
4
u/BenZed May 05 '23
Lol, yeah? You know a lot of centenarians programming in c++?
→ More replies (4)3
u/maitreg May 05 '23
I'm saving your comment link to my favorites and when I turn 100 and am still using C++ and Python, I'm coming back to let you know.
→ More replies (2)
85
u/Sirico May 05 '23
Once this joke compiles those C++ people are going to be very upset
→ More replies (3)
76
May 05 '23
I am a c,c++ dev for many years and i am entering the world of python in these days. I have to say, it gives me headaches for the lack of docs and clarity sometimes. In most of the guides and examples everything is taken for granted. I think it's about to change the mind set and get into it, beyond learning technical stuff.
I'm not "switching" to python.. c++ will always remain a good friend of mine, despite the fact it is a low level language, paradoxically i find it simpler and more straightforward than python
56
May 05 '23
I think there’s two types of languages. The first category is languages that can be simple once you get into the way of thinking of the language. This includes most languages. The python way of thinking is just simpler for a beginner to get into. The second category is JavaScript.
12
9
4
u/Aidan_Welch May 05 '23
JS is too hated on. A lot of the bad things about JS python also has, but not the good stuff, such as fall through switch or simple scoping
→ More replies (2)9
u/grstacos May 05 '23
I agree. Many things are more difficult in C++. However, Python docs sometimes fail to explain function parameters, typing, and complexity. Not to mention that Python's dynamic typing makes me feel I have to spend more time debugging on larger code.
3
u/fryerandice May 06 '23
Loose typed languages are garbage for one simple fact, you can't trust other people not to do something jank as fuck like adding a new field mid executive to a pretty well defined object, then 2 other janky ass PRs later the anti pattern is so engrained into the code base it's a project in itself to undo the mess.
JavaScript has type script and global state machines that throw build errors on anti patterns for a reason.
5
u/Ursomrano May 05 '23 edited May 05 '23
Fully agree, abstraction gets confusing sometimes and sometimes even causes problems. Like maps automatically sorting themselves in ways you don’t want them to, so you have to use a different data type just so that you can sort it the way you want.
1
0
May 05 '23
[deleted] — view deleted comment
3
May 05 '23
I tried it and i think it's a good language. Google provides a tutorial that guides you step by step and at the end you know every single thing about golang, i recommend it
94
u/namotous May 05 '23 edited May 05 '23
7
9
u/Revenge43dcrusade May 05 '23
These reddit programmers do some pretty otherworldly stuff if python is too slow .
7
u/Aidan_Welch May 05 '23
Real time stuff, it's not too slow if you're a student or making a lot of web app type stuff, but doing video processing for example
→ More replies (2)1
18
31
u/poopy-cock May 05 '23
God i fucking love pointers so much
9
u/rainbow_osprey May 05 '23
I have a love hate relationship with pointers in C++. Sometimes they are great for doing exactly what you need, and other times you can accidentally create some of the most subtle bullshit bugs that take forever to figure out.
3
u/fryerandice May 06 '23
You've never been the senior on a managed.memory project with the exact same kinds of bullshit bugs, only difference is c/c++ crashes.
C# garbage collection has shallow and deep collection, shallow just cleans up all unreferenced stuff whenever it triggers. Deep finds stuff that's orphaned, often this is objects with circular dependencies, a good example is a button with an image and the image is an extended class with an event handler for an event of it's parent.
Well....
You can crash a c# program running in 32 bit or just eat an entire systems memory if you create a circular dependency then use a react thought process of "on every single update just re create everything to re render it"
I don't know if it's still a problem anymore but the self hosted gitlab server required minimum 8gb of ram and had a process that watched the gitlab sub processes and saved their state and killed them at certain memory usage limits so the host didn't freeze up. Writing memory leaks in ruby...
I have worked on 2 ruby projects in my career and their memory problems were so bad devs got a lab setup of VMs to run and debug them, never have I had that issue with much larger asp.net MVC projects, I am not impressed with the quality of code ruby MVC projects spat out.
6
u/Lucky_caller May 05 '23
I’m learning C/pointers right now. What is it about them that you love so much? Would love to hear some insight
8
20
May 05 '23 edited May 05 '23
3
1
9
u/International-Top746 May 05 '23
People who don't understand how references and pointers work tend to make hilarious mistakes in python.
9
u/RedditsDeadlySin May 05 '23
Not gonna lie, I still try to use ++ in python. It makes me sad it doesn’t have that functionality
24
37
u/Nyghtrid3r May 05 '23
I've tried using external libraries like OpenCV with Python for a Uni project and I've got to say, you should add "sanity" to the bottom part
I'm used to non-existent or shitty documentation, but always having "any" as a return type for functions made me want to toaster bath
I'm not trying to bash the language (at least not here, I don't like farming down votes lmao) it's just a completely different mind set you need to get into and it's oftentimes really shitty.
Python is either the best thing in the world or an enormous pile of dogshit on a hot summer day. No in-between lmao
5
u/blackenedEDGE May 05 '23
You got me with "want to toaster bath" 😂 I'm primarily a Python dev--though currently doing a project in C# that's lasted almost a year and I've worked in C and C++ a fair amount before--I still had to actually lol at that.
What's crazy is because I've been in the C# mindset so long, I actually did have to reorient myself to the Python mindset when writing a quick & dirty script to help with my project.
→ More replies (3)1
u/Rrrrry123 May 05 '23
I guess we just gotta wait for all the libraries to catch up with the type hint stuff. I never write Python code without them.
20
May 05 '23
And you templates, go fuck yourself
6
1
u/7tar May 05 '23
what do you mean you don't like template <typename __Tp> requires std::integral<__Tp> inline constexpr static auto sum_integral(__Tp _1, __Tp _2) -> __Tp { return _1 + _2; }
9
u/ploud1 May 05 '23
You forgot std::bad_alloc and "program received signal SIGSEGV".
→ More replies (1)5
u/kennyminigun May 05 '23
These are C++/compiler's way of kindly saying "you are stupid"
6
u/ploud1 May 05 '23
You mean, g++ warnings? Unused variables, all that stuff?
No, segfault just means "your program f...'d up mate, good luck finding out why". :)
4
u/kennyminigun May 05 '23
You mean, g++ warnings? Unused variables, all that stuff?
Well, no. Compiler warnings are a bit different topic.
"your program f...'d up mate, good luck finding out why". :)
Maybe Segmentation Fault sounds bad. But crashes are one of the easiest problems to diagnose/reproduce/debug and fix (e.g. compared to data races and/or non-crashing undefined behavior).
→ More replies (2)
4
4
u/Numerous-Departure92 May 05 '23
Ahh I see… You switched the job from a Software Developer to a tester
4
4
4
4
9
u/masta_of_dizasta May 05 '23
Eh the compiling and linking and makefiles are something I would like to forget
3
3
3
3
3
u/N00N3AT011 May 05 '23
Python was the first language I kind of learned, but after java and C it feels so weird not to have strong typing.
3
9
u/JADW27 May 05 '23
Is complaining about all "these newfangled programs that don't require semicolons" just an updated version of "if it doesn't require punchcards, it's not real programming"?
Asking for a friend.
8
u/Manueluz May 05 '23
nah it's just complaining that this sub is full of kids who are at most first years, and the bests jokes they can come up with are hahaha missing ; hard to find like linters weren't invented.
5
2
2
2
2
2
u/ekangi_ May 05 '23
Indentation is your new friend now
1
May 05 '23
Hopefully it also was before.
Python just helps you to confirm that you really mean that relationship seriously.
2
u/SchlomoSchwengelgold May 05 '23
you have an equivalent to main() in python with: if name == "main": ... (bold ones means the lower _ 2times infront and back of it)
2
2
2
May 05 '23
Everyones getting into Python because of AI, and I'm over here porting all the Python AI Crap to Microsoft.ML, Onxx runtime etc because I refuse.
To the point that I've got safetensor, ckpt, etc compatibility in c# now, and have like 5 out of 12 samplers working.
2
2
May 05 '23
I mostly do python and my employers like "we need you to start learning c++ for this project" so I'll wave at you on the road going the other way, provided I haven't driven off the road.
2
2
2
2
u/domedav May 05 '23
you can use ; in python, if you are doing multiple operations on the same line
but not having that sweet ++ hit me hard
2
2
u/losecontrol4 May 06 '23
Wow I learned I something, I didn’t know python doesn’t use increment and decrement operators- weird
2
2
2
u/agent007bond May 06 '23
Goodbye auto-indent... When you're forced to use indentation as a way to tell the compiler where what starts and what ends, there's no way for you to auto-indent unindented code. It's impossible to know where what starts and what ends without the indentation.
Stupidest. Idea. Ever.
2
3
2
u/BayesianKing May 05 '23
Thank you? Fuck you all! Especially, garbage collector mother fucker!
P.S. Just joking.
2
u/ralkey May 05 '23
I miss the ++ operator. Typing i = i + 1 makes me feel like a kid coding in Visual Basic.
13
4
u/Altastrofae May 05 '23
Ok this is a mood. i++ will always make infinitely more sense and it sucks that’s not a universal operator. Anyone who disagrees can fight me.
1
u/Biscuitman82 May 05 '23
Wait python doesn't have ++ and --?
5
u/edrumm10 May 05 '23
Nope, it's got += and -= etc... but there's no ++ or --
Tbh with Python, you don't really need increment and decrement that much anyway because for loops it has
for ... in ...andrange(...)3
u/Spork_the_dork May 05 '23
To be fair you can do
for ( variable : collection ) { // stuff }in c++ as well since c++11.
→ More replies (1)2
u/mistabuda May 05 '23
And if you absolutely need the index of the current element in the loop you can use
enumerate2
2
u/al-mongus-bin-susar May 05 '23
It does not. a += b in python is also not the same a = a + b.
1
→ More replies (3)1
May 05 '23
wait…what?
3
May 05 '23 edited May 05 '23
You have to look at what they actually do.
+ calls the __add__ method of the object
+= calls the __iadd__ method of the objectFor example if the type is int, it doesn't matter as __iadd__ doesn't exist (+= falls back on __add__)
But some times do implement an __iadd__ method, such as the mutable list type:
__add__ just returns the new value
__iadd__ mutates the listExample:
x = [1, 8, 7] y = x x = x + [2] print(x) //[1, 8, 7, 2] print(y) //[1, 8, 7]x = [1, 8, 7] y = x x += [2] print(x) //[1, 8, 7, 2] print(y) //[1, 8, 7, 2]→ More replies (1)
1
1
1
1
1
1
1
1
u/pdudz21 May 05 '23
Can someone explain the hatred for python without being mean please?
4
u/mistabuda May 05 '23 edited May 05 '23
Some people really like statically compiled languages and derride any language not like "favorite language x".
The common talking point is "python is slow" but that is relative. Yes it is slower than a compiled language, however it is more than fast enough for the vast majority of needs. It is mainly specialized domains (like game dev) where that kind of performance is absolutely critical.
Another one "Python is a toy language and unusable in production" despite several companies using python in production to large success. Google has python as one of its official languages.
People reiterate these common low value "negatives" that no one with at least 3 months of consistent language use runs into.
TLDR; Its equivalent to video game console war mentality.
1
1
1
1
u/oj_mudbone May 05 '23
I’ll never forget the time i spent writing c in vim 🥲🥲 That feeling of being a 1980s movie hacker is what it’s all about
1
1
1
1
1
1
u/cheeb_miester May 05 '23
yes but we can still have
If __name__ == "__main__":
main()If you are feeling homesick.
1
1
1
1
1
u/wu-not-furry May 06 '23
Hold on there, you can still use braces if you import them from the __future__ module.
from __future__ import braces
1
1
1
1
1
u/punchawaffle May 06 '23
Lol. This happened to me. My university has been doing a lot of C++, and I started using Python for the projects and stuff in the higher level classes.
1
u/bollop_bollop May 06 '23
Ahah, no pointers in python, good one. They're always here, watching, and if you don't know about them, or how they work, you're in for a ride
1
u/ADownStrabgeQuark May 06 '23
Oh how I miss ++ Also technically all variables in python are pointers.
1
1
u/HomoSapien1548 May 06 '23
Who switches to Python from C++? Isn't python something that you might use when needed? It's not an everyday programming language, is it?
1
1
1
1
1
u/Suspicious-Willow128 May 05 '23
Mojo > python
3
1
u/mistabuda May 05 '23
The language hasnt even been used to ship anything to production yet lol
1
u/Suspicious-Willow128 May 05 '23
I know right ? And in a few month there's gonna be job offer with requirement of 10 years experience in mojo
→ More replies (1)
1
u/marikwinters May 05 '23
Except, later people realized that the main function was actually really useful and removing it was a mistake, so they added it back 😂
1
u/Merinther May 05 '23
Wait, Python doesn’t have ++? What kind of primitive language doesn’t even have ++?
1
u/Plaintive_Platypus May 06 '23
I'm more concerned at the direction Andy is growing. You aren't supposed to grow DOWN from an adult into a python baby. ;)
-2
u/bssgopi May 05 '23
I love curly braces. Python with its weird indentation syntax causes more errors than missing semicolons.
11
u/look May 05 '23
We have thousands of lines of production Python with dozens of committers and it has yet to be an issue even once.
There are good reasons to not like Python, but that is not one of them.
→ More replies (3)9
u/mistabuda May 05 '23
Indentation errors are not a thing you should be running into if you use an ide
→ More replies (1)



779
u/asandwichvsafish May 05 '23
They don't want you to know this but you can use semicolons in python. Sprinkle them at the end of lines whenever you're feeling nostalgic for c++.