Explain to your boss the cost/benefit of using a higher level language over c.
C's benefit historically has been performance. I think the case for performance is becoming less compelling for 2 reasons:
1) The performance gap is closing, thanks in particular to projects like cython that let you write python code that gets converted over and compiled as c++ that's often more performant than the c++ code that devs might write themselves.
2) In general, the cost of hardware continues to drop while the cost of developers goes up. C takes longer to write than eg Python--I don't care who you are, it does. And if you're the god programmer of C, you probably cost a lot.
So what would be the benefit of c for your boss really? It will cost more to develop, and the performance gains may not be as noticeable. It would quite possibly be bad business.
>The performance gap is closing, thanks in particular to projects like cython that let you write python code that gets converted over and compiled as c++ that's often more performant than the c++ code that devs might write themselves.
Well it's obvious you haven't done any systems programming.
>In general, the cost of hardware continues to drop while the cost of developers goes up. C takes longer to write than eg Python--I don't care who you are, it does. And if you're the god programmer of C, you probably cost a lot.
That's not what experiments have borne out, time-to-develop generally has a lot more to do with proficiency in the language of choice and in the problem domain than the language itself. I will say, however, that it is generally slower to write things in C, but not so drastically that it merits abandonment.
>So what would be the benefit of c for your boss really?
A solution that would reliably fit within the real-time and maintainability requirements of the problem being solved, unlike a throughput-focused GC'd language like C#.
Specifically what experiments have shown that people can write in C faster than python? You even admit yourself that it "generally" takes longer. I think it just plain takes longer. Of course that's anecdotal, but if you've got something non-anecdotal, I'd love to see it.
And since you've been so steeped in systems programming, would you not agree that the performance gap is shrinking? I think that's hard to argue against. And who said anything about abandonment? There's a place for C, but there are fewer than there used to be.
But hey man, sorry if I offended you, maybe you're having a bad day.
I would take GP's comment over someone preaching on a subject that he has no direct experience with. Latter is far more damaging to the discussion. The insulting tone is well justified.
Having done my share of kernel development I can assure you that anyone who brings up a topic of rewriting Linux kernel in (even) C++ gets laughed out of the room. When someone starts suggesting that there are plausible alternatives to C for kernel development, it is indeed a clear indication of no prior experience with the subject matter.
You can make the exact same point in a way that doesn't smell of the condescending dick-waving and "laughing people out of the room" that debases the level of discourse. I think that HN can and should be a more civil community than Linux kernel programmers.
Here, let me take a stab at it:
"In my experience with systems and kernel development, there are some scenarios where working with a higher level language than C simply isn't possible. This sure looks like one of those scenarios to me. If the manager in this example is mandating that it be written in C, it could be that the manager knows this from painful experience."
You are missing the point. Condescending dick-waving is there to discourage original poster from making half-assed assertive comments in the future. I understand that you don't like it, but it is the most efficient way to carry the point across.
> Here, let me take a stab at it:
Nope. Wishy-washy, excuse me this, excuse me that, I'm pretty certain to a degree that I might be right if you don't mind me saying. Not discouraging enough.
If you want another justification for the tone, let me tell you that I would've not hesitate to say the exact same thing in person, which is the criteria for wording HN comments as per pg's original guidelines.
> "I would've not hesitate to say the exact same thing in person, which is _the_ criteria for wording HN comments"
That is the second criteria. Immediately preceding it is "Be civil." Shortly after is an example: "That is an idiotic thing to say; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."
Intentionally using an aggressive and insulting tone seems more harmful to the community than expressing the opinion that there is a performance gap between C and higher-level languages, but that gap is narrowing
How dangerous is that opinion, anyway? I mean, even if the opinion were demonstrably incorrect, is it so important to keep someone from daring to express it a second time?
There is real and legitimate compiler and JIT research, like PyPy, that could lead to reasonably efficient implementations for dynamic languages that can be expressed in RPython.
It is not, however, under any circumstances going to lead to code that's any faster than what an experienced C programmer can produce.
That's a "hard problem" in the mathematical sense is essentially impossible for reasons related to the halting problem and writing programs that can holistically analyze programs. For similar reasons, I find the type-fascism of the Haskell community amusing, although I find stronger type systems useful.
If aren't familiar with the implications and realities of systems programming and/or compiler implementation, stop making false statements about it.
Ask questions, read books, but don't toss out ridiculous bull-honkey like:
>thanks in particular to projects like cython that let you write python code that gets converted over and compiled as c++ that's often more performant than the c++ code that devs might write themselves.
I'm actually pretty familiar with Cython and have spent many man-hours optimizing Python code.
I'm a relatively terrible C++ and C programmer, but I can still produce code that profoundly outpaces Cython.
The only way to write C/C++ code slower than Cython is to use the wrong goddamn algorithm or data structure. (like std::list when you should be using std::vector)
Also, the protocol holds for me here too. I'd gladly say all of this to your face. Stop projecting manufactured confabulations about programming into the ether.
To be clear. I'm not the one who said anything about Cython or cross-compiling or anything. I hadn't even heard of Cython before and I don't have any strong opinions about it.
I don't doubt that you're right about all of the facts, that hand-rolled C will be faster than something cross-compiled unless the C coder did something profoundly wrong. I'm sure that lots of people are surprised and annoyed that all systems and kernel-level work is done with a language as out-of-fashion as C and ask stupid questions on other forums. You're right. The original poster was wrong. You win. Hooray!
But, here's the thing, I don't care how right you are, I care that you're violating the #1 commenting guideline and the thing that I generally like about this community, which is "be civil". So, even if you're the sort of person who wouldn't be civil to my face, please be civil here.
If you can do that much for me, I'll gladly buy you a coffee or beer if you're ever in Seattle and you can be as rude as you like to my face. Fair?
You're using the community guidelines as a shield to hide behind while you de-emphasize the fact that you were completely wrong and feigning to compensate for your total lack of experience in the relevant subject.
Stop using the community guidelines a shield. Own up to the fact that you were more than merely ignorant, you were aggressively promulgating and infecting others with falsehoods borne from your ignorance which is a kind of behavior I can't even begin to fathom the reasons for.
This is where it starts. This is how the incorrect campfire knowledge starts. CompSci and software engineering are rife with this plague and you are subject zero. CompSci is notorious for being, get this, unscientific because of the amount of false folk knowledge that gets bandied about.
Our lack of rigor, from the point of a view of an experimentalist and also an engineer, is dishonorable and unnecessary.
Your behavior shames all professional programmers.
So, lesson learned. I'll honey up my criticisms. I'll find ways to communicate that are pleasant and convincing.
That doesn't change that you'll never be free of my contempt, even if I'm being nice.
Keep the beer and coffee, you want to do me a favor? Don't ever do that again.
I don't tell my lawyer, my accountant, or my doctor how to do their job. I'll get a second opinion where prudent, but other than that, I don't assume I know more than somebody who's spent a good chunk of their life specializing into that field.
Extend the same professional courtesy to your fellow programmers who specialized in a different field than you.
Get a second opinion if you like.
But stop spreading your ignorance.
I have about as much patience for mollycoddling your ego as a doctor would for Jenny McCarthy telling people how dangerous and pointless vaccines are.
I totally agree with that. I respect people who know more than I do and I don't tell any specialist how to do their job. But I sure as hell don't like it if a doctor or lawyer or accountant rolls their eyes at me and speaks to me in a dismissive or condescending tone because I'm trying to have an informed opinion even though I don't have the same degree of expertise that they have. Here's an example:
Me: "I've done some research and I think I should get a Roth IRA..."
Accountant A: "Roth? Seriously? Sigh... You obviously don't know a damn thing about tax planning. Good thing I'm here to save your sorry ass. You need a traditional IRA"
-or-
Accountant B: "Actually, in this case, a traditional IRA would make a lot more sense than a Roth IRA. It's a common misunderstanding."
Technically, they are both on the same page, but tonally, the difference is huge. Our industry has too many people who act like Accountant A.
1) The original question was how to convince his boss that C is a bad choice. My answer is a good way to do it.
2) Re: my direct experience...
If you're talking about writing C, that's not true. But it has been a while because, frankly, I'd rather not torture myself. If you're talking about embedded programming, you're right, I haven't touched it.
If you're talking about applications where performance is very important, I've been dealing with quite a bit of HPC type stuff over the last year or so. In general, the hardcore C/C++/Fortran guys are becoming less useful, for reasons I stated in my OP. Notice I'm not saying "useless", I'm saying "less useful". There are absolutely applications in which this just isn't possible, so use what works. But applications where C is your only choice are becoming rarer and rarer.
And while we're here, where exactly did I say that the linux kernel should be rewritten in some other language? I didn't. So why would you suggest that I did?
You're certainly welcome to disagree, but if you think that that warrants an insulting tone, it may just be because you're an asshole. It wouldn't be an internet first.
C's benefit historically has been performance. I think the case for performance is becoming less compelling for 2 reasons:
1) The performance gap is closing, thanks in particular to projects like cython that let you write python code that gets converted over and compiled as c++ that's often more performant than the c++ code that devs might write themselves.
2) In general, the cost of hardware continues to drop while the cost of developers goes up. C takes longer to write than eg Python--I don't care who you are, it does. And if you're the god programmer of C, you probably cost a lot.
So what would be the benefit of c for your boss really? It will cost more to develop, and the performance gains may not be as noticeable. It would quite possibly be bad business.