[Interest] Qt API annoyances: where to log/discuss?

Jason H jhihn at gmx.com
Fri Nov 2 19:28:35 CET 2018



> > The bitwise OR operator, descending multiple namespaces.
> > It makes my point. That these very common functional programming paradigms (map, reduce, etc)  are (needlessly?) obtuse in C++.
> 
> Sorry, what is the point? Is it hard to read, write, teach, learn, 
> understand, extend...? What is the baseline we're comparing it against?

D) All the above. I didn't understand it when I first read it and I would say I "know" C++ beyond the 50th percentile of people claiming to "know" C++. I'm sure others won't either. Can we get a vote on who understood exactly what that statement was the first time they read it? The baseline I'm comparing it against is Python or JavaScript. 

> > Further more, my point is made again with this talk about C++2a. It's something that can be done now, but i shouldn't have to wait, Qt can implement these however it can today and move to ranges when available.
> 
> A bit too convenient to just ask someone else to do a _lot_ of work for 
> you... anyhow, you don't have to wait:
> 
> > https://github.com/ericniebler/range-v3
> 
> And again, why should Qt invest precious development bandwidth 
> reinventing half-cooked solutions for problems solved in an excellent 
> way elsewhere? As I said in the other thread, not using C++-latest costs 
> _you_ more. It shouldn't cost anything for Qt.

The value proposition of Qt is that it simplifies a lot of things. If we're going to fall back on "std all the things" then Qt (pronounced "Cute", which I think has meaning here) loses a lot of value prop and I should just switch to C++-without-Qt or Python. It is my observation that C++ is becoming a language to not write programs in, but to instruct compilers on how to build your program. (Maybe this is role QML is filling?) If I have to dedicate hours per week to maintaining my C++latest skills (which is futile absent a useful case in my own code base) then that negatively impacts my perception of Qt. Which is frankly irrelevant anyway because my code needs to be readable **by other people**. I don't know why C++ enthusiasts are so hostile to newcomers, effectively raising the barrier to entry. This plays out in non-abstract terms. C++ is the fastest declining language at TIOBE ( https://www.tiobe.com/tiobe-index/ ) over the past 10 years. There were no positive spikes around each C++0x release. This stuff is being added and it's not attracting users. Meanwhile Python is fastest increasing (at this time, it's Java, C, C++, Python, VB.NET) (I do think JavaScript is under-reported, as the web is not getting off JS anytime soon)


Let's look at Python's map/filter/reduce ( http://book.pythontips.com/en/latest/map_filter.html )

items = [1, 2, 3, 4, 5]
squared =map(lambda x: x**2, items)
less_than_zero = filter(lambda x: x < 0, items)
product = reduce((lambda x, y: x * y), items)

They are clear and readable.  What are the C++0x equivalents? (I'm really asking)

Excellent doesn't mean anything if it isn't accessible.  Qt should invest for the benefit of its users because the C++ std methods are obtuse. If you have Qt class, you already know and have a lot lot of control about how the container works.





More information about the Interest mailing list