There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmerhumor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

418teapot , in `"☹️".reverse() == "🙂"`

Best I can do is


<span style="color:#323232;">"ude41🙂".split("").reverse().join("")
</span>

returns “ude42🙁”

affiliate , in We have been played for fools

and then they had the audacity to put that picture on the cover of the textbooks

_____ , in We have been played for fools

I love C++ I love C++ I love C++ I love C++

>does big something with C++

I hate C++ I hate C++ I hate C++ I hate C++

wizardbeard ,

Honestly that’s most things in life.

The more complex your project, the more likely you are to run into the rough patches or quirks of whatever it is you’re working with.

Psythik , in We have been played for fools

The people who invented C++ never went outside, otherwise they would have never invented C++.

xilliah , in We have been played for fools

Directx 9000

pelya , in We have been played for fools

C++ is fiiiiine. Just use the modern variant of the language, don’t bother with hand-optimizing your memory allocators, and generally avoid anything involving pointer arithmetics. So, basically, use it like you would use Python.

raspberriesareyummy ,

So, basically, use it like you would use Python.

That’s a great way to get performance as shitty as python’s.

zik ,

C++ can do a lot of things but one thing it can’t do is perform as poorly as python.

nexussapphire ,

Cython

raspberriesareyummy ,

Not quite, but smart pointers in the wrong location can be quite wasteful in terms of CPU cycles.

thebestaquaman ,
thebestaquaman ,

This is a very “yes but still no” thing in my experience. Typically, I find that if I write “naive” C++ code, where I make no effort to optimise anything, I’ll outperform python code that I’ve spent time optimising by a factor of 10-30 (given that the code is reasonably complex, this obviously isn’t true for a simple matrix-multiplication where you can use numpy). If I spend some time on optimisation, I’ll typically be outperforming python by a factor of 50+.

In the end, I’ve found it’s mostly about what kind of data structures you’re working with, and how you’re passing them around. If you’re primarily working with arrays of some sort and doing simple math with them, using some numpy and scipy magic can get you speeds that will beat naive C++ code. On the other hand, when you have custom data structures that you want to avoid unnecessarily copying, just rewriting the exact same code in C++ and passing things by reference can give you massive speedups.

When I choose C++ over python, it’s not only because of speed. It’s also because I want a more explicitly typed language (which is easier to maintain), overloaded functions, and to actually know the memory layout of what I’m working with to some degree.

raspberriesareyummy ,

I guess I should have clarified in my original comment that I was exaggerating - obviously, C++ doesn’t get as bad as python, not even into the same ballpark.

My emphasis was on “don’t use C++ like you would python” because that’s not good advice imo.

ampersandcastles , in When you realize you're the villain

I would never do such a thing.

solsangraal , in When you realize you're the villain

every time you wash your hands, you murder billions of innocent tiny organism who are just tryna live life

borth ,

Should’ve picked a different host lol

FiniteLooper ,

This same advice is true for the JavaScript situation as well sometimes

HStone32 , in We have been played for fools

its even worse that they hat to ruin a beautiful existing language to do it.

milicent_bystandr ,

FORTRAN?

Chadus_Maximus ,

My beloved

CanadaPlus , (edited )

Burn the heathen.

Sorry, I mean


<span style="color:#323232;">START PROGRAM BurnTheHeathen
</span><span style="color:#323232;">Burn&
</span><span style="color:#323232;">the heathen !.
</span><span style="color:#323232;">END PROGRAM
</span>

/s

anguo , in When you realize you're the villain

I make only static sites and avoid having any overhead. Just Eleventy for building and some minimal vanilla JS where needed.

CanadaPlus ,

You’ll never make it as a big time web dev.

Probably not /s, sadly. It’s they that are wrong, not you.

anguo ,

Ha, it was never my ambition.

milicent_bystandr , in We have been played for fools

What if we didn’t want more sea, just spikier? C#

I look out acroth the thea, and thee what I can thee. I can’t pronounth that thtupid language; I’ll write in lithp.

Ocean + traversing a desert => Ocaml?

I improved the C! It is greater! More potent! But what is this? I look at at my poor boat, upon which I traverse the waves of the C++ 7; now it is degraded. Now its beautiful metal hull has oxidised. Oh, the dangers of the C. …Wait, that gives me an idea…

lobut , in When you realize you're the villain

Nah man, I minify it so it’s one line…

wait how many files am I loading again? wait, 6000? nuts.

jeff , in We have been played for fools
@jeff@programming.dev avatar

My favorite project was C++; it was big, it was complicated, there was a massive team working on it, I got to work with high level abstractions while occasionally dealing with really low level concerns.

It was really hard, but now writing code in every other language I’ve worked in has been really easy.

PeriodicallyPedantic , in It happens each time!

I suck at git.
I’m currently rebasing 17k commits into my branch. I’m letting it run overnight.

I’m disgusting.

collapse_already , in It happens each time!

I literally make a new branch. clone, and use an external merge tool (beyond compare) when my branch has fallen too far behind. I don’t trust any of the automated processes.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines