{"id":224,"date":"2017-03-13T21:03:02","date_gmt":"2017-03-13T21:03:02","guid":{"rendered":"http:\/\/www.onux.com\/jspp\/blog\/?p=224"},"modified":"2017-03-14T03:04:16","modified_gmt":"2017-03-14T03:04:16","slug":"js-0-5-0-basic-classes","status":"publish","type":"post","link":"https:\/\/www.onux.com\/jspp\/blog\/js-0-5-0-basic-classes\/","title":{"rendered":"JS++ 0.5.0: Basic Classes"},"content":{"rendered":"<p>JS++ now supports the &#8216;class&#8217; keyword. As promised, we would have classes available by Q1 2017. Notably, we are providing &#8220;basic&#8221; classes, so the following features are supported:<\/p>\n<ul>\n<li>&#8216;class&#8217; keyword<\/li>\n<li>Inheritance<\/li>\n<li>Constructors (including private\/protected constructors that limit instantiation\/inheritance)<\/li>\n<li>Static Constructors<\/li>\n<li>Instantiation<\/li>\n<li>Fields<\/li>\n<li>Methods<\/li>\n<li>&#8216;this&#8217; keyword<\/li>\n<li>&#8216;super&#8217; keyword<\/li>\n<li>Method Overloading<\/li>\n<li>Constructor Overloading<\/li>\n<li>Getters and Setters (via &#8216;property&#8217; keyword)<\/li>\n<li>Type system support<\/li>\n<li>Debugger support for classes (via source maps)<\/li>\n<\/ul>\n<p>What did we consider to be outside the scope of basic classes? The following features are currently <em>not<\/em> available yet:<\/p>\n<ul>\n<li>Generic classes<\/li>\n<li>Abstract classes<\/li>\n<li>Inner classes<\/li>\n<li>Interfaces<\/li>\n<li>Virtual methods<\/li>\n<li>Custom Conversion Rules as defined in my book, <a href=\"https:\/\/www.onux.com\/jspp\/tutorials\/type-system#OOP-Defining-Conversions\">&#8220;The JS++ Type System&#8221;, Chapter 6.2<\/a><\/li>\n<\/ul>\n<p>As an example of what you can do with JS++ classes, we included an example with the Tiled Map Editor:<\/p>\n<p><a href=\"http:\/\/www.onux.com\/jspp\/blog\/wp-content\/uploads\/2017\/03\/tiled-map-editor.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.onux.com\/jspp\/blog\/wp-content\/uploads\/2017\/03\/tiled-map-editor.png\" alt=\"Tiled Map Editor\" width=\"320\" height=\"319\" class=\"alignnone size-full wp-image-225\" \/><\/a><\/p>\n<p>The included sample for Tiled can be found in the &#8216;Samples\/Classes\/tiled-loader&#8217; directory with JS++ 0.5.0. Currently, it will load all maps exported to JSON with orthogonal tiles. It&#8217;s just a small but powerful example of what you can start doing with JS++ for early adopters.<\/p>\n<p>I am also happy to inform that the backend for the JS++ website is <a href=\"https:\/\/www.onux.com\/jspp\/blog\/website-backend-now-powered-by-jspp\/\">written completely in JS++<\/a>, and it has now run stable for one week without a single crash or error (other than 404 errors).<\/p>\n<p>Finally, we have made the decision to <em>not<\/em> include the <a href=\"https:\/\/www.onux.com\/jspp\/blog\/mac-linux-installer-coming-for-js-0-5\/\">Mac\/Linux installer<\/a>&#8230; yet.<\/p>\n<p>Be sure to check out the <a href=\"https:\/\/docs.onux.com\/en-US\/Developers\/JavaScript-PP\/Language\/Reference\/Statements\/class\">documentation on the &#8216;class&#8217; keyword<\/a> to get up to speed on JS++ classes.<\/p>\n<p>Download JS++ 0.5.0 from our home page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JS++ now supports the &#8216;class&#8217; keyword. As promised, we would have classes available by Q1 2017. Notably, we are providing &#8220;basic&#8221; classes, so the following features are supported: &#8216;class&#8217; keyword Inheritance Constructors (including private\/protected constructors that limit instantiation\/inheritance) Static Constructors Instantiation Fields Methods &#8216;this&#8217; keyword &#8216;super&#8217; keyword Method Overloading Constructor Overloading Getters and Setters (via &hellip; <a href=\"https:\/\/www.onux.com\/jspp\/blog\/js-0-5-0-basic-classes\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;JS++ 0.5.0: Basic Classes&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/posts\/224"}],"collection":[{"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/comments?post=224"}],"version-history":[{"count":10,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/posts\/224\/revisions"}],"predecessor-version":[{"id":235,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/posts\/224\/revisions\/235"}],"wp:attachment":[{"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/media?parent=224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/categories?post=224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/tags?post=224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}