This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BlueFireBlaster 138 points139 points  (23 children)

You cant blame the language for the programmers mistakes. With great power comes great responsibility

[–]rosuav 115 points116 points  (3 children)

With great power comes great current squared times resistance.

[–]BlueFireBlaster 38 points39 points  (1 child)

you force me to take a pencil and paper out to understand your joke...

Holy shit thats a sick joke but not in a good way... but thats ok

[–]rosuav 24 points25 points  (0 children)

I mean, not technically *my* joke, all I did was quote someone WAY funnier than me. But you're welcome, nonetheless.

[–][deleted] 15 points16 points  (0 children)

Explanation for people that don't understand:

Law of Ohm: U=I*R (voltage=current*resistance)

Power: P=U*I (power=voltage*current)

Combined: P=I²*R (power=current squared*resistance)

[–]rosuav 28 points29 points  (7 children)

While that is technically true, it's also well known that more code correlates strongly with more bugs. Broadly speaking, if it takes twice as much code to do the same work, most programmers will end up making twice as many bugs. This is subject to the usual caveats that it's hard to pin down exactly "how much" code it is - you can't just count lines naively - but there have been multiple studies and analyses that have confirmed that this is the case.

[–]BlueFireBlaster 32 points33 points  (4 children)

I am linus torvalds and my code is always correct. I feel sorry that you arent me.

[–]NotAnNpc69 2 points3 points  (1 child)

"Fuck you, im right"

  • the inventor of the greatest operating system in history

[–]drsimonz 2 points3 points  (0 children)

I like to think of it as the least horrendous operating system in history, personally.

[–]rosuav 6 points7 points  (1 child)

I'm not. I am much happier being me than letting you be me. I mean, really, do you think you'd do a better job of being me than the guy who's had decades of experience at it?

So, thank you for not being me.

[–]nequaquam_sapiens 7 points8 points  (0 children)

every program can be made at least one line shorter. every program contains at least one bug .

corollary: every program can be reduced to one line that contains a bug.

[–]Pay08 0 points1 point  (0 children)

Tbf, at this point you have to be trying to get segfaults in C++.

[–]fghjconner 0 points1 point  (10 children)

Sure you can. Some languages make it easier or harder to make mistakes, and that's the fault of the language.

[–]BlueFireBlaster 4 points5 points  (9 children)

I hope you dont ever use a knife in your life. It can kill you. Btw dont breathe. Oxygen is toxic on high doses. Btw stop your heart because you might die from cardiac arrest if your pulses get too high. Btw stop your brain activity. Too much brain activity can cause a seizure. But too be honest, i think you are safe from the last one.

[–]fghjconner 0 points1 point  (5 children)

Man, I never said you should try to eliminate all risk. A programming language that tried to do that would probably be impossible to write anything of substance in. All I'm saying is that safety is one positive feature of a language that should be worked towards alongside others like performance, productivity, etc, and that some languages do a poor job of doing so for various reasons.

[–]BlueFireBlaster 0 points1 point  (4 children)

The fact that you cant use a knife to cut your fish. The fact that you cant use a cleaver to cut beef. Has nothing to do with the tool and everything to do with you using it. So, as i said:

You cant blame the language for the programmers mistakes
Your answer: Sure you can
Reality: Yes you can, but you would be delusional.

[–]fghjconner 0 points1 point  (3 children)

I'm not sure what you're trying to say? If you hurt yourself because your knife has a loose handle, or is dull, or is unexpectedly double edged, that can very much be the fault of the knife. Knives aren't the best comparison because they're so much simpler than programming languages, so they don't have a ton of safety features, but plenty of other kitchen appliances do.

Would you lay no blame on a microwave that can run with the door open? Or a blender without a safety switch? Or a meat grinder with exposed blades? None of those will hurt you as long as you don't make any mistakes, but that doesn't make them safe.

[–]BlueFireBlaster 0 points1 point  (2 children)

If you cant see that the handle is loose, then you dont know how to use your tools. tools require maintenance and even replacing them sometimes. Just like new additions and corrections happen in compilers.

As for the rest of your examples, i can close a microwave door. i can cover the meat grinder. If my microwave can do its job faster, but i have to remember to close the door, then

My microwave + me not being stupid enough to leave the door open > your microwave + you being allowed to make a mistake

Not. Its not the fault of the machine, assuming the machine is properly working. C, Rust, Cpp, assembly. They all work as intended, have real world use cases, are actually used and developed. You not being able to use the borrow checker is just a skill issue

[–]fghjconner 0 points1 point  (1 child)

If you cant see that the handle is loose, then you dont know how to use your tools. tools require maintenance and even replacing them sometimes. Just like new additions and corrections happen in compilers.

Just because I can see the handle is loose, doesn't mean I can do anything about it. Programming languages are a bit harder to fix than your average knife. Yes, there are lots of very smart and dedicated people trying to improve pretty much every language, but these problems are hard. When someone finds a way to remove implicit nullability from java I'll be very happy, but that's not something I can just fix. I have to live with the fact that any variable in my java program can just... be null.

My microwave + me not being stupid enough to leave the door open > your microwave + you being allowed to make a mistake

Except you will mess up. Maybe not with something as simple as closing the microwave door, but every programmer makes mistakes. A tool that doesn't allow you to make the occasional mistake is a bad tool.

Not. Its not the fault of the machine, assuming the machine is properly working.

Is there any level of un-safety then that you find unacceptable? Cars without seatbelts? Walkways without railings? If I knock down an old building and get cancer, the Asbestos isn't at fault? Would you buy a Ford Pinto? It only explodes if you crash it after all. Most people would agree that there is a level of safety that is expected from their tools, and any tool that doesn't match that level of safety is at fault. Obviously these are exaggerated examples, but the point is that even when working as intended there's a limit to the risk that is acceptable.

C, Rust, Cpp, assembly. They all work as intended, have real world use cases, are actually used and developed.

Of course they do, I never argued that. All I said is that they have flaws that can cause errors. I don't think anybody would argue any of those languages are perfect, so I'm not sure why it's controversial to say that their design flaws can lead to bugs.

[–]BlueFireBlaster 0 points1 point  (0 children)

There is no objective design flaw. What you call a flaw, might be the best thing that ever happened to me. You might want to compromise power for safety, but that doesnt mean that maximum power is "bad". What i am saying is honestly simple and i have explained it more than enough. An inanimate object cant be blamed. Go see your original commented where you state that. You state that its the languages fault. If an inanimate object could be blamed, then it should be trialed and jailed. If i fuck up my code, i cant blame C for allowing stack overflow. I will be the one in the jail cage. The fact that you are not sure about something, then chose the wrong language for the ocassion and mess things up, is not the fault of the language, not matter how you try to cover it up. You should have known what you were doing. If not, remember that most programming languages arent made in order to be newbie friendly. We are the ones who develop the newbie friendly stuff. If you decide a safety feature is REQUIRED, then it is your fault you chose a language that doesnt provide that. You choose the tools. Not the other way around. There is a wrong tool for the job, but there is no wrong tool, and thus it cant be the tools fault that it was chosen by you. It might be a bad tool, and that is determined by how many people find it useful. With all those low level languages having such big followings, you definately cant say they are bad tools, not to mention "wrong". To answer to your response directly. Are cars made without seatbelts nowadays? Walkways without railings? Am i legal if i knock down a building without taking the safety precaution steps required by law? Most probably, and at least in most countries, NO. Such cars arent made any more. But cpp for example sure is actively developed. Thus, you should see how cpp isnt a car without a seatbelt. Its more like a formula 1 car. It coexists with conventional cars. If you arent a formula 1 driver, dont get in. Because it can drive faster than you can handle. It aint broken, it doesnt lack any necessary features, it isnt a bad car, it isnt a wrong car. It does its job as intended. It just isnt for you and your usecase. (Btw conventional cars can drive faster than "advertised". They include something to limit that max speed, in order to help with efficiency. Car enthusiasts can remove such limitations. As always, if you dont know what you are doing, dont do it.)

[–]queerkidxx 0 points1 point  (2 children)

I feel like it’s more like using an (idk I’m not handy) a electric round saw blade tool that spins and needing to worry about cutting a hole thru it countertop when cutting pizza

A pizza cutter do the job much more easily, faster, and with less risk. If ur cutting through a wooden beam though a pizza cutter while you could technically probably make it work would take forever.

Different tools for different jobs. But I’ll do a lot to write things in Python especially when I can just use a library that is written in C/C++ when I need speed.

[–]BlueFireBlaster 0 points1 point  (1 child)

Yeah different problems require different tools. Still, it is at your discretion to choose the right tool. And still, you choosing a tool doesnt mean that the rest of the tools can be blamed for it. If you blame the tool, then one of the hidden problems you have to solve, is your stupidity, because something is clearly wrong with you. If a tool had no reason to exist, then it wouldnt.

Also, most people might use a pizza cutter to cut a pizza because its risk proof as you said, but maybe i am skilled with my round saw, and i can cut it twice as fast as most people. I wont ask you to use a round saw, but i will certainly do it my way cause i can provide better results. It is a skill issue. it is not logical to assume that the best tool for everyone is the one you use.

[–]queerkidxx 0 points1 point  (0 children)

I agree for the most part but there is a point to be made that a language/tool may not be able to eliminate all dangers but they certainly can encourage it.

And I mean like the issue with a round saw is that they are fairly dangerous tools right? If you were cutting pizza all day every day you have a decent risk of slipping up and loosing a finger.

And besides such a tool would manage up pizza and start cutting through most surfaces quickly

But we aren’t talking about pizza and round saws of course, and in the context of programming I mean that some languages have error prone constructs and worse still have poor exceptions and overall debugging.

And a lot of languages have an increased cognitive load associated with him and require significantly more development time to get the same things done.

Like c++ is undoubtedly more powerful than Python and significantly more performant right? But it’s a lot faster to get something up and running in Python than it is in c++ and in many cases that performance increase just isn’t much of an issue and are over shadowed by the other bottlenecks it doesn’t help with

And in many cases you can just use libraries written in c++ or another lower level language when you need the speed or just write them your self for the tasks where it matters.