Evernote has released version 4.0 of its excellent note-taking product. Software developers have taken particular interest in the blog post announcing its release, because of what it says about .NET, in this case the Windows Presentation Foundation, versus native code:
Evernote 4 is a major departure from Evernote 3.5 in every way. While 3.5 added tons of great new features, there were some problems we simply couldn’t fix: the blurry fonts, slow startup times, large memory footprint, and poor support for certain graphics cards were all issues that the technology behind 3.5 (Windows .net and WPF) was incapable of resolving. As a result, we ended up chasing down platform bugs rather than adding the great features our users wanted.
So we decided to start over from scratch, with fast, native C++ that we knew we could rely on. As you’ll see, the results are amazing. This new version will set a foundation for rapid improvement.
Evernote 4 is designed to give you a great experience on any computer that you use, whether you’re on a netbook, a five year old Windows XP machine or a super fast top-of-the-line Windows 7 computer.
On our test hardware, Evernote 4 starts five times faster, and uses half the memory of Evernote 3.5.
A bit of background. WPF was introduced in Windows Vista and was originally intended to be the main GUI API for Windows, until the notorious reset midway through the Vista development cycle which marked a retreat from managed code back to native code in the operating system. I’d guess that the issues faced by the Evernote team were not so different from those faced back then by the Windows team at Microsoft.
WPF is not only based on .NET. It also uses DirectX and hardware acceleration under the covers, enabling rich multimedia effects. The layout language of WPF is XAML, giving freedom from scaling issues which cause hassles in the native API.
So what are the lessons here? Is WPF no good?
It is not so simple. WPF is brilliant in many ways, offering the productivity of .NET coding and a powerful layout framework. However it was a technology which Microsoft itself hardly used in its key products, Windows and Office – a warning sign.
When Microsoft built Visual Studio 2010 and .NET 4.0, the development team used WPF for the Visual Studio shell. This move by an internal team to create such a complex product in WPF was good for the framework itself. The font issue was addressed, performance improved. Evernote might not have found all its issues fixed in version 4.0, but it would likely have been better.
After I tweeted about Evernote’s experience, a couple of Microsoft folk contacted me to make this point. The trouble is, even version 3.5 of WPF was not the first version, and it never sounds altogether convincing if, when a customer complains about your product, you tell them everything is fine in the latest and greatest build. Why did Microsoft not get this right before?
That said, I am sure the latest WPF is better than before, though it is still heavyweight relative to native code. Factors that might suggest a WPF solution include:
- The application only needs to run on Windows
- There is no need to support older machines
- The application makes use of data visualisation or other multimedia effects
- The development team lacks the resources to build equivalent functionality in native code
The last point is important. Maybe a hotshot team of C/C++ developers could make a better job, but if you don’t have such a team or the money to hire it, it is not so relevant.
There is another possible approach, without abandoning .NET. Silverlight has many of the features of WPF, is lightweight, and runs on the Mac as well as Windows.
35 thoughts on “Lessons from Evernote’s flight from .NET”
So, what UI components did you use? Native api calls like
HWND h = CreateWindowEx(WS_EX_CLIENTEDGE, “edit”, “Text”, WS_CHILD …
or did you leverage some other UI framework for c++?
I have to agree with Ismael, I’d see that Qt would be worth of considering. You get all the platforms (Win/Linux/Mac) one can ever imegine, great tools to ease the developers’ lives (internationalization, gui designer, cross platform make…whole IDE if you like), very powerful yet still easy to use api’s that cover areas greatly beyond creating just gui’s…very throughly documented api with tons of examples. Oh yes, and you get it with the LGPL or commercial license.
I’ve been working with Qt for years and it’s just pure pleasure to work with it :)! Just a matter of downloading and giving it a try.
+1 for Qt – I can’t imagine why people would stick with a single platform solution when such a stunning fully cross platform (but natively compiled) comprehensive application framework exists, and is LGPL!
@Andreano Lanusse “You can do everything WPF does using Delphi, having high performance application, small footprint, developer productivity”
Do I have accelerated GPU controls? Which is a distinctive feature of WPF. This is in fact one of the main differences between Windows Forms, the VCL .NET equivalent. Does Delphi integrates as data source with a Linq to Sql query? Does integrates smoothly with any VB.Net code or Delphi Prism (Oxygene) code in a native and painless way? Does it has a way to automatically manage the memory using a GC and not just reference counting? Can it work on Linux? As .Net can do it with Moonlight? Does it has a high end refactoring tool as is Resharper in .Net world?”
“…and more open platform.”
Is Delphi more open? On which basis? Can I have an opensource compiler as .Net has (Mono)? Does it has an alternate IDE that opens your solution and recompile without paying a penny? (as is with MonoDevelop or SharpDevelop). I’ve bought a VS 2008 Standard with less than 400 euro followed by a VS 2010 Pro upgrade with less than 400 euros too. The price of TWO editions price-wise of VS is much cheaper than any version of Delphi I know of
If you exclude the compiler times, the platform you want to say it is probably Qt: portable, clean written, with any C++ IDE of choice, VS, Qt Creator, OS of choice (when will be released a Linux IDE for Delphi, or you still use Kylix released 7 years ago!?), 64 bit (when Embarcadero will do it? 2012, before “the end of the world”!?). You will not have probably garbage collector, but excluding this, probably you wanted to say Qt not Delphi
What I would like to know is what API the Evernote team decided to use?
Going to C++ is all good but what GUI API are they using? Win32?
@Andreano Delphi is nothing like WPF and certainly doesn’t do what it can. However Delphi compares very favourably with C++ for native code and is my Windows native code IDE of choice – same performance, same flexibility but much easier to develop with.
.Net has its problems but there is no doubt that as @otakucode says vector based UIs are the future as resolutions increase, be that WPF, Silverlight or something else.
.Net languages are also at the forefront of language development with guys like Anders Hejlsberg at the helm who, by the way, was also chief architect of Delphi.
As for cross-platform, I don’t understand why so many developers get hung up on this. Hardly any of the thousands of iPhone apps are cross-platform, yet they were all developed within a few years, proving that cross-platform is a red herring when it come to rich GUIs.
I’ve only worked with .NET 2.0 Framework, and then I jumped ship *for* Delphi. Best decision I have made in my programming “career”.
I don’t know if Delphi can do everything WPF can do, I simply know that it’s easy to make nice, clean looking GUI’s with Delphi…without the overhead of WPF.
> Does it has a way to automatically manage the memory using a GC and not just reference counting?
No, Delphi requires the programmer to understand the memory they allocate and free it. I actually prefer this because it allows me greater control of the memory allocation of objects I create. I may be in the minority, but I don’t want to trade programmer ease for the overhead of a generational garbage collector.
However, in Delphi, strings are reference counted and fully managed for you (it’s also bounds checked and does not live on the stack…which prevents string buffer overflows)
Check out this recent post from a Delphi expert on Little Things Delphi Gets Right: http://tech.turbu-rpg.com/205/little-things-delphi-gets-right
I would use .NET to write a dynamic website in a heartbeat, but not to create a desktop application. QT seems very interesting to me, but I really prefer working in Pascal, so I haven’t done much with it…meaning I won’t comment on it.
I did install Evernote 4 to see what native code toolkit they’ve used instead of .NET and WPF.
The size of the “c:Program FilesEvernoteEvernote” was 122 MB, the installer was 46.8 MB.
I’ve archived the whole Evernote folder using 7-zip and the resulting archive was 20.3 MB. So instead of using Windows Installer they could have used NSIS to cut the installer size to half.
They didn’t use MFC or Qt, but what then? Win32 API? Well yes. They’ve used WTL (http://wtl.sourceforge.net/), the same library Google chose for Google Chrome web browser.
Going further by analyzing libcef.dll I’ve found out that they use “Chromium Embedded Framework (CEF)” (http://code.google.com/p/chromiumembedded/)
This is a cool move, you get to have Google’s web browser in your own product!
>>Oh ? You mean VCL ?
He means FireMonkey maybe (FMX), that comes with Delphi XE2. It’s looking like VCL but FireMonkey – cross platfrom framework with GPU accelerated controls (for windows – Direct2D, Direct3D, on Macintosh – OpenGL). So now you can develop and compile native apps with GUI for MacOS, like in VCL for Windows.
Interesting discussion, have read hundreds of them …
Instead of being happy to benefit from the choice discussions turn into defending the beloved whatever. Not the point.
Suggesting Silverlight does mean seeing Evernote as a LOB.
Tim made the point: Why did Microsoft not get this right before?
Vector GUI was in ‘everybodies’ mouth these days and MS had to bring. Afik, the blurry fonts have to with GDI+ but I am not sure.
WPF simply appeared too late and too early. To late for making the rules and too late because of investments into appropriate hardware set on hold in 2007-09 and with this accompanied delayed Win7 rollouts … The technology was ready but not the people.
Wondering why Winforms is still preferred;). Maybe it has something to with ease comparable to the ‘VCL’ or the Firemonkey. I understand Marcelo L’s view from the overall perspective from the whole .net offering, this does not make Andreano a clown, Andreano is maybe an Entertainer too because of his job role. The Firemonkey is a change … it is more than just a vector based VCL, but easy to use too.
I am wondering little – who needs all this that does come with Silverlight 5. Microsoft I think … nothing bad. On Mac the X-Code, what else.
Comments are closed.