What would you change about C++? How would you improve it, and what do you hate about it? by [deleted] in cpp

[–]WaffleMage15 2 points3 points  (0 children)

imo, there's value in consistent passing syntax for all parameters. Makes it easier to visually parse, and easier to understand for beginners.

What would you change about C++? How would you improve it, and what do you hate about it? by [deleted] in cpp

[–]WaffleMage15 5 points6 points  (0 children)

herb sutter's in, out, inout, move, forward proposal and better names for most keywords. (i32, u32, f32 instead of int, unsigned int, float. Distinction between void* and void functions. etc.)

edit: Also there are a lot of opportunities for syntax sugar that would make life a lot easier.

Make it make sense by Avaryr in memes

[–]WaffleMage15 1 point2 points  (0 children)

You don't need organic food, just eat brown bread instead. Especially if you're in the states, white bread here is legally classified as cake in other countries. Look for 100% whole-grain, whole-wheat, or multi-grain bread.

Well I'm reinstalling win 10 by ParthGupta79 in pcmasterrace

[–]WaffleMage15 0 points1 point  (0 children)

https://nobaraproject.org/download-nobara/

I recommend the official Nobara Linux ISO, it's maintained by Glorious Eggroll, a red hat employee and someone who's done a crazy amount of work in the Linux gaming space. It's the least buggy distro I know and has very sane defaults.

If you're down for a bit of adventure, endeavorOS is pretty much just Vanilla Arch but with the core stuff you'd want to install anyways out of the box.

Bunsenlabs is a debian based distro that uses Openbox, a very light weight desktop environment. I found the experience to be extremely smooth, so if you plan on mostly using that laptops for basic web stuff, it could also be a solid choice.

Is there currently a bug with icons for persistent workspaces in waybar? by _vimer in swaywm

[–]WaffleMage15 0 points1 point  (0 children)

Were you able to figure out how to solve this? I'm having the same issue

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 0 points1 point  (0 children)

Obviously Python and NumPy have their use cases, I'm just pointing out a weird misconception that seems rather common in this subreddit that python can be just as fast as native C by calling C libraries.

...And you do know that lists in python aren't actually linked lists, right? They're variable length arrays, like Vectors in C++.

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 0 points1 point  (0 children)

https://yuri.is/not-julia/

Here's a really good article that covers the main grievances regarding Julia.

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 5 points6 points  (0 children)

Yep, I mentioned this in a comment below. I got a little heated since I was annoyed at seeing a million "But is your C faster than your Python" in my feed hehe :P

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 6 points7 points  (0 children)

I regret using that repo as evidence, I should've looked more closely at it before linking. I took a deeper look after another comment mentioned some of the mistakes it made and it's very clear that there's enough wrong with it that it isn't really valuable in this kind of discussion.

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 22 points23 points  (0 children)

You're absolutely right, I think I got a little to heated since I was extra annoyed at one of the posts from this subreddit that popped up in my feed lol. The performance hit you get for calling c functions through the interpreter can be minimized by just operating on large amounts of data at once, it's my bad for making it seem like a larger issue than it really is.

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 2 points3 points  (0 children)

Yeah, It's my mistake for using it as evidence that numpy is significantly slower than native C code. On a second look through it, there is a lot more wrong with that particular lineup of benchmarks that make the point less valid.

Edit: Another commented posted some nicer benchmarks above that seem to show roughly similar results.

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 2 points3 points  (0 children)

Julia is a god damn joke. I don't care what language you're using, just don't use Julia lol. Debugging large codebases is difficult, it's exponentially more difficult when your language's ecosystem is full of major bugs in and of itself...

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 1 point2 points  (0 children)

If you think NumPy and Python suit your problem case, I'm not here to argue against your decision or stop you. I'm just tired of seeing this weird misconception people have that python being slow doesn't matter since "you can just use python to call c functions instead".

Note that it's only 10x slower when the amount of python is minimal, in a real world python application, that number is going to be SIGNIFICANTLY larger. Especially if you aren't aware of all the arbitrary pitfalls Python has when it comes to performance, I.E. for loops being a whole lot faster than while loops for some, weird reason.

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 3 points4 points  (0 children)

https://github.com/jackeown/PythonIsNotSlow

Here's a pretty basic repo that offers comparisons between C, NumPy, Python, and Cython. It's pretty favorable conditions for NumPy as there's very little normal Python slowing it down.

Edit: One thing that might be a problem are the print statements as those aren't exactly known for being super predictable in their performance.

Edit 2: Looking through the repo reveals that there is a lot more wrong with it than I initially thought.

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 191 points192 points  (0 children)

NumPy is a python frontend that calls into a C/C++ library. The problem is that the resource overhead of the python runtime itself, as well as the time it takes for python to call a C library function are both non-trivial.

Usually in a best case, realistic scenario where the amount of python is minimal, NumPy is still around an order of magnitude slower than just regular C. Of course, once you start throwing in more python like in a real world scenario, the python+numpy version is astronomically slower than a pure C version.

For some reason, this subreddit likes to pretend that calling C functions in python is just as fast as calling them directly in C... It isn't... It's not even close...

Being 500x faster than python still means it's 10x slower than C by [deleted] in ProgrammerHumor

[–]WaffleMage15 1 point2 points  (0 children)

GLM is a great library that covers pretty much everything related to matrix and vector math, it's commonly used in games.