From the linked blog, an example of how to copy a 4-letter string from a constant string into a new heap-allocated string:
HBufC* heapbasedFred=HBufC::NewL(4);
TPtr fredPtr(heapbasedFred->Des());
_LIT(KFred, “fred”);
fredPtr.Copy(KFred);
I had forgot it was this bad.It's kind of weird that Symbian calls these descriptors, but the actual types and macros don't use that word at all — they are HBufC, TPtr and _LIT.
It was a combination of bad APIs, bad and Windows-only IDE, problems in OpenC, and pressure from client.
For the lack of a better word, development in Symbian was "tacky", was like walking on mud, everything took 10x the effort it should.
It was a time when Nokia was the only game in town (think N93, N95) and they thought they could get away with mistreating developers forever.
Funny how they sabotaged their own efforts to make development easier e.g. Python for Series 60, let alone Maemo.
Re:Symbian Won
by cairoshikobon on Thursday June 25, 2020 @03:06PM
(#23644273)
iPhone is Mac-only for development. Some things never change..
Re:Symbian Won
by secondcoming on Thursday June 25, 2020 @09:56AM
(#23640789)
Ha, I still might have the introduction to symbian c++ book somewhere. Descriptors blew everyone's minds initially but they eventually clicked. Active Objects and the manual CleanupStack were other headaches.
“Most programmers come to Symbian OS from some other development environment, and tend to think they’ve already got strings pretty much sussed. After all, there’s not much to C strings to understand, although there are plenty of ways they can go wrong. The Java String and StringBuf classes have about the best combination of power and simplicity that you can get. And the various String and CString classes found in different flavours of C++ environments are usually mastered fairly quickly.
But then they encounter Symbian OS descriptors. If there was anything invented to bring a high flying C++ developer firmly back to ground during their first week of Symbian OS development, it’s descriptors.”