3 ms·
Interesting justification of their choice of Objective-C++ here: http://componentkit.org/docs/why-cpp.html http://componentkit.org/docs/why-cpp.html Anyone el
by Osmium 12y ago
Interesting justification of their choice of Objective-C++ here:
http://componentkit.org/docs/why-cpp.html http://componentkit.org/docs/why-cpp.html
Anyone else have an opinion on this? Seems unusual for a iOS framework, especially going forward, but the reasons sound sensible enough.
- bdarnell 12y agoI'm a fan of objective-c++ because it gives you some nice tools to cut down on verbosity (e.g. https://github.com/viewfinderco/viewfinder/blob/master/clients/ios/Source/UIView%2Bconstraints.h https://github.com/viewfinderco/viewfinder/blob/master/clien...) and c++ is the best language for a core library shared between iOS and Android. However, it does have drawbacks, especially the limited swift interoperability. Build times are also a headache, since many of the features apple has been adding to improve build performance do not work in obj-c++ mode.
- dirtyaura 12y agoProperly designed C++ library using templates and macros can lead to surprisingly terse application code - not your standard STL/Boost template syntax mess. I've seen it in one of our gaming frameworks, and in e.g. Google's C++ unit testing framework. However developing the library code itself requires some serious C++ template fu and the abstraction leaks to the library user in the form of complex error messages. Strategically used, like in this case, it certainly leads more succint and readable code than pure Objective-C alone.
- tambourine_man 12y agoThey're changing to Swift in the next version. (He mentions it at the end of the video)
- MrGando 12y agoThat makes sense, I don't understand how those two constructors are equivalent, it seems that he's missing a couple of parameters in the C++ version.