0

I understand (I think) the PCL uses a common set of .NET components on each platform. You can write as much as you can in the PCL that uses those common library components.

Is the PCL just to ensure that I am "protected" from referencing native APIs I may have forgotten to include, without a reference in VS? In other words, the PCL guarantees what can be used on all of the platforms.

Do I save any code writing by using PCL over SAP?

johnny
  • 19,272
  • 52
  • 157
  • 259

1 Answers1

3

There's quite a bit of information on this topic here: https://developer.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options/

There is a small holy war of what is better. To be honest, it's really up to you to determine which you like better as a developer/architect. Here's a couple questions to help you determine that:

Xamarin Shared Projects vs Portable class libraries

Xamarin Shared Library and PCL

Also there's a couple of great blog posts by Miguel de Icaza(CTO - Xamarin) and Jason Smith(Xamarin.Forms) respectfully:

http://tirania.org/blog/archive/2016/Jan-22.html

http://xfcomplete.net/general/2016/01/19/pcl-or-shared-project/

Do note that netstandard is on the horizon, so the "next generation of PCL" might be more attractive: https://github.com/dotnet/standard/blob/master/docs/faq.md#what-is-net-standard

Community
  • 1
  • 1
Jon Douglas
  • 13,006
  • 4
  • 38
  • 51