this post was submitted on 18 Nov 2024
195 points (78.8% liked)

Memes

45896 readers
1526 users here now

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.

founded 5 years ago
MODERATORS
195
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/[email protected]
 

Check out my new community: [email protected]

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 35 points 1 month ago (4 children)

Ah yes, those precious precious CPU cycles. Why spend one hour writing a python program that runs for five minutes, if you could spend three days writing it in C++ but it would finish in five seconds. Way more efficient!

[–] [email protected] 31 points 1 month ago* (last edited 1 month ago) (3 children)

Because when it is to actually get paid work done, all the bloat adds up and that 3 days upfront could shave weeks/months of your yearly tasks. XKCD has a topic abut how much time you can spend on a problem before effort outweighs productivity gains. If the tasks are daily or hourly you can actually spend a lot of time automating for payback

And note this is one instance of task, imagine a team of people all using your code to do the task, and you get a quicker ROI or you can multiply dev time by people

[–] [email protected] 18 points 1 month ago (1 children)

That also goes to show why to not waste 3 days to shave 2 seconds off a program that gets run once a week.

[–] [email protected] 1 points 1 month ago* (last edited 1 month ago)

Agreed. Or look at the manual effort, is it worth coding it, or just do it manually for one offs. A coworker would code a bunch of mundane tasks for single problems, where I would check if it actually will save time or I just manually manipulate the data myself.

[–] [email protected] 5 points 1 month ago (1 children)

You can write perfectly well structured and maintainable code in Python and still be more productive than in other languages.

[–] [email protected] 1 points 1 month ago

This site has good benchmarking of unoptimized and optimized code for several languages. C+ blows Python away. https://benchmarksgame-team.pages.debian.net/benchmarksgame/index.html

[–] [email protected] 1 points 1 month ago* (last edited 1 month ago)

SDLC can be made to be inefficient to maximize billable hours, but that doesn't mean the software is inherently badly architected. It could just have a lot of unnecessary boilerplate that you could optimize out, but it's soooooo hard to get tech debt prioritized on the road map.

Killing you own velocity can be done intelligently, it's just that most teams aren't killing their own velocity because they're competent, they're doing it because they're incompetent.

And note this is one instance of task, imagine a team of people all using your code to do the task, and you get a quicker ROI or you can multiply dev time by people

In practice, is only quicker ROI if your maintenance plan is nonexistent.

[–] [email protected] 10 points 1 month ago (1 children)

Welp, microcontrollers say hi

[–] [email protected] 3 points 1 month ago

Welp, I'm not saying you should use Python for everything. But for a lot of applications, developer time is the bottleneck, not computing resources.

[–] [email protected] 3 points 1 month ago

So, I've noticed this tendency for Python devs to compare against C/C++. I'm still trying to figure out why they have this tendency, but yeah, other/better languages are available. 🙃

[–] [email protected] 0 points 1 month ago (1 children)

exactly! i prefer python or ruby or even java MUCH more than assembly and maybe C

[–] [email protected] 10 points 1 month ago* (last edited 1 month ago) (1 children)

I mean, I'd say it depends on what you do. When I see grad students writing numeric simulations in python I do think that it would be more efficient to learn a language that is better suited for that. And I know I'll be triggering many people now, but there is a reason why C and Fortran are still here.

But if it is for something small, yeah of course, use whatever you like. I do most of my stuff in R and R is a lot of things, but not fast.

[–] [email protected] 3 points 1 month ago

But if it is for something small, yeah of course, use whatever you like.

or if you have a deadline and using something else would make you miss that deadline.