8 ms·
Convincing C programmers to switch to C++: A look at human behavior (2016)
- faragon 9y agoAlready discussed in HN: https://news.ycombinator.com/item?id=12573886 https://news.ycombinator.com/item?id=12573886
- a_imho 9y agoas well as https://news.ycombinator.com/item?id=51451 https://news.ycombinator.com/item?id=51451
- strictfp 9y agoPeople aren't rational actors for a reason: Sometimes things are easy to argue for but aren't that great in practice. And so by following your heart instead of your head, you sometimes make seemingly illogical but objectively better decisions. And I think that there is a case to be made about how C++ is efficient in theory, while C is effective in practice.
- DarkKomunalec 9y agoYou hit my pet peeve right on the head - our instincts, such as fear of the dark, not wanting to touch dead bodies, etc., may be irrational, but there's usually a good reason we have them, and going against them without first understanding them is what is irrational. I still vastly prefer C++ over C though :P
- kbenson 9y ago> And so by following your heart instead of your head, you sometimes make seemingly illogical but objectively better decisions. And sometimes you make seemingly illogical decisions that end up being objectively worse decisions. The problem is that we don't really have a way to quantify our emotions usefully, which means we can use them accurately and are forced to allow for enormous amounts of error in our calculations when we provide any level of significance to them. That's why they are often seen as detrimental to rational decisions, not because they don't matter (obviously emotions do), but because including them sometimes leaves us no better off than flipping a coin (are the downsides really that bad, or is your fear of change in this instance vastly overwhelming the other considerations, and in an unwarranted way that you aren't entirely aware of?).
- strictfp 9y agoWhile you have a point that they might sometimes be counter-productive, I think that emotions are decision drivers which operate on a higher abstraction level and are a way for the mind to compile vasts amounts of experience and deliberation into a single really fast circuit able to perform split-second decisions. So I think that they are mostly correct. But it's really too bad that we cannot retoractively introspect them and quantify their grounds.
- kbenson 9y agoI agree, but possibly in a different way. The idea of interoception[1] (which I'm not sure how accepted it is) basically means that your feeling are just your body using a heuristic to assign a feeling to a physical state of your body (that is, there is no universal feeling for anger, just a physiological response you've trained your brain to think of as the concept of anger. Some culture's literally do not have certain feelings). Your body is changing physical states based on some subconscious reasoning (often remembered response), and your brain is then interpreting that physiological state broadly and assigning an emotion to it, and it doesn't always get it right (which is why we get angry or anxious sometimes and aren't exactly sure why). If that theory is true (not sure, I literally just learned about it this morning[1]), your emotions do have weight in something like this, but it's filtered through multiple lossy abstractions and has a propensity for false positives. That's a much less rosy interpretation of how useful they are, and if true, means we might be far better off trying to cultivate a better understanding of the nuances that are causing those reactions and assessing them rationally (to the degree possible) than to using the lossy abstraction itself with any significant weight. 1: http://www.pc.rhul.ac.uk/sites/lab/index.php/research-themes-projects/interoception/ http://www.pc.rhul.ac.uk/sites/lab/index.php/research-themes... 2: http://www.npr.org/podcasts/510307/invisibilia http://www.npr.org/podcasts/510307/invisibilia
- thehardsphere 9y agoWhat you're describing is actually rational behavior. You're describing the difference between what you'll imagine beforehand makes more sense vs. what you know will actually work afterwards. The key difference is that you know more than you did in the latter case, so your descisions later have more information to guide them and thus are more likely to be correct. To think you understood everything before you started and insist on sticking to that after you find it's not working out isn't rational, it's stubborn.
- bumbledraven 9y agoIn C++, "return (x);" isn't equivalent to "return x;" [0]. But according to OP, it's not C++ that's irrational, it's the programmers who don't want to use C++. [0] https://twitter.com/sigfpe/status/857748171778252800 https://twitter.com/sigfpe/status/857748171778252800 [EDIT: corrected broken link]
- _pmf_ 9y agoThere's shooting yourself in the foot, and there's C++.
- stinos 9y agoOr one could say it's irrational to write return (x); :] More typing, less readable, more confusing.
- deleted 9y ago[deleted]
- simias 9y agoI'm not a big fan of the huge complexity of C++ (and much prefer C in general, although for some things C++ is more convenient) but I don't really think it's fair to dismiss a language based on a small snippet. You can basically mock any language that way: - In C "getchar" returns... an int. - Pointers and array are kinda the same thing, but not exactly. The rules for when an array decays into a pointer are sometimes unintuitive and surprising. - Same thing for the implicit integer types promotions. - `char *s = "foo"` is not at all the same thing as `char s[] = "foo"`. Arguably the former should be considered erroneous, but compiles just fine in C. G++ gives a warning for the same code however. - There's also the ridiculous "gets" function that's so poorly designed it could be part of PHP. This one finally got officially deprecated though. Of course many of these issues are also part of C++ since it's mostly a superset of C but in general it's stricter and more strongly typed.
- vostok 9y agoIntuitively, you can think of this as providing the name of a variable as compared to an lvalue that doesn't name a variable.
- 9y ago
- kensai 9y agoBut in the table I see, pair-compared, C is faster than C++. Am I interpreting this wrong?
- loeg 9y agoYeah — it's a little confusing, but the multiples are how much slower they are than the fastest. Bigger is worse.
- sqeaky 9y agoIt becomes less confusing when realizing each line is a multiple of the fastest run time. If the fastest one took 100s, then the one taking x1.57 took 157s.
- deleted 9y ago[deleted]
- yosefk 9y agoA good example of human behavior in TFA as well as the talk it cites is how deeply convinced they are that C++ is objectively always better than C; they don't even try to suggest that there could be a tradeoff and sometimes C would be better. Of course the guy in the talk makes a living from C++ consulting; another part of human behavior is it's hard to convince someone of a truth which threatens their paycheck. And I'm not here to argue how terrible C++ is (I've done enough of that elsewhere), but only that "behavioral" arguments cut both ways, and are usually little more than an ad hominem attack and/or some good old marketing tricks rebranded as "behavioral science."
- nothrabannosir 9y ago> And I'm not here to argue how terrible C++ is (I've done enough of that elsewhere) Haha that's one way to put it :p For those new to this debate: Yosef Kreinin is the author of the (in)famous C++ Frequently Questioned Answers.[0] it's quite a body of work. Speaking of which: thanks for writing it, Yosef. I greatly enjoyed reading it back in the day, and it had a big impact on young me. [0] http://yosefk.com/c++fqa/ http://yosefk.com/c++fqa/
- _yosefk 9y agoGlad you liked it! It is unfortunately quite out of date as it does not address C++11/14/17; so I put it on github in the hope that people would take over it, as I personally no longer care enough to invest the time it takes (at most I might publish a blog post on this, working title: Modern C++ Feels Just Like Python, My Ass.)
- thehardsphere 9y agoYeah, I see this trend in "behavioral science" arguments in other areas of debate. It's especially funny to watch people on both sides of whatever issue argue that the side they're opposed to is in a self-reinforcing bubble that only closes them to the beliefs of their team, which are obviously correct. But, the thought process that produces the belief that their team is correct is incubated in exactly the same sort of bubble that they're complaining about.
- 9y ago
- thehardsphere 9y agoIn a lengthy piece about rational arguments, you would expect somewhere in there someone would actually present a rational argument for switching beyond "it's modern." I mean, maybe the actual details of the case for switching are slightly beyond the scope the author intended to write about, but simply starting with an assertion that "modern = better, therefore people should have already switched if they were rational" and treating that as self-evident strikes me as highly arrogant and logically fallacious.
- bumbledraven 9y agoIt's kind of amazing to me that OP's 4000-word article doesn't mention -- even once -- the relative complexity of C vs C++.
- thehardsphere 9y agoYeah, you'd think that they would do it at least in a condescending way given their partisan position on the question. Unless... they didn't actually think that much about the topic. I dunno. I didn't watch the video so I don't know if it's in there.
- sqeaky 9y agoBe careful comparing complexity. C might look simple, and C++ might look complex but I have never seen a char* in C++ to mean 2d of jpg images in memory. C++ is more complex, because it covers more concepts. But when you get simple safe and to reusable things from that complex the difficulty is reduced. What is the right way to store and unknown amount of things in C? There are about a million ways to do and every project will implement their and about half will work. Of that half maybe 1 in 10 will have an API that is intuitive to the reader, and depending on the reader that 1 in 10 will be different. Now what if what you an associative container instead? With C++ just using std::vector, because this is a solved. (or map/unordered map for the associative container). This continues on with libraries. Every API needs to have a large series of questions answered every time you pass a pointer. Because C has no concept of ownership who is supposed to delete it? Without const references extra caution to distinguish const pointers and pointers to const things, why is this important? Without templates writing an API that works on multiple types involves dealing with void* at run time, presuming you don't want to actually use anything in the data. C looks simpler because it is smaller. C++ is easier and simpler because it has already dealt with many of the hard problems.
- fusiongyro 9y agoIf we were discussing two languages Strawberry and Kiwi, and I had a large, established codebase in Strawberry and a bunch of programmers who are experts in Strawberry, it would be a hard sell to get me to switch to Kiwi even if Kiwi were better than Strawberry in every conceivable way and backwards compatible with it to boot: - Learning to use a new system effectively takes time and energy. Are you 100% sure that the benefit of the new system is great enough to offset these costs? - Hybrid codebases have higher maintenance costs than homogeneous ones. If Kiwi mixes with Strawberry seamlessly, maybe that burden is lower—but the more true that is, the harder it is to believe that moving to Kiwi confers a large advantage. In this specific case, I could believe that C++ by seasoned C++ users leads to demonstrable net gains. But it's easier for me to believe that switching to Rust or Haskell would confer higher gains, corresponding to the higher risk and higher cost of switching. So I think it's not that people are irrational about avoiding C++. I think that C++ is in an awkward place on the hill between C and things better than C++. If you need something better, you will go to something with better tradeoffs than C++; if you don't need something better, you just live with your existing C codebase.
- dheera 9y agoOne of the major problems I have with C++ is that for any non-primitive data type, there are way too many choices of mutually incompatible classes that people have developed. Even strings. There are things out there that use char[], std::string, CString, APString (#*&!), ...
- swiley 9y agoAren't char[] strings and CStrings the same?
- self_awareness 9y agoI think dheera meant CString class from MFC, not a "plain C string". I'll also add QString, AnsiString, BSTR and glib::ustring to the mix :)
- fredastaire 9y agoIn the sense that OOP is often used in very stupid ways (dunno about C++ but in other languages, have a look at PHPUnit it is the best example of misunderstood OOP) I can understand C programmers. Golang is also very simple for a reason
- flavio81 9y agoI agree, but moreover: You can also do nice OOP with C. Take a look, for example, to COS (C Object System) which implements OOP on top of your C compiler. The object system itself is inspired by CLOS (Common Lisp Object System) and Objective-C (in turn inspired by Smalltalk). It also allows 'automatic' allocation by reference counting. https://github.com/CObjectSystem/COS https://github.com/CObjectSystem/COS Paper: https://arxiv.org/abs/1003.2547 https://arxiv.org/abs/1003.2547
- loeg 9y ago> The C++ language is an improved version of the older C language (it’s a superset of C), The first statement is arguable and the parenthetical statement is false. C99/C11 have language features that C++ hasn't adopted, which makes it somewhat obnoxious to support C++ from C codebases that use them. One example is the "static" keyword used in array parameters.
- enqk 9y agoor designated initializers.
- deorder 9y ago“If you’re arguing, you’re losing.”. That is a quick way to stop any discussion. The reason I am not using C++ is because C already does everything I need: - Easier to write code generators for: I use libclang to read in annotations that will generate new code according to where the annotations are being used. If I have to take care of every edge case and new features added to the latest C++ standard it would make the code generator more complex. - Using plain old data structures: My code generator generates new code to be able to work with the plain old data structures which data can be interleaved or non-interleaved using data-oriented design. Classes will not add that much value. - C compilers are easier to write: I integrated the tiny C compiler inside my program to be able to compile C code on demand. The C code can then use the code I've already written. - No name mangling by default: I dynamically load a lot of plugins and do not want to bother with binary incompatibilities all the time (if compiled by different compilers like the tiny C compiler for ex.). - I mostly use libraries written in C - Low-level access If I need concepts or meta-programming etc. I can already use Nim or write my own code generator, else I would rather choose something different than C++. To be more on-topic. Confirmation bias. On The Internet you can find confirmation of something being true about almost every topic. Whatever people believe is the truth, it will not change the reality. Which programming languages are better is a very difficult thing to measure because there are many factors to consider. Being used to a certain programming language can be a good reason not to change. https://en.wikipedia.org/wiki/Confirmation_bias https://en.wikipedia.org/wiki/Confirmation_bias Update: added some explanations, and more on-topic
- self_awareness 9y agoYou're using C in a cool way, but: 1) By using libclang to parse your own annotations you're kind of using your own fork of C language, not the standard one. You can't really bring your annotation parsing engine to some company to work on an existing C project, 2) C++ also uses plain old data structures, using 'class' does not magically introduce any overhead in structures, unless you start using virtual functions, but nothing forces you to do it, 3) I think that by stripping name mangling you actually increase binary incompatibility, because without mangling you can't know what ABI was the function compiled against. Which compiler was it? What are the arguments? Is it MS ABI or UNIX ABI? Nobody knows for sure even if it seems to work correctly for some set of arguments. Disabling mangling sure is convinient at the beginning, but brings problems and incompatibilities at later stage. 4) Given that Windows or macOS kernel drivers are written in C++ (more or less), low level access is possible in C++ as well.
- yehohanan7 9y agoThis reminds me of Godel's proof - A formal system (axiomatic system) cannot be complete and consistent at the same time! Each side of the argument have their own set of premises/axioms to come to certain conclusions but there are always unknown truths which people tend to ignore. if there are no unknown truths then the argument should be contradictory
- sporkenfang 9y agoC++ offers too many options for how to do things. C is a nicely restrained subset. The end.
- tankenmate 9y agoIn the words of Dennis Ritchie, "If you want PL/I, you know where to find it."
- coldtea 9y ago>* Based on research by Kahan et. al., Saks mentions that otherwise intelligent people will likely misunderstand data if understanding it challenges their preexisting beliefs.* While this happens, it's also an empty argument that can be applied to everything. How about the author there misunderstands his own data on C++ because it challenges his preexisting beliefs (that C++ is "de facto" better)? It goes downhill from there fast, to argue that those pesky people who dare to not want to use C++ are irattional, conditioned from childhood, etc (those willing to use C++ are not, because of course C++ is the only reasonable choice a programmer can ever make between C and C++). >In fact, Saks found that quite often logic, facts and the truth were simply not sufficient enough to convince people. Instead, people reacted in a very irrational and emotional way, and kept sticking to and defending their beliefs. People’s basic reaction was “show me all the data you want, C++ is still undesirable.” The problem in the paper is that some BS arguments and numerical data in favor of C++ (which I'm assuming they have -- they fail to mention any of them in this article) are conflated for "THE truth". Sorry, author, but you are not showing people "THE reality", you're showing them some arguments and some numbers. The programmers you are talking to (those that have tried both C and C++) are the ones that have actual empirical experience from actual reality on what C++ gets them -- and whether its worth the tradeoffs they've seen. For one, there's an ergonomic factor in language and API design (it's usability) which can be highly subjective -- and syntax/api usability is one of the big reasons people dislike C++. This issue cannot be shot down with any "objective" argument or numbers table....
- deleted 9y ago[deleted]
- lloydjatkinson 9y agoI like to think of C# as what C++ should have been.
- monocasa 9y agoNo, a garbage collector is a non-starter for a lot of what C and C++ get used for. C# is more what Java should have been (which lines up pretty well with the history of C#).
- iRobbery 9y agoAt a cultural level, when you have to convince somebody of something, isnt that generally a bad approach if you want somebody to change their view? Though, Keeping thIngs Simply Stupid, is really the only lesson one has to know/learn. When C++ has a specific function go with C++, when C is sufficient use C. If a bash script is sufficient use that. If people could just show why something is cool in what situation, instead of why something should be used over something else. And this includes guides 'how to switch desktop OS' too.
- raverbashing 9y agoHow to convince them: - Show them how classes makes things easier (automatic object management, some operator overloading, etc) - Show how the STL makes most things easier (arrays, maps, etc) How not to convince them: - Show uses of excessive/pathological inheritance - Use of templating beyond the basics - Insist they use C++ functions for every single thing - Insist they OOify every interface in their code - Creating giant classes (structs) with a getter and setter for every field with no control or validation - Going crazy with operator overloading
- jernfrost 9y agoWhy would that convince them of C++ and not any other modern language like D, Rust, Swift, Go or Nim? I really can't see what C++ has to offer anybody. It is a horribly complex language, which doesn't interface with anything except C.
- raverbashing 9y agoI wouldn't, but C++ is an improvement over C in most situations and will fit situations where modern languages won't run
- deleted 9y ago[deleted]
- nocman 9y ago"- Show how the STL makes most things easier (arrays, maps, etc)" The problem with the STL is that you are always running into roadblocks when you try to compose things. I tried for a very long time to like the STL, and in the end it was very very good for one thing -- pushing me to look for something better. I suspect things have improved some with the newer C++ standards (it's probably been almost 10 years since I gave up doing much of what I wanted to do in C++), but I much prefer Lisp, Scheme, and other languages now (most, if not all of them dynamically typed). Learning Lisp-family languages did indeed change how I program in other languages -- IMHO greatly improving the way I write code. I might revisit C++ at some point, just to see what's happening there. I've only skimmed a few articles about the newer standards, and some things look promising. But it would probably take my involvement in a real-world project that uses C++ to get me to go there. I've just spent way too many frustrating hours trying to get things to work the way I wanted in C++.
- coding123 9y agoPerhaps we need an article called "Convincing people to stop using C++ already."
- cardiac 9y agoI found some alternative facts!!!! http://benchmarksgame.alioth.debian.org/u64q/c.html http://benchmarksgame.alioth.debian.org/u64q/c.html
- microcolonel 9y ago> In fact, Saks found that quite often logic, facts and the truth were simply not sufficient enough to convince people. Instead, people reacted in a very irrational and emotional way, and kept sticking to and defending their beliefs. You start criticizing people for not believing you when you have one example comparing two different programs implementing an unspecified task on an unspecified compiler. This is ridiculous. I mean, for crying out loud, your headlining video is a talk by a person who admits that he hasn't done the thing he's trying to convince people to do. He says things like this: "You don't want to wait for the market to take care of this, you would like to take some proactive steps to be able to make more of the people who should be using C++ willing to use it." in the context of aerospace, which clearly he has no authority to speak on, since he misses one of the fundamental reasons why C++ is not popular or even acceptable in much of aerospace: implicit allocation. Implicit allocation is incredibly dangerous for high assurance systems. You really need to know exactly how much memory can be allocated, when, and what state the exact allocations will put the allocator in. C++ has some facilities to manage this, but man, it is easy to drop a plane from the sky by assuming that your allocation did what you wanted instead of verifying it.
- bumbledraven 9y agoScott Meyers points out that one of the simplest possible refactorings is "rename method". To rename f(), you need to know what f() is, and in C++, f() can be any of 7+ different things! [0] It's extremely complicated to determine which thing it is. But according to TFA, people who prefer C are just being emotional and irrational. [0] Scott Meyers. Things that Matter - DConf2017 [@27:51] (https://youtu.be/RT46MpK39rQ?t=27m51s https://youtu.be/RT46MpK39rQ?t=27m51s)
- sqeaky 9y agoIn some obscure technical sense you might be correct, that identifying some piece of code is hard, but that little of C++ obscurantism is rarely why code isn't easy to read. With C++ it easier to express higher level concepts. I can have a map of strings to some class instance. Then I can use some string to lookup class instances. There are simple idiomatic ways to do this. They are short to writes (<10 lines), they will have decent performance and will be low on bugs and clear ownership semantics. With C it is common to have an array of pointer to pointer to void pointers. To get associative lookup it might be even worse and have functions that need to pointer to pointers, with who knows what ownership model and what idioms in use.
- empath75 9y agoI've noticed that the best way to get programmers to use a different language is to build something they want to use in that language. I could talk to my perl programming colleagues for days about the advantages of python over perl, but what got them to switch was boto, since we were moving to aws.
- jjgreen 9y agoC++ impregnates the tissues, and then it hardens and settles like silt. It makes your aorta stiffer than a hockey stick. Whereas C caresses your insides, leaving nothing behind but its scent
- sovande 9y agoI do not fully agree with the premise that C programmers don't know what's best for them and need to be educated to switch to C++. I do agree that C++(14++) isolated is a better programming language in many ways compared to C. The problem is that a programming language seldom is used isolated, but is part of a toolchain or is used in an environment with other technologies. In this situation, C is a much better choice because most other languages have nice interoperability with C, but seldom, if ever, with C++. For example, as an iOS developer I can use C and C-libraries very easy with Swift, while inter opt with C++ is not possible at all and probably never will. The main thing keeping me away from C++ is that it does not have a stable common ABI. This makes it very nearly impossible to use C++ to create and distribute a shared library. I even believe Google developers internally are prohibited from creating C++ libraries for this reason. So I'm sticking with C for low level stuff. It's a perfect glue language and fast. For higher level stuff, why use C++, when you can use Swift, Java, Haskell etc etc?
- ryandrake 9y agoWhy do programmers feel the need to convince other programmers to switch to a different language? How does it affect Programmer A, a C++ programmer, whether or not programmer B prefers to use C? I like both C and C++. I also like Objective-C, Ruby, and Python. Each one has its place--and if I'm starting a new project, I'll use the one that makes the most sense to use given the project's requirements--or a mix of them if it's appropriate. If I'm joining a project in-progress, I'm happy to use whatever language has already been chosen. Why get into religious wars?
- deathanatos 9y ago> Why do programmers feel the need to convince other programmers to switch to a different language? Because they themselves derived some benefit from it, and believe the other party would too, if only they would try it. Sometimes, I don't think it's just benefits, but certain languages offer different ways of doing things that other languages really could benefit from. Our older languages teach us things as we use them, like that nullable pointers as our only reference type were a bad idea. Encouraging others to use languages that adopt different ideals would seem to be to just be people trying to get people to see the merits of those ideals. > Why get into religious wars? Because we're still using languages with nullable pointers. More seriously, because people care about the quality of their work, and you don't always get to pick the tool for the job. And it can very well be that there isn't a good tool for the job, but only and okay tool for the job: while I use Python extensively at my job, and while its speed of development definitely benefits my team, I would kill for some static typing. (I've been looking into mypy for this reason, but being on Python 3 would help…) And people don't always use the right tool for the job, or I'd be done trying to explain why they should not be using raw bytestrings for text. They didn't pick the wrong tool for the job — they simply don't understand that actual string types exist, or why they should use them. (It doesn't help when the language/library's obvious choice is the wrong choice.)
- taloft 9y agoAccording to Alan Kay, programming is a pop culture right now. So people want to preserve the investment in the language of their choice by maintaining or improving its pop status.
- self_awareness 9y agoWell, I've tried plain C in one project. The compiler didn't complain when I did some invalid casts, didn't complain when I forgot to return values from functions, provided some warnings against using some undefined functions, but compiled the units anyway (failing on linking stage), I had to write my own implementation of vector (probably buggy and slow), and probably I've forgot to free memory in some situations because C doesn't support smart pointers and automatic cleanup through RAII. Lots of times I felt I'm programming in some dynamic language that doesn't support types, because types are so weak in C. This means that lots of bugs were caught in runtime, not compilation step. Trying to use a hashmap meant I had to pull additional dependencies. Disclaimer: I don't love C++, I think it has lots of problems, but saying C++ is wrong, while C is right suggests to me that lots of people didn't take time to actually learn C++ but have strong opinions on it.
- dllthomas 9y ago> because types are so weak in C You can get nominal typing in C by wrapping your primitives in single-element structs. Slight syntactic overhead, no runtime overhead. In my C code, I try to avoid passing primitives between functions. It worked out well on my last large C project.
- jpfr 9y agoThe talk starts off with “If you’re arguing, you’re losing.” — Mike Thomas No, no, no. A shouting match doesn't help anybody. A civilized exchange of arguments does. And the establishment of evaluation criteria is a very good basis for listening to the other. The not-arguing approach often times results in "let me show the merits of my technology without listening to your requirements / evaluation criteria". C is different from C++ because it targets different use cases. So it needs to be evaluation in the context of use cases. End of story.
- jernfrost 9y agoTalk about the cat calling the kettle black. C++ arrogance and hypocrisy at its finest: Wondering why C programmers can't be reasoned while being impervious to any reasonable argument themselves towards the many modern alternatives to C++. Why on earth should a C developer chose C++, when they could chose Go, Rust, Swift and Nim instead? And if you really insist on an old language I'd rather use Objective-C than C++. Only reason to ever pick C++ is that you got a sizable existing legacy C++ codebase. That is why I am stuck on C++. A C developer by definition doesn't have legacy C++ code to deal with so there is no reason to pick C++. Saying C has no benefits over C++ is rather ignorant. Complexity has a real cost. For most of my C++ career that has been reflected in an utter lack of functional tools for manipulating C++ code, e.g. doing refactoring. Refactoring C code is a lot easier, as a regexp search and replace is far more dependable, since there is no function overloading.
- jstewartmobile 9y agoC and C++ have a lot of wiggle room when it comes to implementations. I prefer C (when possible) just because there's less surface-area for arbitrary behavior (which is already more than enough arbitraryness). I'm writing this mostly as a plug for DJB's proposal for a "boring" C compiler: https://groups.google.com/forum/m/#!msg/boring-crypto/48qa1kWignU/o8GGp2K1DAAJ https://groups.google.com/forum/m/#!msg/boring-crypto/48qa1k...
- jpfr 9y agoThe kcc compiler is really good at being predicatable. A formal semantics of the language gives warnings whenever undefined behavior occurs. https://github.com/kframework/c-semantics https://github.com/kframework/c-semantics