Lessons from Evernote’s flight from .NET

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.

VN:F [1.9.18_1163]
Rate this post
Rating: 7.8/10 (28 votes cast)
Lessons from Evernote’s flight from .NET, 7.8 out of 10 based on 28 ratings

Related posts:

  1. Lessons from Microsoft’s WSUS blunder
  2. Succeeding in an App Store world: lessons from the Angry Birds story
  3. C# vs C++ and .NET vs Mono vs Compact Framework performance tests
  4. Common sense on Windows 8, Silverlight and .NET
  5. Windows 8 will run on ARM processors – a natural home for Silverlight?

35 comments to Lessons from Evernote’s flight from .NET

  • Phil Winstanley

    It’s an interesting area, right tool for the right job.

    Lots of companies in the finance sector (in the UK anyway) are building trading applications in WPF because they need the visualisations it offers.

    If you need a grid and a button, it is probably overkill to roll it in WPF purely because it needs to be designed, that takes resource that most dev shops don’t naturally have.

    Cheers

    Phil

  • K. L. Estes

    But that is always Microsoft’s marketting strategy, which I call “Now – Even Less Retarded !!” Microsoft has been doing the same things for twenty or more years now – why are we not learning ?

    Or, given Apple’s brilliant ad campaign, we ARE learning =)

  • Bernd

    I think a great example for the disadvantages of WPF is the Microsoft Zune PC software.

    It’s so awfully slow and clunky.

  • You can do everything WPF does using Delphi, having high performance application, small footprint, developer productivity and more open platform.

    Try and you will see http://www.embarcadero.com/products/delphi

    Regards,
    Andreano Lanusse

  • Shaun

    Thanks Andreano, I didn’t know Delphi was so widely used..

  • Paul

    @Bernd: Zune doesn’t use WPF.

  • In reply to Bernd

    The Zune PC client is not written in WPF. It uses MS’s Media Center UI framework (“Iris”).

  • otakucode

    People who abandon vector-based UI elements for raster-based UI elements baffle me.

    What will your application look like if I run it on a 2000ppi monitor? I won’t be able to see it. And when you re-architect your entire application just to be able to support my 2000ppi monitor, it is going to be 500x slower than if you’d just done the smart forward-looking thing and moved to vector and surface-based solutions.

    Pixel art is not a viable platform for future applications. Yes, today it will have your application running quickly even on those XP machines that still composite the entire screen in main memory and then transfer it over to the videocard instead of maintaining separate surfaces in video memory like any half-wit would have had it doing 10 years earlier. Tomorrow, your application will be broken. And it either flat out will not be fixable, or your fix will be an utter tragedy.

    Go ahead, be that company that was certain GUIs were a flash in the pan and that character mode displays would dominate the world forever. Who needs more than 25×80, right? If you keep writing console mode applications, you can have a hyperfast app that launches in a millisecond on even the oldest, most terrible hardware!

    And for those bringing up Apple… Apple was doing the terrible bloated awful approach of separate surfaces in video memory and video hardware screen compositing from day 1. It’s the not-retarded way to approach screen composition, and will continue to be so into the future. If people are annoyed by the “blurry fonts” then tell them to either turn off anti-aliasing or bump up their resolution.

  • Roland Tomczak

    Zune software isn’t WPF (its the framework used in Windows Media Center).

    I’d be curious to know what were their bottlenecks, apart from font issues (solved in .Net 4).

  • Anon

    >> You can do everything WPF does using Delphi
    You made my day.

  • Simon B.

    How about ignore .NET and go Web. You get lots of visualizations, stuff like Yahoo YUI and others for free, and your nextdoor webdesigner wannabe can fix any tiny design problem. The availability of equivalently efficient .NET designrs surely are more expensive and harder to get hold of.

    Web gives no install issues and instant update, better “intra-application” security than on Windows. Remember that each windows application carries a potential for a local “root exploit”. Finance sector types might want to use something like Chromium (open source version of Google Chrome, with some Google-stuff cleaned out) and run in Incognito (“Private”) mode to make sure they are maximally protected from data leaks. Also install some ad blockers and good antivirus, and nothing more if at all possible.

  • EP

    I am not disputing C++ will do the job done with less startup time and memory. On the other hand the application will not look as good and will take way longer to develop. For a third party vendor this might make sense, for applications developed in house where you need maintainability, stability and visual rich interface it doesn’t make too much sense. Besides, I am pretty sure, Evernote 5 written completely in assembly will use 25% of the memory 4 uses and will start almost instantly.

  • thomas

    Look at the evolution of ppi in monitors in the last 20 years.
    Judging by that, 2000ppi monitors will be mainstream in the very very distant future. Some people need to ship working code today.

  • I also think the web idea is interesting, although a bit “out of the box”. It may not work as well for all scenarios, but at the same time, the time and effort spent by the browser vendors due to the competition these days should not be neglected. :)

  • Ryan

    .Net needs to die. It’s holding up the progression of the web.

  • Tim, nicely put:

    “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?”

  • CausticMango

    As a .NET developer (from the Beta days I might add), I too am finding the shine has worn off more than a little. It is more than a little disconcerting that Microsoft uses their own framework so little. It’s also a bad sign that you can usually tell a .NET app just by looking at it, much like Java before it.

    I developed an app for the iPhone and so learned Objective-C and Cocoa (well, and Cocoa Touch; Cocoa is the desktop framework from which Cocoa Touch is derived). It was strange at first (hey, who knew C# is the grandchild of Objective-C? wild!). The Cocoa framework turns out to be a rich, mature framework that’s easy to develop with, mixes freely with straight C and even C++, leverages lots of fast, cool C and C++ libraries, many of which are open source, and compiles down to fast,, native code. Apple clearly uses it extensively for their own products; it revs frequently, it creates apps and UIs that are fast, responsive, and beautiful.

  • Anon

    a 40 meg download for what should really be a web-app ?

  • jabits

    Web apps suck. I write web apps. They suck compared to Windows apps, but companies like the deployment story (I think most users would prefer a Windows app as well). I bet not too many of you guys develop in a web IDE. :P

  • “some problems we simply couldn’t fix: the blurry fonts, slow startup times, large memory footprint” — a note to Java folks: yes, large memory footprint is a problem (even though “memory is dirt cheap”)

  • Clyde Davies

    It’s not so much where they jumped from, but where they didn’t jump to, that intrigues me. They didn’t decide to use Java, or Flex, or even Silverlight, they just abandoned the idea of a managed framework and decided to redevelop in unmanaged code.

  • Ismael

    Performance, small memory footprint, development productivity, extremely rich, hardware accelerated GUI experience… I think you are describing Qt4 and you just don’t realize. Plus your software will run unchanged on Windows, Mac and Linux, and you can share code with portable and embedded platforms. I don’t really understand what’s the point of sticking to WPF. Even the new Maya is moving to Qt4: http://qt.nokia.com/qt-in-use

  • Marcelo L

    WTG Ismael…..bringing in the Qt ! It’s been around long enough that I’d say if it weren’t for it’s costs in licensing for commercial applications, it would be even bigger than it is today.

    That being said, who was the clown that said Delphi can do everything WPF can do ? What ? Delphi is development platform for the Pascal language under Windows and .NET. WPF is part of the .NET framework and a UI compositing and declarative UI building model ( looking strictly at it as a UI grammar which is what XAML is ).

    Oh ? You mean VCL ? Visual Component Library controls within Delphi ? Is that what you meant ? Because those of us who’ve worked with VCLs in and out of Delphi ( And C++ Builder. And Kylix, oh my ! ), know better.

    Delphi has it’s pluses, but please, the vast majority of windows developers left that train eons ago. Waiting for Borl…I mean Interpri…I mean Borlan…I mean CodeGea…I mean Embarcadero to catch up all the time.

    If your .NET app is consuming that amount of memory and is performing that sluggishly….you don’t just blame that on the platform. Anyone can make a Win32 C++ MFC app that is as slow as a slug. I’ve seen it. How you know you’re application architecture/model weren’t flawed in some huge way. It might still be. Gains encountered by switching to C++, which I’m presuming you leveraged SOME UI library. Because no one but game developers go directly DirectX, and even then it’s usually within the Rendering engines they license from others.

    Of course everyone PRESUMES you did your due diligence to assert for yourselves that indeed it was .NET’s fault ( and I’m by no means being an apologist for them, I’ve used this argument back at detractors of Java when some folks would complain about EJB this..EJB that. No one TOLD you you had to EJB this or that !).

    We’re presuming someone debugged their own resource consumption and weren’t leaking unmanaged resource like a sieve. We’re assuming that someone picked up a juicy tool like dotTrace, AQTime or some such and profiled their application trying to determine where the sluggish performance was bubbling up from.

    Given we’re not privy to that information, it’s just as plausible someone said, “I give up.” or, “I don’t know how to solve this”, and just used their glib tongue to convince the higher ups to “Hey, we’ll rewrite it in C++ and use that as part of the marketing push for the next rev !”

    I’ve seen it before….and it wouldn’t surprise me.

  • Marcelo L

    @jabits: There are some wildmen out there who have built such things “web ide”. Having tried a couple to satisfy my own technical curiosity, I can say “an ide only it’s progenitor could love”. Because there are so many gotchas, that only someone who had a vested interest in it’s success could honestly overlook some of the glaring usability issues with just such a construct.

    Carry on, soldier.

  • Chris

    @Marcelo L – calm down, saying Delphi can do what WPF can do is obviously silly, but on the other hand, Delphi remains a regularly updated native code development tool for Windows (the language, for example, now has generics, attributes and closures), and the VCL has ‘kept up’ better than (say) WinForms.

    ‘Given we’re not privy to that information, it’s just as plausible someone said, “I give up.” or, “I don’t know how to solve this”, and just used their glib tongue to convince the higher ups to “Hey, we’ll rewrite it in C++ and use that as part of the marketing push for the next rev !”’

    Only, porting to native code is said to have generated measurable performance and memory benefits. You’re in danger of sounding a wee bit precious about .NET…

  • S2

    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++?

  • JiiR

    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

  • Miguel

    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?

    Thanks

  • Zimmy

    @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.

  • Marcus

    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.

  • Cristian

    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 Files\Evernote\Evernote” 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!

  • Stan

    Marcelo L
    >>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.

  • Michael Thuma

    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.