Live data from Hacker News

Talking to C Programmers about C++ [video]

youtube.com

31–40 of 128 posts

Re: Talking to C Programmers about C++ [video]

#31
post #20
post #14

Earlier quoted context omitted.

We did the same in 2006, and are mainly a Java/.NET consulting shop nowadays, but I still use C++ on side projects. Given language difficulty, while I hope never to maintain C++ code that makes use of SFINAE, Java's simplicity is misleading. The language might appear simple, but mastering the whole Java eco-system (JSE, JEE, Spring, embedded, Android, features per JDK version), performance monitoring tools, commercia…

There is nothing "simple" about Java once you get past the basics. When you get into the EE world it gets extremely complicated.

No.

There's everything simple about Java. The semantics of Java are actually pretty simple, at least compared to C++. What's complicated are the monstrosities people build with Java, but those aren't inherent in the language.

Saying that Java is complicated because EE exists is like saying that C is complicated because Linux exists: Complexity can be built atop simplicity. And for some reason, Java is a complexity magnet.

Re: Talking to C Programmers about C++ [video]

#32
post #5

Scott Adams (Dilbert) has been writing extensively on persuasion for the last year or so, covering many of the same points Dan does. He has put together a reading list: http://blog.dilbert.com/post/129784168866/the-persuasion-rea...

In his podcast episode with Tim Ferris he cites again Influence - by Robert B. Cialdini PhD

Re: Talking to C Programmers about C++ [video]

#33
The backfire effect has had a lot of airplay. I've just now made a quick scan of the study, but not read in detail (https://www.dartmouth.edu/~nyhan/nyhan-reifler.pdf). I don't think the paper justifies its conclusion that "corrections [..] increase misperceptions among the group in question".

From the paper, "In other words, the correction backfired – conservatives who received a correction telling them that Iraq did not have WMD were more likely to believe that Iraq had WMD than those in the control condition." (https://www.dartmouth.edu/~nyhan/nyhan-reifler.pdf)

I don't think that connection flows. Rather, I see this: when you take people who have developed political opinions, and act in a way that suggests insult to their world-view, some will react with defiance/sabotage.

The study identifies the pre-existing political leanings of the subjects. Hence, background work has been done to understand a subject's political persuasion, and the subject knows they have been profiled for this.

Then they isolate an issue which some subjects will know to be contentious across liberal/conservative lines, and present the subject with a position. This act (focusing on a vulnerable issue and then preventing evidence that indicates a clear conclusion) alienates the project from the subject, and sets them up to be from a rival worldview. Some subjects, particularly the more politically-aware subjects, will be speculating on the purpose of the study. Then the study asks the subject to - essentially - calculate one plus one one on the issue, towards a conclusion that supports the rival worldview.

The people running these studies will be identified by the participants as members of the intelligentsia. That will have a bearing on subject behavior, and will further encourage defiance in some subjects. In my scan, I didn't see signs of effort made to disguise or water down the focus of the study.

Re: Talking to C Programmers about C++ [video]

#34

Only a handful of modern C++ features appeal to me. In order to use them, i actually have to use other features(less desirable, like templates or class inheritance) which create bloat, latency and corner cases requiring knowledge of the inner structure of the things(like variadic functions actually being variadic template syntax sugar). Ease of use which C++ brings is 'balanced' by opaque and hard debugging, large ex…

I feel like this is by design. `std::vector` is an amazingly useful thing, for example. But in order for it to exist, you need to have templates. `std::unique_ptr` handles memory management automatically in 95% of cases, but in order to do so, the language requires lvalue and rvalue references, to properly steal resources. Heck, destructors and RAII beat the snot out of Python/C# "using" statements or Java "try/except/finally", but it requires correct lifetime management of objects.

The complicated features are all there to support simple library use. On a day-to-day basis, the complicated features are hidden behind a library, and are rarely seen. When you need them to write the library, they are available.

Re: Talking to C Programmers about C++ [video]

#35
The problem with C++ is the constant introduction of unneeded features that are infinity obscure in necessity.

People will say "Oh just don't use that feature" but that's not how this works. If something is there it is used. In reference to C, I don't think I know of a single feature or release that had major changes in how I wrote C. Maybe C99 and allowing me to declare in a for loop.

I've been using C++ for class this semester and the only thing I like is reference types. Makes pointers much more concise. Other then that it can all go in the bin. In order to keep my C++ project clean I've needed to avoid a huge set of features and keep it in a data-oriented design.

Re: Talking to C Programmers about C++ [video]

#36
post #20

Earlier quoted context omitted.

There is nothing "simple" about Java once you get past the basics. When you get into the EE world it gets extremely complicated.

No. There's everything simple about Java. The semantics of Java are actually pretty simple, at least compared to C++. What's complicated are the monstrosities people build with Java, but those aren't inherent in the language. Saying that Java is complicated because EE exists is like saying that C is complicated because Linux exists: Complexity can be built atop simplicity. And for some reason, Java is a complexity ma…

I would say that the complexity of a language and the complexity of programs within that language are inversely correlated. Java is a very simple language, but as a result, the programs written in it must be more complicated to make up for the shortcomings of the language.

As an example, Java's lifetime rules are much simpler than those of C++. At some point after all references are gone, the object will be garbage collected. Simple. But as a result of this simplicity, you don't know when the finalizer will be called. You can't use it, for example, to flush and close a file, because you don't know when file will be closed. Instead, you need to use try/except/finally, and so you can't add this to an existing class, because it would require code modification from all the users of the class.

Up until Java 8 and lambda functions, functions could not be passed as arguments to other functions. Therefore, the developer needed to make an entirely new classes derived from "Callable". Complexity that came from the simplicity of the language.

C++ has a lot of complexity in the language itself. I won't deny that. What I will argue is that the complexity of the language enables simplicity in programs.

Edit: Lambda statements came in Java 8, not Java 7.

Re: Talking to C Programmers about C++ [video]

#37

The problem with C++ is the constant introduction of unneeded features that are infinity obscure in necessity. People will say "Oh just don't use that feature" but that's not how this works. If something is there it is used. In reference to C, I don't think I know of a single feature or release that had major changes in how I wrote C. Maybe C99 and allowing me to declare in a for loop. I've been using C++ for class t…

When I think about features in C++ that I would love to have in C, the only thing that comes to mind is constructors and deconstructions for RAII.

Re: Talking to C Programmers about C++ [video]

#38

The problem with C++ is the constant introduction of unneeded features that are infinity obscure in necessity. People will say "Oh just don't use that feature" but that's not how this works. If something is there it is used. In reference to C, I don't think I know of a single feature or release that had major changes in how I wrote C. Maybe C99 and allowing me to declare in a for loop. I've been using C++ for class t…

The problem with posts about C++ on Hacker News is that people who aren't experienced C++ programmers (you've been using C++ for a semester? do tell) feel compelled to write posts explaining the problems with C++.

Re: Talking to C Programmers about C++ [video]

#39
post #22
post #19

Earlier quoted context omitted.

What are the components of C++ that add up to 100%? I can count: * language basics (variables, structural statements, functions, error handling, preprocessor, how compilation works) * OOP * functional programming (which is not that complicated at all in C++) * generic programming * advanced generic programming and metaprogramming * the C standard library * the C++ standard library basics (containers, algorithms, smar…

You just proved my point ;)

Doubtful. What would 25% of the above list be, basics + OOP? No standard library at all? No templated code?

I am saying one can barely write programs by knowing just 25% of C++, let alone for almost two decades.

On the contrary, I think 80%+ of the language is accessible to every programmer.

Re: Talking to C Programmers about C++ [video]

#40
post #25

In my opinion, many C++ projects would be simpler, cheaper, safer, and better maintained, if were written in C (with adequate libraries, e.g. for strings, vectors, maps, threads, timers, sockets, etc.).

A vector/map of what? How do I have a map of some key to a custom structure? How do you do this simply without templates? Separate libraries? Macro hell?

How do you handle types which need to free memory without destructors? Manually loop over the vector and free stuff every time one goes out of scope? That doesn't seem safer to me.

Post reply on HN