Saturday, May 9, 2015

Future Predictions FAIL

Note: sorry for my extra bad grammar in this post, I’m not sure which tenses I should use when talking about past writings that describe future that is now the past but wasn't then as it was in the future… well you get it...
Every once in a while I come across an article about how the future might look like. Usually these kind of writings turns out to be a total fail when the future date comes. I adopted a habit of collecting these articles in a special folder. Each article is saved with the name of read_me_in_year_YYYY.pdf where YYYY is the year which the current paper is trying to foresee. I’m not allowing myself to read any of these until the year YYYY arrives.
Recently I had the pleasure of opening the first one that I saved in 2008 that tried to predict computers technology for 2015. I found an online copy of that article here:
The article is trying its best in 15 technologies, and I think it’s quite safe to say it failed in about 12 of them, but I’ll say it failed all the 15.
  1. The memristor. The idea of memory of the size of persistent memory that we currently have but that works in the speed of RAM that we currently have, is not new, and if it does turn true in the future it will have to change the entire way operating systems are written. This idea is a lot of fun to play with, and one can actually try it himself with a special hardware such as this But as awesome as it is, we are still going to have to wait for this to become real, if it ever will.
  2. 32-Core CPU. Especially not for home users. FAIL. They failed to see the Intel Itanium fail on the desktop. It seems like we are stuck at the 8 cores border for quite a while.
  3. End of Stand-Alone Graphics Boards. FAIL. Just a week ago I bought a new graphics adapter for my PC to support my awesome three monitor setup.
  4. USB 3.0, well, ok. But they made much a bigger deal of it, than what it really is. They also predicted it would have a different connector.
  5. Wireless Power Transmission. FAIL. They win the FAIL flag here just because we don’t have light bulbs that work on wireless power.
  6. Windows 64bit, yes it’s here. And again, they get a FAIL because quoting “Microsoft will have to jettison 32-bit altogether”. Nevermind what the word “jettison” means, Windows 10 is coming out soon and guess what, it’s going to have a 32bit version. They also tried to predict that in 2025 we will have 128bit OS, which I think frankly is just silly.
  7. Windows 7. Not much of a prediction there. They were aiming at 2010 two year prediction is not that exciting because things are already being set and built.
  8. Google desktop. Not much of a prediction here either.
  9. Gesture-Based remote control. I think it’s now safe to call this dream a fail. And the same goes for voice recognition TV, do you know anyone who speaks to his TV and it actually answers?
  10. Tru2Way TV. FAIL, quoting from Wikipedia: “As of July 2010, Panasonic, the sole device manufacturer, producing Tru2way compatible televisions, has stated that they will no longer sell Tru2way compatible televisions. Thus, at this point there are no television sets with built-in Tru2Way compatibility being sold.”
  11. No DRM from the big companies… Lol, FAIL
  12. Use any phone on any wireless network. FAIL. Something much better might happen with 4G.
  13. Your fingers do even more walking. Or how multi touch screen seemed such a neat technology just 7 years ago. I must give them a PASS on this one. Multi-touch screens are everywhere now, and we kinda’ take them for granted. I think they failed from the other side on this one. They predicted that about 800 million touch-screens would have been sold in 2013, but just with smartphones it came closer to a billion.
  14. Cell phones are the new paper. Not more than what it was like in 2008. FAIL
  15. Where you at. I’m not sure what they are trying to describe here. The idea is so vague. It sounds a little like 4square, but it’s not. Anyhow, FAIL.
Recently Gizmodo made a post about how and why we so often fail in predicting future technology. I find their post very relevant to this one, so here is a link:


Saturday, January 31, 2015

IMHO: Why C++ is broken

Recently I had the privilege to be part of a team of very strong programmers. Everyone in this small team has many years of experience in writing code for systems that are critical in performance, stability, maintenance.
A part of the product that I was in charge of, had to store information in a database. To store the information in the DB I had to serialize it, and for that I used Tomer Filiba serializing template for C++ called construct++. From the construct++ I see a small crack in the language, the implementation of the serializing is brilliant, but the code itself is ugly in a way that only C++ (and maybe Perl) can make you write. Code that is so ugly that only Bjarne Stroustrup can love. This is not Tomer's fault, it's 100% C++ to blame. But if one don’t find this kind of syntax to be discouraging from using the language, take a look at the lambda functions of C++11. For example:
auto func = [] () { cout << “Hello world”; };
You put it into a template and you got yourself every type of brackets in one line of code… Ugh...
But ugly syntax is nothing to be afraid off. A simple example of where the language is really broken could be derived from using both Templates and Forward declarations in the same code.

  1. Using templates. Note that Template definition must be done completely from the header file.
  2. Forward declaration. Two classes are using each others methods, for example DB of cars and owners data, if a car class needs to ask a person class about weight, and person needs to ask about the size of the car. In that case, the implementation has to be done in the CPP file, while the each header will have a forward declaration of the other class.

If the two classes are both templates and referring each other, they can’t be in the header file nor can they be in the CPP file . One might say this is a bad design, but in my opinion it’s possible to find a good case where this kind of design is required.
Anyhow, the entire C++ implementation of templates has a wrong attitude for the problem. Templates came to introduce simple compile time code generator to the language. Templates is a poor implementation of a code generator for C++, that is just a bit aware of the code. This is a perfect example of how code generator should never be implemented. Not only is this code generator unreadable, it also imposes new restrictions on your code, which makes none code generated code to be less effective.
Of Course I’m not the first person to complain about C++. Most notable is Linus here: which I can’t agree more with.
As for the bad syntax: