{"id":8930,"date":"2013-09-17T11:49:35","date_gmt":"2013-09-17T09:49:35","guid":{"rendered":"https:\/\/blog.trifork.com\/?p=8930"},"modified":"2013-09-17T11:49:35","modified_gmt":"2013-09-17T09:49:35","slug":"windows-phone-8-c-vs-java","status":"publish","type":"post","link":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/","title":{"rendered":"Windows Phone 8 &#8211; C# vs. Java"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9364\" style=\"float: right\" alt=\"csharp-vs-java\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2013\/09\/csharp-vs-java.png\" width=\"220\" height=\"140\" \/><br \/>\nWelcome back to another brand new Windows Phone 8 blog! After I <a href=\"https:\/\/blog.trifork.com\/2013\/07\/16\/windows-phone-8-a-new-platform\/\" target=\"_blank\" rel=\"noopener\">explored the UI<\/a> and <a href=\"https:\/\/blog.trifork.com\/2013\/08\/06\/developing-windows-phone-8-apps\/\" target=\"_blank\" rel=\"noopener\">checked out the IDE<\/a> it is now time to take a look at the programming language: C# or &#8220;C sharp&#8221;. I want to focus purely on the language itself and compare it to the language I know best: Java. I was surprised how good C# was compared to Java. The syntax of both languages look a lot alike. I want to highlight some of the language features I discovered while writing my first app of which I thought: wow, I wish Java would have this!<\/p>\n<p><!--more--><\/p>\n<h2>Getters and setters<\/h2>\n<p>Getters and setters appear to be part of the language.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nclass Person {\n    public int Age { get; set; }\n}\n<\/pre>\n<p>Do you want the getter to be public and the setter only accessible from within the class (private)? No problem!<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nclass Person {\n    public int Age { get; private set; }\n}\n<\/pre>\n<p>As you can see, this is way shorter than implementing a default getter and\/or setter in Java. <strong>Note that in C#, public properties and methods start with a capital letter.<\/strong> This is unlike Java, where those types of symbols start with a lower case letter.<\/p>\n<p>If you decide to have custom logic (which is hardly ever the case) in your getter or setter you can still do so.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nclass Person {\n    private int age;\n    public int Age {\n        get {\n            return age;\n        }\n        set {\n            if (value == null) {\n                throw new ArgumentNullException(&quot;value&quot;);\n            }\n            age = value;\n        }\n    }\n}\n<\/pre>\n<h2>Calling constructors of the super class<\/h2>\n<p>When you create a subclass you often want it to have constructors that call the constructor of the superclass. In Java, there is a foggy compiler-rule that says you can only call the super-constructor in the first line of code in the constructor of your subclass.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\npublic Person(String name, int age) {\n    super(name);\n    this.age = age;\n}\n<\/pre>\n<p>If it is mandatory to do it in the first line, why not make calling the super constructor part of the language?<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\npublic Person(string name, int age) : base(name) {\n    this.age = age;\n}\n<\/pre>\n<p>I like this way of calling the super (base) constructor a lot better. The same applies for when you want to call another constructor in the same class.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic Person(string name) {\n    this.name = name;\n}\npublic Person(string name, int age) : this(name) {\n    this.age = age;\n}\n<\/pre>\n<h2>Constants<\/h2>\n<p>If you want to define a constant variable you want it to be static, and you want it to be immutable. In Java you have to literally write those two things down as &#8220;static&#8221; and &#8220;final&#8221;.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\npublic static final String NAME_PARAMETER = &quot;name&quot;;\n<\/pre>\n<p>In C# you have a keyword for constant variables.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\npublic const string NameParameter = &quot;name&quot;;\n<\/pre>\n<p>It does the same thing but is more declarative and shorter. It isn&#8217;t a big language feature but hey, every little helps!<\/p>\n<h2>Packages<\/h2>\n<p>This is more like a different keyword than a new language feature. I want to highlight it because I like the syntax better in C#. If you write a class definition, you do it using curly brackets around the definition. Why doesn&#8217;t it work the same for package?<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\npackage trifork.example;\npublic class Person {\n}\n<\/pre>\n<p>Why is package a statement of its own? Use curly brackets! And is &#8220;package&#8221; the right word for what it is? Sure, it IS a package, but what does it do? That&#8217;s right, it provides a <em>namespace<\/em> for your classes. So why not call it like what it is as C# does?<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nnamespace Trifork.Example {\n    public class Person {\n    }\n}\n<\/pre>\n<h2>Using another class<\/h2>\n<p>In Java you would write it down like this:<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\nimport trifork.example.Person;\n<\/pre>\n<p>Again this is just a keyword-thing but still, it describes what it does way better in C#.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\nusing Trifork.Example.Person;\n<\/pre>\n<p>&#8220;Importing&#8221; a class is what we did using C, where the compiler would literally import (copy) the contents of the header-file of one class into the header file of another class. In both Java and C# this is no longer the case. So why does Java still call it &#8220;import&#8221;? Because it is familiar to C-programmers? Isn&#8217;t <strong>using<\/strong> a better keyword for it?<\/p>\n<h2>String and Object are part of the language<\/h2>\n<p>In Java the <em>String<\/em> and <em>Object<\/em> types feel a bit like an after thought. It feels like something they added to the SDK later on when the language itself was already finished. In C# those two types are integrated into the language and therefore are keywords instead of classes.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nstring name = &quot;My name&quot;;\nobject person = new Person(name);\n<\/pre>\n<h2>Equality<\/h2>\n<p>Why do we have to use <em>equals()<\/em> when comparing two Java objects? Because if we would use the == operator, it would only resolve as true when both references are referring the exact same instance. Say we&#8217;re comparing object1 and object2:<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\nif (object1.equals(object2)) {\n    \/\/ Do your thing\n}\n<\/pre>\n<p>What if both object1 and object2 can be null at some point, you even risk the program throwing a <em>NullPointerException<\/em> so you would have to write it down like this:<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\nif (object1 == null ? object2 == null : object1.equals(object2)) {\n    \/\/ Do your thing\n}\n<\/pre>\n<p>In C# another thing that is part of the language is object equality. You can safely use the == operator on objects, because at runtime, the <em>Equals()<\/em> method will be called. (only when object1 is not null of course)<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nif (object1 == object2) {\n    \/\/ Do your thing\n}\n<\/pre>\n<p>One side note: in C# it is possible override the behaviour of the == operator so the behaviour could change in theory.<\/p>\n<h2>Better date\/time API<\/h2>\n<p>We all know the date\/time API in Java sucks, that&#8217;s why many of us are using <a href=\"http:\/\/www.joda.org\/joda-time\/\" target=\"_blank\" rel=\"noopener\">Joda Time<\/a> instead. But without Joda Time you would have to write this kind of code in Java:<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\nDate date = new Date();\nCalendar calendar = Calendar.getInstance();\ncalendar.setTime(date);\ncalendar.add(Calendar.HOUR, 2);\ndate = calendar.getTime();\n<\/pre>\n<p>Besides the fact that this is a lot of code for something simple, it is weird that an object called &#8220;Date&#8221; also contains the time. In C# the standard date\/time API already works kind of like Joda Time does.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\nDateTime dateTime = DateTime.Now;\ndateTime = dateTime.AddHours(2);\n<\/pre>\n<h2>Formatting dates as a string<\/h2>\n<p>In Java:<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\nDate date = new Date();\nDateFormat formatter = new SimpleDateFormat(&quot;dd-MM-yyyy&quot;);\nString dateString = formatter.format(date);\n<\/pre>\n<p>C#:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nDateTime date = DateTime.Now;\nstring dateString = date.ToString(&quot;dd-MM-yyyy&quot;);\n<\/pre>\n<p>Do I even need to explain this one?<\/p>\n<h2>Casting a class<\/h2>\n<p>Casting a class to another class can be done the same way in Java as in C#. Sometimes you want to do in-line casting to a class to be able to call one single method on it.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java &amp; C#\n((Duck)animal).quack();\n<\/pre>\n<p>In C# an alternative way exists to cast a class, with the &#8220;as&#8221; keyword, which makes in-line casting a class a little more readable.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\n(animal as Duck).quack();\n<\/pre>\n<h2>Threading<\/h2>\n<p>Threading is also something that is part of the C# language, using the &#8220;await&#8221; and &#8220;async&#8221; keywords.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nasync Task&lt;int&gt; AccessTheWebAsync() {\n    HttpClient client = new HttpClient();\n    Task&lt;string&gt; getStringTask = client.GetStringAsync(&quot;http:\/\/msdn.microsoft.com&quot;);\n\n    \/\/ You can do work here that doesn't rely on the string from GetStringAsync.\n    DoIndependentWork();\n\n    string urlContents = await getStringTask;\n    return urlContents.Length;\n}\n<\/pre>\n<p>If you define a method as being &#8220;async&#8221;, the method will automatically be executed in the background and will return a &#8220;Task&#8221; instance immediately, which is similar to a &#8220;Future&#8221; object in Java. The calling code can &#8220;await&#8221; the result and do some independent work first.<\/p>\n<h2>Readonly fields<\/h2>\n<p>C# uses the &#8220;readonly&#8221; keyword instead of &#8220;final&#8221; in Java. Not a new feature, but again a better word for what it does.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\nfinal String name = &quot;My name&quot;;\n<\/pre>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\nreadonly string name = &quot;My name&quot;;\n<\/pre>\n<h2>&#8220;??&#8221; notation<\/h2>\n<p>Have you ever run into a situation that requires your code to return something, only if a certain variable is not null, and null if it is? You would write code like this:<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\npublic String nameForPerson(Person person) {\n    return person == null ? null : person.getName();\n}\n<\/pre>\n<p>In C# a shorthand notation exists for this type of situation:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\npublic string nameForPerson(Person person) {\n    return person ?? person.Name;\n}\n<\/pre>\n<p>This shorthand notation can also be useful if you&#8217;re using a singleton-like pattern:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\nprivate PersonRepository personRepository;\n\npublic PersonRepository PersonRepository() {\n    return personRepository ?? (personRepository = new PersonRepository());\n}\n<\/pre>\n<h2>Literal notation for maps and arrays<\/h2>\n<p>Even the inferior Objective C language has a literal notation for arrays (lists) and dictionaries (maps), so why doesn&#8217;t Java have it??<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\nMap&lt;String, String&gt; entries = new HashMap&lt;&gt;();\nentries.put(&quot;a&quot;, &quot;apple&quot;);\nentries.put(&quot;b&quot;, &quot;banana&quot;);\n\nString apple = entries.get(&quot;a&quot;);\n<\/pre>\n<p>Anyway, C# has a literal notation for this:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar entries = new Dictionary&lt;string, string&gt; {\n    { &quot;a&quot;, &quot;apple&quot; },\n    { &quot;b&quot;, &quot;banana&quot; }\n};\nstring apple = entries&#x5B;&quot;a&quot;];\n<\/pre>\n<p>A similar thing works for lists:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar list = new List&lt;string&gt; { &quot;apple&quot;, &quot;banana&quot; };\nstring apple = list&#x5B;0];\n<\/pre>\n<h2>SQL is part of the language<\/h2>\n<p>Search through lists like this:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar results = from p in list\n            where p.Age &gt; 18\n            select p;\n<\/pre>\n<p>This will give you all Person objects in the &#8220;list&#8221; where the age is more than 18. You can also do similar things using LINQ and lambda expressions:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar results = list.Where(person =&gt; person.Age &gt; 18);\n<\/pre>\n<p>Instead of searching for specific people, you want a list of all names of those people? No problem!<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar names = list.Select(person =&gt; perons.Name);\n<\/pre>\n<h2>Using pointers<\/h2>\n<p>Many people get goose bumps when they hear the word &#8220;pointer&#8221; because they know what a mess you can make of your code when you have to use pointers directly. In C# you of course mainly use references, just like in Java. But sometimes pointers can be very handy. What if you create a method and you would like to return multiple values? In Java I always create a new class containing each value as a field, and instantiate that class and use it to return mulitple values. In C# you can simply use the &#8220;out&#8221; keyword that works like a pointer.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nclass OutReturnExample {\n    public void OutMethod(out int value, out string text) {\n        value = 44;\n        text = &quot;I've been returned&quot;;\n    }\n    public void DoIt() {\n        int value;\n        string text;\n        OutMethod(out value, out text);\n        \/\/ value is now 44\n        \/\/ text is now &quot;I've been returned&quot;\n    }\n}\n<\/pre>\n<h2>Overriding methods<\/h2>\n<p>And finally, not a new feature, but again something that is part of the language where in Java it isn&#8217;t, which makes it nicer.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/ Java\n@Override\npublic String toString() {\n    return &quot;description&quot;;\n}\n<\/pre>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\npublic override string ToString() {\n    return &quot;description&quot;;\n}\n<\/pre>\n<h2>Probably many more features<\/h2>\n<p>C# probably has many more features I did not discover in the short time I have worked with it so far but I am eager to discover them!<\/p>\n<h2>Conclusion<\/h2>\n<p>Because the Visual Studio IDE is really crappy without a third party tool called <a href=\"http:\/\/www.jetbrains.com\/resharper\/\" target=\"_blank\" rel=\"noopener\">Resharper<\/a> (see <a target=\"_blank\" rel=\"noopener\">my previous blog<\/a>), I was expecting a language just as crappy. But it turned out it is quite the opposite! The language C# by itself is a really thought out language with many more features than Java, while it shares a lot of the same syntax as Java. Therefore the learning curve for this language is very steep when you already know Java (or not steep, depending on how you interpret &#8220;learning curve&#8221;, to clarify: I mean easy to learn). So writing code by combining <a href=\"http:\/\/www.jetbrains.com\/resharper\/\" target=\"_blank\" rel=\"noopener\">Resharper<\/a> and C# turned out to be a great joy and makes the entire Windows Phone 8 platform very worthwhile.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome back to another brand new Windows Phone 8 blog! After I explored the UI and checked out the IDE it is now time to take a look at the programming language: C# or &#8220;C sharp&#8221;. I want to focus purely on the language itself and compare it to the language I know best: Java. [&hellip;]<\/p>\n","protected":false},"author":115,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[346,31],"tags":[],"class_list":["post-8930","post","type-post","status-publish","format-standard","hentry","category-c","category-java"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Windows Phone 8 - C# vs. Java - Trifork Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Windows Phone 8 - C# vs. Java - Trifork Blog\" \/>\n<meta property=\"og:description\" content=\"Welcome back to another brand new Windows Phone 8 blog! After I explored the UI and checked out the IDE it is now time to take a look at the programming language: C# or &#8220;C sharp&#8221;. I want to focus purely on the language itself and compare it to the language I know best: Java. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/\" \/>\n<meta property=\"og:site_name\" content=\"Trifork Blog\" \/>\n<meta property=\"article:published_time\" content=\"2013-09-17T09:49:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2013\/09\/csharp-vs-java.png\" \/>\n<meta name=\"author\" content=\"Tom van Zummeren\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom van Zummeren\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/\",\"url\":\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/\",\"name\":\"Windows Phone 8 - C# vs. Java - Trifork Blog\",\"isPartOf\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2013\/09\/csharp-vs-java.png\",\"datePublished\":\"2013-09-17T09:49:35+00:00\",\"author\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/ae1748819f078cd2f65813bb689e9e0b\"},\"breadcrumb\":{\"@id\":\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#primaryimage\",\"url\":\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2013\/09\/csharp-vs-java.png\",\"contentUrl\":\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2013\/09\/csharp-vs-java.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trifork.nl\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Windows Phone 8 &#8211; C# vs. Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trifork.nl\/blog\/#website\",\"url\":\"https:\/\/trifork.nl\/blog\/\",\"name\":\"Trifork Blog\",\"description\":\"Keep updated on the technical solutions Trifork is working on!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trifork.nl\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/ae1748819f078cd2f65813bb689e9e0b\",\"name\":\"Tom van Zummeren\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/882552d346390f25c0ceacb5b6076623?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/882552d346390f25c0ceacb5b6076623?s=96&d=mm&r=g\",\"caption\":\"Tom van Zummeren\"},\"url\":\"https:\/\/trifork.nl\/blog\/author\/tom\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Windows Phone 8 - C# vs. Java - Trifork Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/","og_locale":"en_US","og_type":"article","og_title":"Windows Phone 8 - C# vs. Java - Trifork Blog","og_description":"Welcome back to another brand new Windows Phone 8 blog! After I explored the UI and checked out the IDE it is now time to take a look at the programming language: C# or &#8220;C sharp&#8221;. I want to focus purely on the language itself and compare it to the language I know best: Java. [&hellip;]","og_url":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/","og_site_name":"Trifork Blog","article_published_time":"2013-09-17T09:49:35+00:00","og_image":[{"url":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2013\/09\/csharp-vs-java.png","type":"","width":"","height":""}],"author":"Tom van Zummeren","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tom van Zummeren","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/","url":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/","name":"Windows Phone 8 - C# vs. Java - Trifork Blog","isPartOf":{"@id":"https:\/\/trifork.nl\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#primaryimage"},"image":{"@id":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#primaryimage"},"thumbnailUrl":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2013\/09\/csharp-vs-java.png","datePublished":"2013-09-17T09:49:35+00:00","author":{"@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/ae1748819f078cd2f65813bb689e9e0b"},"breadcrumb":{"@id":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#primaryimage","url":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2013\/09\/csharp-vs-java.png","contentUrl":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2013\/09\/csharp-vs-java.png"},{"@type":"BreadcrumbList","@id":"https:\/\/trifork.nl\/blog\/windows-phone-8-c-vs-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trifork.nl\/blog\/"},{"@type":"ListItem","position":2,"name":"Windows Phone 8 &#8211; C# vs. Java"}]},{"@type":"WebSite","@id":"https:\/\/trifork.nl\/blog\/#website","url":"https:\/\/trifork.nl\/blog\/","name":"Trifork Blog","description":"Keep updated on the technical solutions Trifork is working on!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trifork.nl\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/ae1748819f078cd2f65813bb689e9e0b","name":"Tom van Zummeren","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/882552d346390f25c0ceacb5b6076623?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/882552d346390f25c0ceacb5b6076623?s=96&d=mm&r=g","caption":"Tom van Zummeren"},"url":"https:\/\/trifork.nl\/blog\/author\/tom\/"}]}},"_links":{"self":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/8930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/comments?post=8930"}],"version-history":[{"count":0,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/8930\/revisions"}],"wp:attachment":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media?parent=8930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/categories?post=8930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/tags?post=8930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}