SlideShare une entreprise Scribd logo
1  sur  31
Windows 8 development
                             C# vs. C++
                         practical experience
                                   Daniel Biesiada
                           consultant and solution architect




sobota, 5 stycznia 13
About me




sobota, 5 stycznia 13
About me
        13


sobota, 5 stycznia 13
About me
        13
         7
sobota, 5 stycznia 13
About me
        13
         7
sobota, 5 stycznia 13
About me
        13
         7
sobota, 5 stycznia 13
About me
        13
         7
sobota, 5 stycznia 13
Two apps




sobota, 5 stycznia 13
In common
                        • Windows 8 app targeting touch devices
                        • Relatively simple (in scope ~= 1 month)
                        • B2B model:
                         • I’m just the dev and advisory guy
                         • Product design, management and
                            ownership => customer side


sobota, 5 stycznia 13
Top differences
                        •   Customer types:

                            •   Corporate vs. Startup entity

                        •   Technology:

                            •   C# & Xaml vs. C++, Xaml & DirectX

                        •   Design

                            •   Core „Metro” vs. 95% custom

                            •   In-app business model {free vs. paid}


sobota, 5 stycznia 13
Top differences
                        •   Customer types:

                            •   Corporate vs. Startup entity

                        •   Technology:

                            •   C# & Xaml vs. C++, Xaml & DirectX

                        •   Design

                            •   Core „Metro” vs. 95% custom

                            •   In-app business model {free vs. paid}


sobota, 5 stycznia 13
Team, process &
                                 communication
                        •   Roles and competences
                            •   think carefully about communication inside the team

                            •   especially when customer is part of the team

                        •   Tools:
                            •   for prototyping

                            •   for testing

                            •   for software and design requirements

                        •   „Agile” approach
                            •   short iterations vs. discussion about „imperfect product”

                            •   milestones and again appropriate communication with the customer




sobota, 5 stycznia 13
Design




sobota, 5 stycznia 13
Design




sobota, 5 stycznia 13
Design




sobota, 5 stycznia 13
Design




sobota, 5 stycznia 13
Design
                        •   When porting from Web/IOS:

                            •   New features (non existing on other platforms)

                                •   Snap View

                                •   Search, Share contracts

                            •   Understanding of Metro Design principles

                                •   If only possible everything asynchronous

                                •   (Data = Content) Driven Development

                        •   Expression Blend, tricky yet unavoidable and handy tool
                            for design keen developers.



sobota, 5 stycznia 13
CPP vs. C#
                                       experience
                        •   Easy part:

                            •   Xaml is the same and behaves the same, you can
                                trust it and your skills

                            •   Great async support with PPL Tasks

                                •   still, remember about the Dispatcher

                        •   Challenges:

                            •   WinRT projection to C# != projection to C++

                            •   DirectX mappings, then it’s cool too.

                            •   Understanding of share contract



sobota, 5 stycznia 13
WinRT in C++ from
                               C-sharpers’
                        •   Basic Platform::String example:

                            •   In C++:

                                •   initializer,

                                •   cast to std::wstring

                                •   ::Begin, ::End iterators

                                •   array [] wchar_t indexer

                                •   Concat method & operators

                            •   AND THAT’S ALL WHAT YOU HAVE


sobota, 5 stycznia 13
WinRT in C++ from
                           C-sharpers’
                        •   How to sub divide, search and execute other usual string
                            operations?

                            •   cast to std::wstring and go with STL


                            •   Pros: great interaction with STL

                            •   Cons: stupid question rather: why the heck so basic
                                object is so limited?


                        •   .. and there is more diffs like that, C#‘ers will catch them
                            often



sobota, 5 stycznia 13
PPL Tasks
 	
   if	
  (file	
  !=	
  nullptr)
 	
   {
 	
   	
   Platform::String^	
  m_imageFileName	
  =	
  file-­‐>Name;
 	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
 	
   	
   task<Streams::IRandomAccessStream^>	
  createStreamTask(
                                  file-­‐>OpenAsync(FileAccessMode::ReadWrite));

                        createStreamTask.then(
                        [=](Streams::IRandomAccessStream^	
  randomAccessStream)	
  {
                        	
   SaveImageToStream(randomAccessStream,	
  saveBackground);
                        });
 	
   }




sobota, 5 stycznia 13
PPL Tasks
	
   loadAndRenderTask.then([=]()
  	
   if	
  (file	
  !=	
  nullptr)
	
   {
  	
   {
	
   	
   Dispatcher-­‐>RunAsync(CoreDispatcherPriority::Normal,
  	
   	
   Platform::String^	
  m_imageFileName	
  =	
  file-­‐>Name;
	
   	
   	
   ref	
  new	
  DispatchedHandler([=]()
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
   	
   	
   {	
   	
   	
   	
   	
   	
   	
   	
   	
  
  	
   	
   task<Streams::IRandomAccessStream^>	
  createStreamTask(
                                 	
   LoadWaitGrid-­‐>Visibility	
  =
                                   file-­‐>OpenAsync(FileAccessMode::ReadWrite));
                                               Windows::UI::Xaml::Visibility::Collapsed;
	
   	
   	
   	
   LoadProgressRing-­‐>IsActive	
  =	
  false;
                                   createStreamTask.then(
                                            SpeedText-­‐>Visibility	
  =	
  
                                   [=](Streams::IRandomAccessStream^	
  randomAccessStream)	
  {
                                               Windows::UI::Xaml::Visibility::Visible;	
  
                                   	
   SaveImageToStream(randomAccessStream,	
  saveBackground);
	
   	
   	
   	
   BackgroundButtonSpeed-­‐>Visibility	
  =	
  
                                   });
  	
   }                                       Windows::UI::Xaml::Visibility::Visible;

                            ...

	
   	
   	
   }	
   	
  
	
   }




sobota, 5 stycznia 13
Dynamic Binding
 	
  
                          and Cache
        Windows::UI::Xaml::Media::Imaging::BitmapImage^	
  bitmapSrc	
  =
 	
     	
   ref	
  new	
  Windows::UI::Xaml::Media::Imaging::BitmapImage();

        bitmapSrc-­‐>CreateOptions	
  =	
  BitmapCreateOptions::IgnoreImageCache;
 	
     bitmapSrc-­‐>UriSource	
  =	
  uri;
 	
     img-­‐>CacheMode	
  =	
  nullptr;
 	
     img-­‐>Source	
  =	
  bitmapSrc;
 	
     LoadListView-­‐>Items-­‐>Append(img);
        ...




sobota, 5 stycznia 13
Dynamic Binding
 	
  
                            and Cache
        Windows::UI::Xaml::Media::Imaging::BitmapImage^	
  bitmapSrc	
  =
 	
     	
   ref	
  new	
  Windows::UI::Xaml::Media::Imaging::BitmapImage();

        bitmapSrc-­‐>CreateOptions	
  =	
  BitmapCreateOptions::IgnoreImageCache;
 	
     bitmapSrc-­‐>UriSource	
  =	
  uri;
 	
     img-­‐>CacheMode	
  =	
  nullptr;
 	
     img-­‐>Source	
  =	
  bitmapSrc;
 	
     LoadListView-­‐>Items-­‐>Append(img);
        ...

 	
     ...
        file-­‐>DeleteAsync();

 	
     auto	
  item	
  =	
  (Image^)LoadListView-­‐>Items-­‐>GetAt(selected);
 	
     auto	
  src	
  =	
  (BitmapImage^)item-­‐>Source;
 	
     src-­‐>UriSource	
  =	
  nullptr;	
  //If	
  you	
  don’t	
  clear	
  it,	
  cache	
  stays
                                      	
  	
  	
  	
  	
  //even	
  if	
  all	
  IgnoreCache,	
  CacheMode	
  properties	
  
                                      	
  	
  	
  	
  	
  //are	
  set	
  well	
  
 	
     LoadListView-­‐>Items-­‐>RemoveAt(selected);
        ...
sobota, 5 stycznia 13
Resource
                              Management
                        • BitmapSource <=> DirectX/WIC
                        • Different Resolutions, DPI and
                          Proportions

                         • Xaml based positioning
                         • Renderer’s rescale capabilities
                         • Res/Snap/DPI Detection
sobota, 5 stycznia 13
Direct 2D paths,
                   nice stuff and bad stuff
                        •   Nice stuff, it handles ink over bezier curves well!


                        •   It lacks of BitmapBrush for Bezier strokes

                            •   BitmapBrush can only fill closed paths

                        •   Sampling on your own:
                                  strokeGeometry-­‐>ComputePointAtLength(	
  ...	
  )


                        •   Blending is kind of tricky:

                            •   ID2D1Image -> D2D1Bitmap tricks for eraser


sobota, 5 stycznia 13
Sharing API
                                    challenges
 	
     RandomAccessStreamReference^	
  imp	
  =	
  nullptr;	
  
 	
     ComPtr<IStream>	
  stream;

 	
     StorageFile^	
  file	
  =	
  SaveToFileForSharing();
 	
     auto	
  p	
  =	
  file-­‐>Path;

 	
     ras	
  =	
  RandomAccessStreamReference::CreateFromFile(file);

 	
     e-­‐>Request-­‐>Data-­‐>Properties-­‐>Title	
  =	
  "Hello	
  from	
  Bord	
  by	
  Pixle";

 	
   //e-­‐>Request-­‐>Data-­‐>SetUri(	
  ...	
  );
 	
   //e-­‐>Request-­‐>Data-­‐>SetText(	
  ...	
  );
 	
   //e-­‐>Request-­‐>Data-­‐>SetUri(	
  ...	
  );
 	
  
 	
   e-­‐>Request-­‐>Data-­‐>SetBitmap(ras);	
  
 	
   e-­‐>Request-­‐>Data-­‐>ResourceMap-­‐>Insert("chalkImage.jpg",	
  ras);	
  
 	
   e-­‐>Request-­‐>Data-­‐>SetHtmlFormat(HtmlFormatHelper::CreateHtmlFormat(L"<p>Look	
  
 what	
  I've	
  drawn	
  with	
  a	
  very	
  cool	
  app	
  called	
  Bord:	
  <img	
  src='chalkImage.jpg'></
 p>"));

sobota, 5 stycznia 13
Sharing API
                                          challenges
                        •   Publisher side has no control:

                            •   it exposes as many formats as possible (crazy tactic)

                            •   and hopes that consumer will interpret it well


                        •   Share JPG through SetBitmap and send it to Mail:

                            •   it converts it to PNG and (100kb JPG => 4.5MB PNG)

                        •   Messages accepts only URL

                            •   if you want to send there Facebook message with picture, you have to publish
                                picture in the cloud first, you cannot upload it from local storage anyhow.
                        •   You expose something in a format

                            •   App „A” interprets it well, app B screwed the thing around in embarassing
                                way. There is no option that you’d like to keep format exposed to „A” and
                                block to „B”




sobota, 5 stycznia 13
Of course there is
                               more


                        • but we have only 30 minutes, so...



sobota, 5 stycznia 13
.. to summarize
                        •   C++ experience is much better than Win32/MFC/whatever old-school
                            Windows development

                        •   Even though WinRT is in C++ (WRL) there is still lot of API
                            inconsequence in projections.

                            •   for Xaml only apps, it’s 1st class citizen if the language is the
                                preference, but you have to be patient to mix Cx/ISO and WinRT/
                                STL routines

                            •   (or wrap it well if project is bigger or you’re the architecture junkie)

                        •   DirectX 11.1 lacks of good documentation - if you lack experience,
                            you’ll have to experiment a lot!

                        •   It integrates great with STL and COM (via WRL)

                        •   It has great async support (PPL)




sobota, 5 stycznia 13
Thank you
                        daniel.biesiada@ushine.pl




sobota, 5 stycznia 13

Contenu connexe

Dernier

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Dernier (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

En vedette

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

En vedette (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Windows 8 Dev, C# vs. C++ experience in practical projects

  • 1. Windows 8 development C# vs. C++ practical experience Daniel Biesiada consultant and solution architect sobota, 5 stycznia 13
  • 2. About me sobota, 5 stycznia 13
  • 3. About me 13 sobota, 5 stycznia 13
  • 4. About me 13 7 sobota, 5 stycznia 13
  • 5. About me 13 7 sobota, 5 stycznia 13
  • 6. About me 13 7 sobota, 5 stycznia 13
  • 7. About me 13 7 sobota, 5 stycznia 13
  • 8. Two apps sobota, 5 stycznia 13
  • 9. In common • Windows 8 app targeting touch devices • Relatively simple (in scope ~= 1 month) • B2B model: • I’m just the dev and advisory guy • Product design, management and ownership => customer side sobota, 5 stycznia 13
  • 10. Top differences • Customer types: • Corporate vs. Startup entity • Technology: • C# & Xaml vs. C++, Xaml & DirectX • Design • Core „Metro” vs. 95% custom • In-app business model {free vs. paid} sobota, 5 stycznia 13
  • 11. Top differences • Customer types: • Corporate vs. Startup entity • Technology: • C# & Xaml vs. C++, Xaml & DirectX • Design • Core „Metro” vs. 95% custom • In-app business model {free vs. paid} sobota, 5 stycznia 13
  • 12. Team, process & communication • Roles and competences • think carefully about communication inside the team • especially when customer is part of the team • Tools: • for prototyping • for testing • for software and design requirements • „Agile” approach • short iterations vs. discussion about „imperfect product” • milestones and again appropriate communication with the customer sobota, 5 stycznia 13
  • 17. Design • When porting from Web/IOS: • New features (non existing on other platforms) • Snap View • Search, Share contracts • Understanding of Metro Design principles • If only possible everything asynchronous • (Data = Content) Driven Development • Expression Blend, tricky yet unavoidable and handy tool for design keen developers. sobota, 5 stycznia 13
  • 18. CPP vs. C# experience • Easy part: • Xaml is the same and behaves the same, you can trust it and your skills • Great async support with PPL Tasks • still, remember about the Dispatcher • Challenges: • WinRT projection to C# != projection to C++ • DirectX mappings, then it’s cool too. • Understanding of share contract sobota, 5 stycznia 13
  • 19. WinRT in C++ from C-sharpers’ • Basic Platform::String example: • In C++: • initializer, • cast to std::wstring • ::Begin, ::End iterators • array [] wchar_t indexer • Concat method & operators • AND THAT’S ALL WHAT YOU HAVE sobota, 5 stycznia 13
  • 20. WinRT in C++ from C-sharpers’ • How to sub divide, search and execute other usual string operations? • cast to std::wstring and go with STL • Pros: great interaction with STL • Cons: stupid question rather: why the heck so basic object is so limited? • .. and there is more diffs like that, C#‘ers will catch them often sobota, 5 stycznia 13
  • 21. PPL Tasks   if  (file  !=  nullptr)   {     Platform::String^  m_imageFileName  =  file-­‐>Name;                           task<Streams::IRandomAccessStream^>  createStreamTask( file-­‐>OpenAsync(FileAccessMode::ReadWrite)); createStreamTask.then( [=](Streams::IRandomAccessStream^  randomAccessStream)  {   SaveImageToStream(randomAccessStream,  saveBackground); });   } sobota, 5 stycznia 13
  • 22. PPL Tasks   loadAndRenderTask.then([=]()   if  (file  !=  nullptr)   {   {     Dispatcher-­‐>RunAsync(CoreDispatcherPriority::Normal,     Platform::String^  m_imageFileName  =  file-­‐>Name;       ref  new  DispatchedHandler([=]()                             {                       task<Streams::IRandomAccessStream^>  createStreamTask(   LoadWaitGrid-­‐>Visibility  = file-­‐>OpenAsync(FileAccessMode::ReadWrite)); Windows::UI::Xaml::Visibility::Collapsed;         LoadProgressRing-­‐>IsActive  =  false; createStreamTask.then( SpeedText-­‐>Visibility  =   [=](Streams::IRandomAccessStream^  randomAccessStream)  { Windows::UI::Xaml::Visibility::Visible;     SaveImageToStream(randomAccessStream,  saveBackground);         BackgroundButtonSpeed-­‐>Visibility  =   });   } Windows::UI::Xaml::Visibility::Visible; ...       }       } sobota, 5 stycznia 13
  • 23. Dynamic Binding   and Cache Windows::UI::Xaml::Media::Imaging::BitmapImage^  bitmapSrc  =     ref  new  Windows::UI::Xaml::Media::Imaging::BitmapImage(); bitmapSrc-­‐>CreateOptions  =  BitmapCreateOptions::IgnoreImageCache;   bitmapSrc-­‐>UriSource  =  uri;   img-­‐>CacheMode  =  nullptr;   img-­‐>Source  =  bitmapSrc;   LoadListView-­‐>Items-­‐>Append(img); ... sobota, 5 stycznia 13
  • 24. Dynamic Binding   and Cache Windows::UI::Xaml::Media::Imaging::BitmapImage^  bitmapSrc  =     ref  new  Windows::UI::Xaml::Media::Imaging::BitmapImage(); bitmapSrc-­‐>CreateOptions  =  BitmapCreateOptions::IgnoreImageCache;   bitmapSrc-­‐>UriSource  =  uri;   img-­‐>CacheMode  =  nullptr;   img-­‐>Source  =  bitmapSrc;   LoadListView-­‐>Items-­‐>Append(img); ...   ... file-­‐>DeleteAsync();   auto  item  =  (Image^)LoadListView-­‐>Items-­‐>GetAt(selected);   auto  src  =  (BitmapImage^)item-­‐>Source;   src-­‐>UriSource  =  nullptr;  //If  you  don’t  clear  it,  cache  stays          //even  if  all  IgnoreCache,  CacheMode  properties            //are  set  well     LoadListView-­‐>Items-­‐>RemoveAt(selected); ... sobota, 5 stycznia 13
  • 25. Resource Management • BitmapSource <=> DirectX/WIC • Different Resolutions, DPI and Proportions • Xaml based positioning • Renderer’s rescale capabilities • Res/Snap/DPI Detection sobota, 5 stycznia 13
  • 26. Direct 2D paths, nice stuff and bad stuff • Nice stuff, it handles ink over bezier curves well! • It lacks of BitmapBrush for Bezier strokes • BitmapBrush can only fill closed paths • Sampling on your own: strokeGeometry-­‐>ComputePointAtLength(  ...  ) • Blending is kind of tricky: • ID2D1Image -> D2D1Bitmap tricks for eraser sobota, 5 stycznia 13
  • 27. Sharing API challenges   RandomAccessStreamReference^  imp  =  nullptr;     ComPtr<IStream>  stream;   StorageFile^  file  =  SaveToFileForSharing();   auto  p  =  file-­‐>Path;   ras  =  RandomAccessStreamReference::CreateFromFile(file);   e-­‐>Request-­‐>Data-­‐>Properties-­‐>Title  =  "Hello  from  Bord  by  Pixle";   //e-­‐>Request-­‐>Data-­‐>SetUri(  ...  );   //e-­‐>Request-­‐>Data-­‐>SetText(  ...  );   //e-­‐>Request-­‐>Data-­‐>SetUri(  ...  );     e-­‐>Request-­‐>Data-­‐>SetBitmap(ras);     e-­‐>Request-­‐>Data-­‐>ResourceMap-­‐>Insert("chalkImage.jpg",  ras);     e-­‐>Request-­‐>Data-­‐>SetHtmlFormat(HtmlFormatHelper::CreateHtmlFormat(L"<p>Look   what  I've  drawn  with  a  very  cool  app  called  Bord:  <img  src='chalkImage.jpg'></ p>")); sobota, 5 stycznia 13
  • 28. Sharing API challenges • Publisher side has no control: • it exposes as many formats as possible (crazy tactic) • and hopes that consumer will interpret it well • Share JPG through SetBitmap and send it to Mail: • it converts it to PNG and (100kb JPG => 4.5MB PNG) • Messages accepts only URL • if you want to send there Facebook message with picture, you have to publish picture in the cloud first, you cannot upload it from local storage anyhow. • You expose something in a format • App „A” interprets it well, app B screwed the thing around in embarassing way. There is no option that you’d like to keep format exposed to „A” and block to „B” sobota, 5 stycznia 13
  • 29. Of course there is more • but we have only 30 minutes, so... sobota, 5 stycznia 13
  • 30. .. to summarize • C++ experience is much better than Win32/MFC/whatever old-school Windows development • Even though WinRT is in C++ (WRL) there is still lot of API inconsequence in projections. • for Xaml only apps, it’s 1st class citizen if the language is the preference, but you have to be patient to mix Cx/ISO and WinRT/ STL routines • (or wrap it well if project is bigger or you’re the architecture junkie) • DirectX 11.1 lacks of good documentation - if you lack experience, you’ll have to experiment a lot! • It integrates great with STL and COM (via WRL) • It has great async support (PPL) sobota, 5 stycznia 13
  • 31. Thank you daniel.biesiada@ushine.pl sobota, 5 stycznia 13