Am 21.06.2013 18:19, schrieb Olaf Radicke: > Hi Tommi! > > I'm glad to hear that Tntnet/cxxtools now has some string operator function. > But > I see two things, that we can do better. > > If you look in the official API Doku (http://www.tntnet.org/classes.html) > than you can't find any of cxxtools::split(), cxxtools::join() and > cxxtools::convert<>(). Could we make it easier to find? The next step for the new homepage is to integrate API documentation. And after that we have to go through the classes and see, where proper documentation is missing. > >> Tommi Mäkitalo <[email protected]> hat am 21. Juni 2013 um 14:51 geschrieben: >> And std::string is not so poor as you and others think. It just has a >> different philosophy. Algorithms do not need to be members of the string >> class. It is much simpler to add algorithms when they are not members. >> And there is no good reason to implement split or join as members into a >> string class. Use that: > But you have given an example for contrary: > Really? >> For lowercase the string there are solutions in the standard library: >> >> |std::string data= "Abc"; >> std::transform(data.begin(), data.end(), data.begin(), ::tolower);| >> >> Often they do not look just like you expect but if you understand the >> flexibility, you can see, why they are free functions. > I'm not sure, but I thin "transform" is static and a member function. Transform is a free function. It is not a member of anything. > > Okay, let's have a look at other frameworks. Qt is a good example. Specialy > the QString class: qt-project.org/doc/qt-5.0/qtcore/qstring.html > > The class is clear an intuitively to use. That's what programmers love. And of > course, the doku is fine too! String handling with standard C++ is just a little different. It is not as people expect but different. Maybe something like a cookbook how to handle strings in C++ correctly may help. String handling is really not that bad and everything can be done. The only problem is, that the algorithms are not member functions of std::string and hence can't be found there.
Qt created a string class because standard C++ did not have any those days. std::string is newer than QString. > > Typically web programming has many string operations so the string handling > is very impotent, I think. I don't see may string operations in web programming. Can you give me some examples, where you really need string operations in web programming? >> You see - we have chosen a great programming language ;-) > Absolutely that's not the point! > > Best regards, > > Olaf ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Tntnet-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tntnet-general
