SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Kürzlich hochgeladen (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Empfohlen

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
 

Empfohlen (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