65

So, my lab mate tried to mansplain to me that Python is faster than C/C++.
It took all my self control not to smack him in the face with a chair.
Using Numba means it's no longer interpreted as Python, so it doesn't count.

Comments
  • 17
    Smacking him in the face would have been to cruel. For the chair, obviously.
  • 33
    Feign the dumb woman routine and ask him what language python is written in.

    When he inevitably says C ask him how python can be faster than C if it's written in C.

    If he says he doesn't know, tell him you're surprised someone of his wide breadth of experience couldn't know.

    Guy sounds like a fucking dumbass though, so my hopes of him learning anything are practically zero.
  • 6
    Development can be faster, until you know, need the raw speed. Then you gotta port it to C++ or write a module. Or use something else.
  • 12
    @sariel I asked him if he thinks there's a reason our advisor chose me to write RT code for actual robots, and not him :)
    I am pretty sure he doesn't know his beloved Numpy is written in C.
  • 2
    @korrat Give him the chair! lol
  • 9
    @Demolishun I agree that for PoC, research and things that don't need speed, Python is a solid choice. But we are a robotics lab, so we do care about performance.
    Python is also perfect for data visualization. Wouldn't want to do that in C.
  • 4
    @NickyBones I do data visualization in C++... I do like SciPy though.
  • 2
    Of things I wish ROS developers understood.

    I also wish more people understood scripting languages such as python should be fucking compiled for runtime, particularly for hardware acceleration, but not forced on developers who have to deal with their own damn system complexities. (Tensorflow did something like that, iirc)
  • 0
    @Demolishun Is it open source? How painful was it?
  • 1
    @NoMad All my nodes are in C++, and the core code they call as well :)
  • 6
    One other student back in uni (4th or 5th semester of computer science) once tried to convince that python is “one of the fastest languages in the world”, because it, and I shit you not, “can be converted to assembly”.

    My friend then kinda dragged me out of the room before I committed a crime.
  • 6
    @LotsOfCaffeine Of course, Python is so unique for being converted to assembly :) The reason Photons travel in the speed of light is because they are converted to assembly, and notice both start with a P! A coincidence? I think not.
  • 1
    @NickyBones ah yes that must be this optical computer I have heard about
  • 2
    Taking this the other way, I'd be interested in seeing what dark arcane horror one could do in Python (beyond just Numba) to get C-like (or just "much better") performance. The key difficulty is the lack of control that Python gives you by default.

    Pushing languages way beyond what they're meant for (for no real reason, just lulz) is fun.

    PyPy for example is a promising approach, although it isn't really for numerical code, but I'd imagine a faster JIT, some ast hacking, and some type annotation could do a lot (look at how surprisingly fast JavaScript can go with modern JITs).
  • 1
    @sariel you can write a compiler in python which will produce programs that run faster than similar python. The argument of "if it's written in X then it cannot be faster than X" is false.
  • 4
    I'm just gonna call out that "mansplain" is sexist. He can be a piece of shit but that doesn't have anything to do with men.
  • 0
    PyThOn iS fAsTeR than C/C++ ?

    WHAT THE FUCK????????? Did he embedded programming before, how can he tell? C/C++ is still the best for certain cases and faster than Python.

    Without C/C++, Python won't be available.

    In some case, python are fast , in some c/c++ are fast. Well, in ML it is much easier to write the programme in python compared to c++ of course. But in hardware, I prefered c/c++
  • -1
    @ctrl-alt-del <----------------------------- this guy is preaching , wow.
  • 1
    Nicky are most people on that academic level in terms of computer science that dense?
  • 3
    @johnmelodyme wrong, I'm enjoying this womanrant
  • 3
    @ctrl-alt-del Womanrant? sounds like new project .
  • 1
    @johnmelodyme hahahaha

    and what will women rant about there? Periods vs perverts, which is more annoying?
    Won't be as fun to read imo.
  • 0
    Mansplaining is a term made up by radical feminists.
    He is plainly and simply a giant asshole.
  • 2
    @RememberMe But if you make Python strongly typed than you lose a lot of the comfort that it provides for people that are not C/C++ people. So I am not sure what the gain is. Just go for a strongly typed language to begin with.
  • 4
    @PonySlaystation @ctrl-alt-del He's a giant asshole if he does this to everyone. He is mansplaining if he does it only to me (a girl), and not to any of the other guys in the lab.
    I can tell the difference, thank you gentlemen for your concern.
  • 2
    @AleCx04 Many are shit programmers, but very few are so proud to be shit programmers and brag about their idiocy. I actually work with a guy who is a solid C++ programmer, and previously worked for iRobot. He's great.
  • 2
    @NoMad We can start from why the fuck office chairs are so high by default, that even set to the lowest settings, my feet still barely scratch the ground.
  • 1
    @NickyBones YESSS!!! I even sit funny when focusing and honestly office chairs just don't accommodate and change my posture and reduce my productivity by about ~40%. (Probably better for my back, but oh well!)
  • 1
    @NickyBones maybe you're a gnome 🤔
  • 1
    @iiii I am a bit behind with the beard growth though.
  • 1
    @NickyBones I use Qt libraries. Also Qwt. Its code.
  • 0
    I don't know C, but B is faster than Python
  • 1
    @NickyBones I see. Just don't let them dumbfucks get to you. Those here that appreciate you know that you are solid as hell.
  • 0
    GIVE HIM THE CHAIR
  • 0
  • 1
  • 1
    @NickyBones oh I agree, but notice the "just lulz" :p

    Besides, type annotations in python are kind of interesting, they're not baked in or enforced by the interpreter/runtime (iirc) like in a language with a "proper" type system, they're just hints that can be used by third party tools...or your own. I think that's a great compromise.
  • 0
    @johnmelodyme I mean B(ee), but good to know it
  • 0
    As someone who knows the pain of trying to get python to run even close to c or c++ or hell even java‘s speed I really admire your level of self-control😂
  • 0
    @RememberMe Yes very fun. Painful but fun. XD
  • 0
    @emperor66 A few years back I was playing with scipy for fractals. Pushed it all to gpu. It got really fast all of a sudden.
  • 1
    so fast, that must be why python libraries are written in c++ 🙄
Add Comment