<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex &#8211; Software, Fitness, and Gaming &#8211; Jesse Warden</title>
	<atom:link href="https://jessewarden.com/category/flex/feed" rel="self" type="application/rss+xml" />
	<link>https://jessewarden.com</link>
	<description>Software &#124; Fitness &#124; Gaming</description>
	<lastBuildDate>Wed, 29 Jun 2016 01:54:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://jessewarden.com/wp-content/uploads/2016/08/cropped-Lambda2-32x32.png</url>
	<title>Flex &#8211; Software, Fitness, and Gaming &#8211; Jesse Warden</title>
	<link>https://jessewarden.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Fitness Progress in 2013</title>
		<link>https://jessewarden.com/2014/01/fitness-progress-in-2013.html</link>
					<comments>https://jessewarden.com/2014/01/fitness-progress-in-2013.html#comments</comments>
		
		<dc:creator><![CDATA[JesterXL]]></dc:creator>
		<pubDate>Wed, 01 Jan 2014 18:03:42 +0000</pubDate>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Health]]></category>
		<category><![CDATA[2013]]></category>
		<category><![CDATA[bodybeast]]></category>
		<category><![CDATA[bodybuilding]]></category>
		<category><![CDATA[bodyfat]]></category>
		<category><![CDATA[cardio]]></category>
		<category><![CDATA[diet]]></category>
		<category><![CDATA[fitness]]></category>
		<category><![CDATA[health]]></category>
		<category><![CDATA[p90x]]></category>
		<category><![CDATA[p90x2]]></category>
		<category><![CDATA[strengthtraining]]></category>
		<category><![CDATA[weightloss]]></category>
		<category><![CDATA[weighttraining]]></category>
		<category><![CDATA[workingout]]></category>
		<guid isPermaLink="false">http://jessewarden.com/?p=4453</guid>

					<description><![CDATA[2013 was a great year for me to learn more about fitness and health. I tried 3 specific diet changes: a caloric deficit, a vegetarian diet, and a caloric increase (bulk phase). Fitness wise I tried #P90X2 , #BodyBeast , and my own custom routine I put together from my own research. As you can [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>2013 was a great year for me to learn more about fitness and health. I tried 3 specific diet changes: a caloric deficit, a vegetarian diet, and a caloric increase (bulk phase). Fitness wise I tried #P90X2 , #BodyBeast , and my own custom routine I put together from my own research.</p>
<p><span id="more-4453"></span><a href="http://jessewarden.com/wp-content/uploads/2014/01/body-beast-angle-12.31.2013.jpg"><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-4460" src="http://jessewarden.com/wp-content/uploads/2014/01/body-beast-angle-12.31.2013.jpg" alt="body-beast-angle-12.31.2013" width="1235" height="1464" srcset="https://jessewarden.com/wp-content/uploads/2014/01/body-beast-angle-12.31.2013.jpg 1235w, https://jessewarden.com/wp-content/uploads/2014/01/body-beast-angle-12.31.2013-253x300.jpg 253w, https://jessewarden.com/wp-content/uploads/2014/01/body-beast-angle-12.31.2013-863x1024.jpg 863w" sizes="(max-width: 1235px) 100vw, 1235px" /></a></p>
<p>As you can see from the charts I lost a ton of fat and weight through P90X, but P90X2 really pushed me to the lowest body fat and weight I&#8217;ve ever been since in my teen years (I&#8217;m 34).</p>
<p><a href="http://jessewarden.com/wp-content/uploads/2014/01/body-fat-chart-1.png"><img decoding="async" class="aligncenter size-full wp-image-4456" src="http://jessewarden.com/wp-content/uploads/2014/01/body-fat-chart-1.png" alt="body-fat-chart-1" width="600" height="371" srcset="https://jessewarden.com/wp-content/uploads/2014/01/body-fat-chart-1.png 600w, https://jessewarden.com/wp-content/uploads/2014/01/body-fat-chart-1-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a></p>
<p>&nbsp;</p>
<p><a href="http://jessewarden.com/wp-content/uploads/2014/01/body-fat-chart-2.png"><img decoding="async" class="aligncenter size-full wp-image-4458" src="http://jessewarden.com/wp-content/uploads/2014/01/body-fat-chart-2.png" alt="body-fat-chart-2" width="600" height="371" srcset="https://jessewarden.com/wp-content/uploads/2014/01/body-fat-chart-2.png 600w, https://jessewarden.com/wp-content/uploads/2014/01/body-fat-chart-2-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a></p>
<p>Sadly, the caloric deficit, which consists of eating 500 to 300 calories less per day then you need was devastating to my muscle growth. The math isn&#8217;t perfect, since measuring body fat by averaging what the body fat scale and the fat calipers isn&#8217;t an exact science. That said, you can see on the spreadsheet I basically lost all the muscle in 3 months that took me 10 months to build by basically starving myself. So while the chart makes it look like a victory, 60% of the 15 lb weight loss was muscle vs. fat. It took me 6 hard months to slowly earn it back.</p>
<p><a href="http://jessewarden.com/wp-content/uploads/2014/01/Screen-Shot-2014-01-01-at-10.55.31-AM.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-4459" src="http://jessewarden.com/wp-content/uploads/2014/01/Screen-Shot-2014-01-01-at-10.55.31-AM.png" alt="Screen Shot 2014-01-01 at 10.55.31 AM" width="693" height="247" srcset="https://jessewarden.com/wp-content/uploads/2014/01/Screen-Shot-2014-01-01-at-10.55.31-AM.png 693w, https://jessewarden.com/wp-content/uploads/2014/01/Screen-Shot-2014-01-01-at-10.55.31-AM-300x106.png 300w" sizes="auto, (max-width: 693px) 100vw, 693px" /></a></p>
<p>So, while I like the way a vegetarian diet made me feel, I don&#8217;t think I want to go back to a caloric deficit as my body is quite sensitive to get into a catabolic state (burning muscle vs. fat).</p>
<p>Halfway through P90X2, during a 4 hour Minecraft session I damaged a nerve in my foot by sitting on it on a wooden chair. I got drop foot; basically I could press my right foot down on the ground, but not lift it up. This means I walked like a zombie by either dragging my foot or throwing my knee, but at least I could jump in PAP Lower&#8230; just landing became insanely dangerous. I head to wear a leg brace so I could walk. This lasted for 4 months and just magically got better one day. This forced me to do P90X2 using 1 foot. Erik Stolhanske of P90X1 Plyometrics and Broken Lizard fame, who completed P90X with 1 leg, gave me inspiration to go on.</p>
<p>Now that I saw how low I could go, I decided to go the other way and see how big I could get through body building.</p>
<p>Body Beast just wore me out. I couldn&#8217;t do my own cardio or yoga on the side; my entire energy was devoted to just doing my best the entire 30 to 50 minutes. They have many high rep progressive sets, and even her majesty could see the physical change in just my face on the 1 week I rested. It clearly exhausted me, but I DID manage to gain almost 6 pounds of muscle so that was awesome. I also learned better form for a lot of moves I sucked at.</p>
<p>However, everything I read said lower reps, compound movements, and more rest. So I built a custom routine, borrowing some moves from Body Beast, some from P90X1 and 2, some from pictures/blogs/YouTube videos I found online, and some in the books I read. I did my own build, bulk, and cut phases over the course of 90 days. I ate till I was about to puke during the bulk phase. The 2 weeks I tracked it on myfitnesspal.com I was getting nearly 3,700 calories a day.</p>
<p>Doing my own cut phase was rough. I didn&#8217;t really plan for a reduced routine with increased cardio so basically just worked out for 1 hour and 30 minutes 3 days of the week, and then 1 hour for the rest of the shorter routines. I managed to shed some fat while maintaining my weight which was awesome, but challenging. I failed to do the 50% protein diet merely because I just don&#8217;t know enough recipes and got bored eating chicken, beans, brown rice, quinoa, salmon, and yogurt all the time.</p>
<p>Muscle wise, though, I came out on top, undoing the damage my caloric deficit created. I hope to try intermittent fasting and a heavy protein diet this year to see what they do.</p>
<p>Exercise and diet are just like programming: Tons to learn, tons to try and experiment with, and the more I do it the easier it gets to learn more. I&#8217;m happy with my results. Breaking my chest plateau this year proved I can break my bicep plateau as well if I just work hard.</p>
<p>I&#8217;m happy with the results of my hard work. I hope you reach your diet and fitness goals for 2014. Happy New Year, y&#8217;all!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jessewarden.com/2014/01/fitness-progress-in-2013.html/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Some Notes To Consider on the Technical Difficulties with Healthcare.gov</title>
		<link>https://jessewarden.com/2013/10/some-notes-to-consider-on-the-technical-difficulties-with-healthcare-gov.html</link>
					<comments>https://jessewarden.com/2013/10/some-notes-to-consider-on-the-technical-difficulties-with-healthcare-gov.html#comments</comments>
		
		<dc:creator><![CDATA[JesterXL]]></dc:creator>
		<pubDate>Tue, 22 Oct 2013 21:05:23 +0000</pubDate>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[aca]]></category>
		<category><![CDATA[consulting]]></category>
		<category><![CDATA[healthcare]]></category>
		<category><![CDATA[healthcare.gov]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technicaldebt]]></category>
		<category><![CDATA[websites]]></category>
		<guid isPermaLink="false">http://jessewarden.com/?p=4426</guid>

					<description><![CDATA[I&#8217;m not involved. I am not saying I&#8217;m for/against ACA. That said, a few things I&#8217;ve gleaned from a few of the technical views on the internet that weren&#8217;t from a higher profile source such as the NY Times: http://www.nytimes.com/2013/10/21/us/insurance-site-seen-needing-weeks-to-fix.html First, when management says &#8220;a few weeks&#8221;, what that really means is a few months. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m not involved. I am not saying I&#8217;m for/against ACA. That said, a few things I&#8217;ve gleaned from a few of the technical views on the internet that weren&#8217;t from a higher profile source such as the NY Times:</p>
<p><a href="http://www.nytimes.com/2013/10/21/us/insurance-site-seen-needing-weeks-to-fix.html" rel="nofollow">http://www.nytimes.com/2013/10/21/us/insurance-site-seen-needing-weeks-to-fix.html</a></p>
<p><span id="more-4426"></span>First, when management says &#8220;a few weeks&#8221;, what that really means is a few months. Yes, months.</p>
<p>Second, because it&#8217;s so big with many of the parts not under the purview of the contractor, they can&#8217;t rewrite it. That means, it&#8217;ll take 2 times or more longer.</p>
<p>Third, bringing on additional contractors/people will not help fix the problem. There was a book written in the 1970&#8217;s called the Mythical Man Month that debunked the claim that adding more programmers will make things get done faster. It causes the opposite. See Slate&#8217;s coverage here:Â <a href="http://www.slate.com/blogs/moneybox/2013/10/21/obamacare_and_the_mythical_man_month.html" rel="nofollow">http://www.slate.com/blogs/moneybox/2013/10/21/obamacare_and_the_mythical_man_month.html</a></p>
<p>Fourth, launching a site before it&#8217;s fully tested is fine and encouraged. Software, currently, has no fool proof way to detect for all problems. There are certainly languages and programming techniques some mathematicians can use, but that&#8217;s not the tools the private sector uses to build web sites.</p>
<p>Fifth, even if fixed, it&#8217;s clear the parties they&#8217;re responsible for connecting to for customer data are a huge component and huge part of the problem such as the Centers for Medicare and Medicaid Services. Since they are not under the direct control of CGI Federal, the contractor originally responsible to buildÂ <a href="http://healthcare.gov/" rel="nofollow">healthcare.gov</a>, there is only so much you can do to compensate for someone else&#8217; incompetence &amp; lack of communication. Meaning, holding CGI solely responsible unfortunately is not an option. It&#8217;d be easy to blame CGI for the failings, but that&#8217;s not how software, and our bloated government, work.</p>
<p>Sixth, 8 out of 10 software projects are failures, and 9 out of 10 are perceived as failures. Software is hard. We do it not because it&#8217;s a lottery, but because when it works it makes a huge difference despite the huge assurance we&#8217;ll fail.</p>
<p>Things will slowly improve. There will continue to be glitches, some of which the press may even talk about, a year from now. Jan 1st deadline is unrealistic.</p>
<p>&#8230; and for those who are curious about what just 6 million lines of code can do vs. 500 million, check it:Â <a href="http://arstechnica.com/information-technology/2013/10/the-navys-newest-warship-is-powered-by-linux/" rel="nofollow">http://arstechnica.com/information-technology/2013/10/the-navys-newest-warship-is-powered-by-linux/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://jessewarden.com/2013/10/some-notes-to-consider-on-the-technical-difficulties-with-healthcare-gov.html/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>30 Minutes With Ember</title>
		<link>https://jessewarden.com/2013/07/30-minutes-with-ember.html</link>
		
		<dc:creator><![CDATA[JesterXL]]></dc:creator>
		<pubDate>Fri, 12 Jul 2013 14:59:53 +0000</pubDate>
				<category><![CDATA[Flex]]></category>
		<guid isPermaLink="false">http://jessewarden.com/?p=4300</guid>

					<description><![CDATA[I looked at EmberJS yesterday again because 2 leads recently were requesting it. It had been over a year since I looked at it before&#8230; or like 3 months before Google started backing Angular. In my business, my tech choice(s) are dictated by my clients and/or hiring firm. From a 30,000ft view, it&#8217;s just like [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I looked at <a href="http://emberjs.com/">EmberJS</a> yesterday again because 2 leads recently were requesting it. It had been over a year since I looked at it before&#8230; or like 3 months before Google started backing <a href="http://angularjs.org/">Angular</a>. In my business, my tech choice(s) are dictated by my clients and/or hiring firm. From a 30,000ft view, it&#8217;s just like <a href="http://backbonejs.org/">Backbone</a> but with built-in integration with and embracement of <a href="http://handlebarsjs.com/">Handlebars</a> with more helper classes.</p>
<p><span id="more-4300"></span>For those who are intimidated by JavaScript MVC/application development frameworks, I assure you, the patterns are all same, and you&#8217;re just memorizing API&#8217;s with the option to adopt the development philosophies prescribed by those who you&#8217;re learning the framework from. As one of my business partners says regarding <a href="http://adobe.com/products/flex/">Flex</a> frameworks:</p>
<blockquote><p>&#8220;&#8230; Once you learn one, you know 80% of the rest.&#8221;</p></blockquote>
<p>I&#8217;m finding the same to be true regarding JavaScript frameworks with regards to API implementation. They may all include various different libraries, perceive where to put certain code differently, differing ways to handle modules, and differing HTML integration implementations. That said at the end of the day they all have Models, they all have some sort of data binding or events, they all have Controllers or Mediators that respond to your Views, they all have Views and/or View helper classes that manipulate the DOM for/with you, some form of Router to manage the URL in the browser for deep linking and/or state management, and some Service layer management classes (excluding Backbone which defers to <a href="http://jquery.com/">jQuery&#8217;s</a> ajax classes).</p>
<p>Although I prefer Angular, my current and past clients keep requesting Backbone, so it was surprising to hear 2 recently request Ember.</p>
<p>&#8230;that and everyone loves <a href="http://andymatthews.net/">Andy Matthews</a> and I was bored yesterday and didn&#8217;t want to do taxes.</p>
<p>I also like how prudent all of the tutorials and documentation glazes over scalability. One the one hand, it&#8217;s harmful because time and time again I&#8217;m asked &#8220;how to scale client-side JavaScript applications&#8221; and using a module/class loader like <a href="http://requirejs.org/">Require</a> is 50% the equation. The other 50% is all the normal software stuff you learn over the years that has nothing to do with language and tech stack (OOP, design patterns, refactoring, etc). On the other hand, this is why my peers and I keep getting hired. I know <a href="http://joelhooks.com/">Joel Hooks</a> and various others have written on various strategies from an honest perspective, but apparently it&#8217;s one of those things that you have to do and get vs. read and implement.</p>
<p>Anyway, it&#8217;s nice to see Ember is still around, and even with the site and documentation improvements, they are still way less intimidating for n00bs than Backbone.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Taking Corona SDK to the Next Level</title>
		<link>https://jessewarden.com/2013/07/taking-corona-sdk-to-the-next-level.html</link>
					<comments>https://jessewarden.com/2013/07/taking-corona-sdk-to-the-next-level.html#comments</comments>
		
		<dc:creator><![CDATA[JesterXL]]></dc:creator>
		<pubDate>Sun, 07 Jul 2013 22:40:35 +0000</pubDate>
				<category><![CDATA[Flex]]></category>
		<guid isPermaLink="false">http://jessewarden.com/?p=3604</guid>

					<description><![CDATA[tl;dr; There is a larger opportunity in cross platform mobile application development that Corona SDK is missing out on. To solve this, Corona needs to invest in a version 3, mobile OS specific mobile component/widget set, C# compiling down to Lua, and invest in a proper, official IDE. Introduction If I were given a few [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>tl;dr;</strong> There is a larger opportunity in cross platform mobile application development that Corona SDK is missing out on. To solve this, Corona needs to invest in a version 3, mobile OS specific mobile component/widget set, C# compiling down to Lua, and invest in a proper, official IDE.</p>
<p><strong>Introduction</strong></p>
<p>If I were given a few million dollars to mold <a href="http://coronalabs.com/">Corona</a> SDK into what I believe it needs to become, here&#8217;s what I&#8217;d do. In order of priority I&#8217;d focus specifically on building a component library, making a more stringent roadmap for the current API in Lua, and continually improving the existing workflow. All 3 will help increase Corona&#8217;s uptake by developers who specifically target &#8220;mobile first&#8221;, increase desire by those working in agencies who wish to have a quick way to target multiple device OS&#8217;, and most importantly broaden Corona&#8217;s ability to quickly iterate on mobile applications vs. the existing game focus.</p>
<p><span id="more-3604"></span><strong>Why Components?</strong></p>
<p>The existing <a href="https://github.com/coronalabs/framework-widgets">widget library</a> is too small to fully encompass the needs of serious mobile application developers. Much of the onus is put on developers to build both Android and iOS components, from scratch. For B2B clients, this reduces the capability of those pitching a quick crossÂ deviceÂ solution as much of the initial Time &amp; Materials contract must be devoted to building a component library that&#8217;sÂ iteratedÂ upon while developing the application. This also makes time estimations in a Fixed Bid challenging because you&#8217;re basically coding components <a href="http://en.wikipedia.org/wiki/You_aren't_gonna_need_it">YAGNI</a> style and too much risk is placed on accurate developer time estimations for component development that the client hasn&#8217;t seen yet. At this point, going native is more attractive because they already have these components, and then your only concerns are what devices are youÂ targetingÂ and what is the minimum OS version.</p>
<p>For product companies, this also provides a number of problems. For those wishing to offload as much work to the platform as possible, they can&#8217;t. Google builds Android components, Apple builds iOS components, and 3rd parties fill the specialized gaps. For Corona, all 3 must beÂ solelyÂ owned by the actual company developing the product. This is a significant amount of time spent by the product company building the necessary tools to build their product vs. just building their product. For those looking for the quick pitch of their product via a paltry prototype, this lessens their desire/quick ability to do so.</p>
<p>The long term projections are worse since Google and Apple will be around awhile to support legacy components whereas for smaller companies, thisÂ maintenanceÂ burden is on them, some of which they cannot support without taking already strapped resources away from mission critical projects. Finding 3rd party contractors is also harder for a specialized tech with a specialized implementation.</p>
<p>Why use Corona to build mobile applications when you get iOS components for free and Android components for free, both with native speed, and professional tooling?</p>
<p>Why use Corona to build mobile applications when you could just use Twitter <a href="http://twitter.github.io/bootstrap/">Bootstrap</a>/<a href="http://jquerymobile.com/">jQuery mobile</a>/<a href="http://www.sencha.com/products/touch">Sencha Touch</a> + <a href="http://phonegap.com/">PhoneGap</a> and still retain a modicum of code re-use for the mobile website, and desktop website?</p>
<p>The key here is &#8220;speed&#8221;. A reasonable sized component library plays a critical role in ensuring that speed is a reality for service companies targeting B2B companies and Agencies bundling mobile applications alongside additional offerings.</p>
<p><strong>Why Lua API improvements?</strong></p>
<p>A consistent API is directly proportional to the learning curve, developer trust, and scalable growth of an SDK. If the API remains consistent, developers can learn new functionality with less effort. This includes existing functionality and new functionality added later. A lot of developers have trust issues with code they didn&#8217;t write, and for good reason. A consistent API makes it look well thought out, and a developer is more apt to build in the style on top of the API if its consistent. Finally, if you&#8217;ve built the API in such a way that the style allows new, and different, functionality to be added, you lessen the burden on your developers, and yourself.</p>
<p>Corona currently is about 60% there. That&#8217;s more than good enough, but I think they can do a lot better.</p>
<p><strong>Why Workflow?</strong></p>
<p>Even <a href="http://www.coronalabs.com/blog/2013/06/11/lunch-with-co-founder-of-id-software/">the creator of Doom recognizes</a> the extreme value of Corona&#8217;s insanely fast, simple, and iterative based workflow. However, it&#8217;s not 100% cohesive,Â especiallyÂ when you bring Enterprise into the mix and dealing with both multiple devices and multiple OS&#8217; through multiple code bases with a variety of build systems.</p>
<p>This is where &#8220;the death of a thousand cuts&#8221; can be turned into &#8220;it&#8217;s all the little things that count&#8221;. Nothing huge here, just a plethora of small improvements to make the whole better.</p>
<p><strong>Widgets, Components v3, and v4</strong></p>
<p>Corona already has a <a href="https://github.com/coronalabs/framework-widgets">version 2 widget library</a>. It&#8217;s on Github and you can add and fork to your hearts content. Part of the value was Corona Labs owned it, they provided the API direction, they &#8220;ate their own dog food&#8221; to help influence how the core Corona API would satisfy components, and this in turned helped dictate how their users built apps. There were 3 main problems.</p>
<p>First, the components aren&#8217;t thorough enough. To build applications, we need a true <a href="http://cdn.sencha.io/touch/sencha-touch-2.2.0/examples/kitchensink/index.html">library of components</a>; lots of them that allow us to easily satisfy the <a href="http://developer.android.com/design/get-started/principles.html">Android</a> and <a href="http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.html">iOS</a> Human User Experience Guidelines. While the B2B&#8217;s do not give a flip about the user, this can sometimes be life or death for the product companies. Additionally, building components either specific to a device OS or x-device are a time consuming endeavor. With a YAGNI focus, this makes it challenging to re-use across projects for the B2B&#8217;s. As previously mentioned, this also puts the development &amp; QA burden on the product companies.</p>
<p>Second, the v2 widgets are still being tested. We&#8217;ve all found minor bugs both visual and functional, and this is fine &amp; normal, but they need to be tight not just on the device, but on the simulator as well. The Mac vs. Windows simulators being different is a burden on developers. The engineering effort involved on just the simulators alone must not be overlooked. Flash and HTML got a free ticket because the runtime engines wereÂ similarÂ on device and desktop whereas native solutions have to build itÂ themselves. Google and Apple have epic resources compared to Corona Labs. I get devoting resources here isn&#8217;t something to take lightly, but when developers spend 60% of their day coding, 10% testing on actual devices, the other 30% is viewing/testing things in the simulator. Putting the burden of compensating forÂ differentÂ functionalityÂ betweenÂ Mac vs. PC may seem more prudent because it&#8217;s faster to iterate/compensate in Lua vs. native code&#8230; but that doesn&#8217;t work long term.</p>
<p>Third, theÂ widgetsÂ are beholden to the current Corona API. There are a ton of lifecycle events and base classes needed to truly build an effective, abstracted component library for developers. Corona currently doesn&#8217;t have them. That is why I&#8217;ve broken out the Component Roadmap into 2 phases; same API, but different internals. One for the current implementation as Corona stands today, and 1 based on future API&#8217;s which I outline in more detail in the Lua improvements section. The v4 component lifecycle is not included in this epic post, but if you combine ECMA 6 proposals, non-IE event models, and as simple as possible component API&#8217;s that include Model support, you get what you&#8217;ll need lifecycle event wise which Corona currently doesn&#8217;t have.</p>
<p><strong>Widgets v3</strong></p>
<p>The current widget v2 library is good. We need a thorough v3 written from the ground up Â that supports:</p>
<ol>
<li>a common API</li>
<li>built-in collections/models</li>
<li>a common event model</li>
<li>built-in &amp; abstracted invalidation</li>
<li>a networking/RPC wrapper</li>
<li>a thorough set of visual GUI components, x-device</li>
<li>a simple styling model, whether CSS or code based</li>
<li>a set of utility functions for common GUI development (events, collection decoration, field validation, formatters, etc.), some of which will go away as native equivalents are created in the future</li>
<li>a concerted effort to build specifically for the OS vs. 1 component that adapts to the OS</li>
<li>a built-in MVC framework</li>
<li>unit &amp; functional tests framework</li>
</ol>
<p>I personally don&#8217;t feel v3 should be open sourced as this causesÂ unnecessaryÂ overheadÂ initially. Later when it&#8217;s mature and v4 is on the horizon, sure. The actual source code itself, however, yes, should be accessible for developers to debug, learn, and extend.</p>
<p>It&#8217;s assumed theÂ componentsÂ will be coded in the Lua 5.2 module syntax which is backwardsÂ compatibleÂ with 5.1. It&#8217;s also assumed as much abstraction as possible is done internally to ensure any native API&#8217;s areÂ seamlesslyÂ integrated in the future (i.e. Scale 9, built-in invalidation, etc).</p>
<p>Finally, there needs to be a white paper describing component code best practices thatÂ confidentlyÂ asserts this is Corona&#8217;s suggested way of coding. That sends a message and helps mildly coral the developer populace.</p>
<p><strong>v3 Common API</strong></p>
<p>This entails a standard way of engaging with Corona SDK components in that they all follow the same standards and conventions. These are documented in the white paper.</p>
<p>To utilize a component, you follow the Lua 5.2 module syntax:</p>
<pre lang="lua">local WidgetClass = require "widgetsv3.WidgetClass"
local instance = WidgetClass:new()</pre>
<p>The high-level conventions include setter methods and getter properties. Given the existing way of building classes &amp; modules in Corona without 3rd party library dependencies means you&#8217;re using either <a href="http://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html">closures</a> or <a href="http://johnlindquist.blogspot.com/2011/08/lua-metatable-tutorial_18.html">metatables</a>. I take a hardline stance against metatables. It makes the code harder to read &amp; follow, and is unnecessarilyÂ verbose for little gain.</p>
<p>Thus, the way to get properties is like so:</p>
<pre lang="lua">-- get the value
local theLabel = instance.label

-- set the value
local theAge = 21
theLabel = "Age: " .. tostring(theAge)
instance:setLabel(theLabel)</pre>
<p>Notice we follow dot syntax for getting, and colon syntax for setting to ensure scope is retained.</p>
<p><strong>v3 Collections</strong></p>
<p>To support Collections, Array&#8217;s that support filtering, sorting, and change events congruent with the <a href="http://en.wikipedia.org/wiki/Observer_pattern">Observer</a> pattern, any component which supports Collections also supports the same get/set syntax:</p>
<pre lang="lua">local Collection = require "widgetv3.model.Collection"
local List = require "widgetv3.view.List"
local people = Collection:new()
local myList = myList:setCollection(people)
local myListCollection = myList.collection</pre>
<p>The point here is people:addItem(somePersonVO) will automatically update the List view. Which leads to&#8230;</p>
<p><strong>v3 Event Model</strong></p>
<p>The existing eventÂ implementationÂ in Corona and associated widgets are great. However, there are 4 main issues that need to be addressed in v3. These are:</p>
<ol>
<li>adding event dispatching capabilities to tables that aren&#8217;t Display Objects (addEventListener vs. onSomeCallback=someFunction)</li>
<li>following a strict syntax model to add consistency to the too-flexible Lua</li>
<li>supporting a built-in event bubbling for Display Object non-native events</li>
<li>a common set of events for the built-in common ones typically used to ensure a consistent API</li>
</ol>
<p>For non-Display Objects, that&#8217;s easy (sort of), already have a class for it. This ensures the same API both for v3 and v4 when this is implemented natively.</p>
<p>For a strict syntax, basically to listen for events:</p>
<pre lang="lua">myList:addEventListener("itemTouched", myListener)</pre>
<p>While the function as the listener is a valid 2nd argument, most will be tables if you follow the white paper suggestions on coding syntax. No more listener in the constructor like v2:</p>
<pre lang="lua">local tableView = widget.newTableView
{
    top = 100,
    width = 320, 
    height = 366,
    maskFile = "assets/mask-320x366.png",
    listener = tableViewListener,
    onRowRender = onRowRender,
    onRowTouch = onRowTouch,
}</pre>
<p>Instead, you&#8217;d simply listen for it:</p>
<pre lang="lua">tableView:addEventListener("onRowRender", myListener)</pre>
<p>This includes event naming; v3 would use &#8220;rowRender&#8221; vs. &#8220;onRowRender&#8221;. This would be consistent upon all events, both native and component based.</p>
<p>The same goes for &#8220;callback&#8221; style events such as transition.to which allows you to pass a callback function/table for each tween instance (*ahem*&#8230; &#8220;id&#8221;, not instance) that is returned. That kind of functionality/syntax is gone. Instead, again, you go:</p>
<pre lang="lua">myTween:addEventListener("onComplete", myListener)</pre>
<p>You&#8217;ll notice, currently, transition does not support that kind of API, nor does transition return specific tween instances. Instead, it manages those internally and merely exposes numerical ID&#8217;s with which you can optionally track your own tweens and cancel them. This is where part of the component layer needs to abstract the existing Lua API, both for ease of use, and hope that when some of the native Lua API changes take place, the component API will remain the same but the performance will improve.</p>
<p>The network.setStatusListener has the same syntax to allow a terse, easy way to quickly verify multiple URL&#8217;s are reachable. The new syntax would, again, follow the standard:</p>
<pre lang="lua">local myListener = function(event)
   print("reachable:", event.isReachable)
end
network.addEventListener("networkStatus", myListener)</pre>
<p>This, also again, helps prevent yet another way to add and remove event listeners.</p>
<p>Another example includes Scale 9 and Scale 3 graphics, where you cut up a button&#8217;s image into 9 parts so it can scale vertically and horizontally while still looking nice. There is currently a significant amount of overhead having Lua do this vs. having it handled natively. If you keep the API &amp; workflow the same, the v4 transition for those who wish to update their applications should be seamless&#8230; or at least not very painful.</p>
<p>Event bubbling already takes place for many Corona events including tap, touch, and collisions. In fact, it&#8217;s actually up to the developer to stop propagation on purpose both for tap/touch visualÂ hierarchy and for collision propagation amongst physics objects. However, there are 2 problems when the developer wishes to do this themselves.</p>
<p>First, they have to manually bubble their own custom events, even if dispatched form a display object class. Second, they have to target re-acquisitionÂ as to what stage in the bubbling process the event is.</p>
<p>Frankly I don&#8217;t care about this 2nd part, but it doesn&#8217;tÂ reallyÂ follow the ECMA standard for event bubbling. Yes, I get I buried a reference to the ECMA Script standard in here&#8230; we&#8217;ll get to that more later as using ECMA 6 as a possible v4 language implementation vs. C# compiling down to Lua&#8230; which if you know anything about C# has its own event model way of doing things. The point is, the framework, currently, has the emulate it until the native API can handle it or offer an alternative.</p>
<p>Finally, standard events need to be implemented for all components to provide a common API. For example, when a component is shown and hidden, when it&#8217;s created for the first time and when it&#8217;s about to be destroyed. These lifecycle events are crucial for larger components together used via composition. This also includes &#8220;touch&#8221;, &#8220;change&#8221;, etc.</p>
<p><strong>v3 Invalidation</strong></p>
<p>I&#8217;ve talked a lot about <a href="http://jessewarden.com/2007/01/invalidation-strategies-for-flash-player.html">invalidation</a> in the past, but for those of you who are new to the concept, I&#8217;ll explain a bit about how it works and how it affects the current suggested implementation for v3 in Lua.</p>
<p>First, Corona for the most part draws one time per frame. This means if you do this:</p>
<pre lang="lua">myCircle.y = 100
myCircle.y = 200
myCircle.y = 300</pre>
<p>You will ONLY see the circle appear at a y position of 300. This is because Corona draws once per frame, based on the current frame rate of your application (which is either 30 or 60). That means, at most, you can draw 30 to 60 times a second.</p>
<p>This is both an optimization and feature; Corona takes the &#8220;latest&#8221; transformed visual properties if any, and draws them to the screen. That is an INSANELY complex process boiled down into 1 sentence. That&#8217;s great Corona does this. They may do some of their own invalidation internally to handle code like the above.</p>
<p>However, components often do more complex drawing than merely moving itself via changing its x and y properties. A button will change a text label, a list control will redraw a row, or a for could show/hide a section of content based on the current state of the data the user is editing. These changes will propagate; meaning the form will move a container which in turn does additional layout to item holding the label and text input, which in turn re-measures it&#8217;s internals based on abstracting native text fields which do not exist in Corona groups&#8230; etc.</p>
<p>As you can see, on larger applications, it is critical to ensure we don&#8217;t run a bunch of moving, sizing, measuring, or redraw code more than once per frame, else it&#8217;s pointless. When you have 3 components, fine. When you have 60, each running 3 complicated layout/redraw routines when only the last one is actually shown&#8230; this is a performance problem AND an API design one. There are rare cases where you need to force a redraw for measurement purposes, and that&#8217;s fine.</p>
<p>Invalidation fixes that. Or at least, lessens the damage from a scalability perspective.</p>
<p>There&#8217;s two more things invalidation helps, and those are race conditions and order of operation errors. I lumped them together because for GUI components they&#8217;re often related.</p>
<p>For example, a List control (another name for a <a href="http://docs.coronalabs.com/api/library/widget/newTableView.html">TableView</a>), could have 2 properties you could set that affect how the list draws, the collection and rowCount (how many rows are shown/drawn). Assuming you know how a list works, you go:</p>
<pre lang="lua">myList:setCollection(myBigOleCollection)
myList:setRowCount(4)</pre>
<p>Now, internally, you&#8217;d think the list would first setup itself in its internal constructor, draw the list contents upon getting the collection set, and finally redrawing or masking itself to respect the new rowCount value.</p>
<p>&#8230;but what if you went:</p>
<pre lang="lua">myList:setRowCount(4)
myList:setCollection(myBigOleCollection)</pre>
<p>Without invalidation, that&#8217;d either fail, or run some complicated internal code that wouldn&#8217;t scale well.</p>
<p>With invalidation, it&#8217;d run, and scale well.</p>
<p>Invalidation basically sets data immediately, but doesn&#8217;t actually draw it till 1 frame later.</p>
<p>For now, invalidation would follow the standard that <a href="http://adobe.com/products/flash">Flash</a> and <a href="http://adobe.com/products/flex">Flex</a> followed:</p>
<ol>
<li><span style="line-height: 16px;">&#8220;properties&#8221; are defined as getter/setter methods. They set an internal property with the same name prefixed with an underscore.</span></li>
<li>They also set a dirty flag to true and call &#8220;invalidateProperties&#8221;</li>
<li>invalidateProperties adds a listener for enterFrame.</li>
<li>1 frame later, the listener is removed, and commitProperties is run.</li>
<li>commitProperties checks for all dirty flags set to true and applies them in the order the developer sees fit.</li>
<li>If a dirty flag is already set to true, calling a setter again merely updates the value, it doesn&#8217;t actually affect redraw unless the developer wishes to override this behavior.</li>
</ol>
<p>Using enterFrame ensures we only ever call commitProperties once per frame, and thus all components only ever draw once per frame unless the developer specifically needs to for measurement purposes. In turn, these changes can propagate into child components ensuring composition redraw works as intended.</p>
<p>This gets really complicated with GPU acceleration and the <a href="http://www.coronalabs.com/blog/2013/06/04/corona-weekly-update-groups-and-containers/">Container</a> class&#8217;s built-in masking abilities, so as far as v3 is concerned, it&#8217;s suggested the developer will do as little composition as possible with regards to massive/frequent redraw.</p>
<p>Invalidation is only for GUI based controls.</p>
<p>I&#8217;ve included 2 Gist files that show the base <a href="https://gist.github.com/JesterXL/5943653">Component class</a> without any size invalidation (width and height + Container masking + measurement abstraction go beyond the scope of this article) and a TextField wrapper called <a href="https://gist.github.com/JesterXL/5943672">AutoSizeText</a>Â that uses component (the lack of text field object pooling also goes beyond the scope of this article, just focus on setText for now).</p>
<p><strong>RPC Library</strong></p>
<p>The networking 2.0 library is great and retains the same API as v1. However, even with such a high level abstraction, it is still pretty simple in terms of supporting common code written by client developers hitting REST based web services. Developers working rest back ends expect something at LEAST along the lines of what <a href="http://amplifyjs.com/">AmplifyJS</a>Â or <a href="http://jquery.com">jQuery</a> or even the Flex SDK offers with regards to a remote procedure call library. Borrowing ideas from iOS <a href="http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html">CoreData</a>, Flex SDK, and <a href="http://backbonejs.org/">Backbone&#8217;s</a> <a href="http://backbonejs.org/#Model">Model</a> internals helps give you some idea of the common things developer need to handle.</p>
<p>This includes:</p>
<ul>
<li><span style="line-height: 16px;">encoders for common request serialization into JSON, XML, and normal REST in addition to the existing text &amp; binary support (automatically parse Lua tables to the correct format for sending over the wire)</span></li>
<li>decoders for common response deserialization from JSON, XML, REST, and plain text in addition to the existing text &amp; binary support (automatically parse from text/binary to Lua tables what was sent over the wire)</li>
<li>custom error handling around the decoders that adds to the existing handling of event.isError and timeout</li>
<li>concurrency configuration support around the existing networkId: multiple, first, and last. (ex: if set to last, and you make 5 httpÂ requestsÂ on the same service, the first 4 will be cancelled).</li>
<li>a common &#8220;result&#8221; and &#8220;error&#8221; events vs. 1 which the developer is required to sort through. These are dispatched from a particular operation instance unless the developer uses the default RestService.</li>
</ul>
<p>This is not a small under-taking, but is pretty much the back-bone of any application which hits more than a few REST web services, even in a read-only fashion.</p>
<p><strong>Additional Widgets</strong></p>
<p>The Widgets v2 library had a philosophy about core, useful components that allow developers to use them for the more complicated components per device OS, and the rest they can build themselves.</p>
<p>v3 takes the stance of giving the developer zero reason to build device os components from scratch. Instead, they should be focusing on composition; ie, &#8220;building their application&#8221;. To optimize development, this also means no more flexible &#8220;1 size fits all&#8221; components. This also means the components will not just have to beÂ divviedÂ up by device os, but by type and market such as Table vs. Phone, Kindle vs. Nexus 7, etc. The process here needs to be pretty iterative to help determine the components being built are relevant for those projects not just being built, but &#8220;pitched&#8221;. Remember, larger clients say they care about design, but they don&#8217;t; at the end of the day, standard looking components supplied by Corona are good enough.</p>
<p>This last part is important for 2 reasons. Having mid to junior developers capable of mocking up workable &#8220;prototypes&#8221; for sales teams to help sell their ideas quickly leads to the &#8220;prototype is the product&#8221; problem for developers. Say what you want, but the sales team DID get the sale because of that. This in turn helps drive Corona as a repeatable platform for sales &amp; development.</p>
<p>The second reason is that those developers building custom components have the opportunity to contribute back. Again, I don&#8217;t feel open sourcing v3 is prudent, nor do I believe Corona Labs has the resources to manage such an endeavor. The point here is providing the core component API&#8217;s for those developers to follow so they can at best offer it as a pull request in the Github repo, or at least blog about it and others CAN use it within their Corona projects and have that code play nicely with the standard stuff.</p>
<p>The existing v2 skinning framework was great, but to help lessen the measurement/layout burden on the component developers at Corona, it should be coded for the specific OS they&#8217;reÂ targeting.</p>
<p>SOME form of styling needs to be implemented. I don&#8217;t like using CSS either when skinning suffices for 90% of non-agency projects, but for those developers who just want font, icon, and color changes you can&#8217;t beat the speed &amp; usefulness of CSS based styling. Yes, I realize this adds a significant amount of work, but again, we&#8217;re targeting momentum of the platform here in v3 to help garner feedback, enablement is a priority. Targeting is a gerund, why the heck does it have just 1 t?</p>
<p><strong>Utilities</strong></p>
<p>No component framework isÂ completeÂ without a suite of utilities. This includes formatters, validators (which can be used in the GUI layer as well as the Model one), externalized caching &amp; local storage. While most are abstracted away in their respective layer (like validators), it is still prudent to expose these for the developer for a few reasons, namely their productivity, custom integration, and easier for Corona Labs to integrate into the components if they design the actual API.</p>
<p>These are also the opportune area to take a lead role in abstracting away POTENTIAL (yes, potential, not ensured) future features. For example, abstracting away 9 scale and 3 scale graphics makes it easier to port and/or learn future API&#8217;s when it&#8217;s made native. Same goes for Bitwise operators, certain API&#8217;s that&#8217;ll turn into native plugins, and a variety of API&#8217;s I&#8217;d personally have to organize some of theÂ disparateÂ device querying API&#8217;s like system vs. native.</p>
<p><strong>Built in MVC</strong></p>
<p>If you want to create anÂ experimentalÂ application framework for the sake of learning how, what, and why users are building with your tech with room to pivot/iterateÂ later one, you release a component set. If you already know and just want them to succeed on larger endeavors, you do the same but include an MVC framework along side it. There are pro&#8217;s and con&#8217;s to each approach.</p>
<p>The cons to the component-only approach are people don&#8217;t take it seriously for larger scale development, it&#8217;s harder to sell to potential clients who haveÂ orneryÂ W2 space cadet architects at some larger enterprise, and you tend to attract less B2B clients. This last point is because most service companies let their clients usually dictate the tech. The pro&#8217;s, however, are you get a lot of flexibility to setting your next direction. Users always surprise you, and component directions can be widely different on your next iteration (somewhat likeÂ WidgetsÂ v1 and v2 are now). Additionally, you have a quicker time to market since you&#8217;re just focusing on a set of widgets, each delivered on a particular milestone release. You don&#8217;t have to release them all at once. Finally, those tinkerers you do attract the are the most likely to give you valuable feedback andÂ experimentÂ a lot with your tech.</p>
<p>The cons to the bundling of an MVC framework with associated classes is you&#8217;ll have a smaller market at first using it. These are typically a specific demographic, those building larger applications for media companies, but more usually banks, healthcare, and insurance. You also have to have a TON more man power for anÂ initiativeÂ that doesn&#8217;t include engineers. You have to include a sales person alongside a sales engineer. At first they can handle a few clients, but eventually, they&#8217;ll be spending most of their time with 1 or 2. You&#8217;ll then need some consultants to help implementation prototypes or help an existing team solve initial development challenges. They&#8217;ll usually be one unit with the 2 sales reps&#8230; next thing you know you have 3 such teams, each consisting of 4 people.Â This is not a scalable business model for a product company and yet it&#8217;s integral to get to that milestone of tech validity.</p>
<p>The other con is you exclude a segment of your market place who don&#8217;t &#8220;get it&#8221;. I feel like <a href="http://sencha.com">Sencha</a> has done a really good job here; you&#8217;ll have some of their users using a few components while others adopt the entire stack. The challenge to solve is how you market it, and how your evangelists balance those 2 demographics in their engagement.</p>
<p>Finally, the other con is time to market is significantly slowed. Everything is integrated and needs supporting classes. It&#8217;s a ton of code some of which may be temporary so you really need to spend the time architecting it right, iterating, and getting a close knit set of private alpha testers to provide feedback.</p>
<p>The pro&#8217;s, and hence the part of the point of this article, is that people can build scaleable applications on your tech right out of the gate and the larger companies take it seriously. The other pro is, you&#8217;ll start attracting those who don&#8217;t agree with your MVCÂ philosophyÂ  or they do, but it&#8217;s not good for their consulting business, so they build their own MVC framework. Both of these help validate your tech in the market place, as well as help sell it.</p>
<p><a href="http://jessewarden.com/2013/06/mvc-in-corona-via-robotlegs.html">I have one I&#8217;ve started</a>, but naturally I&#8217;d prefer if Corona did some market research to determine where on the MVC spectrum their customers lay so one could be built specifically for that market segment right out of the gate and let 3rd parties do their own flavors on top/alongside.</p>
<p><strong>Unit and Functional Tests</strong></p>
<p>I&#8217;ve read that Corona has their own unit testing suite internally, which is great. For components, however, it needs to be public for a few reasons. First, so architects take it seriously. Second, for those who build/extend/modify the framework into their ownÂ <a href="https://en.wikipedia.org/wiki/Continuous_integration">ContinuousÂ Integration</a> environments. Third, for the opportunity that the community can potentially find and fix missing/broken tests and add relevant ones as well as keep the existing ones up to date.</p>
<p>I don&#8217;t believe functional testing is required, BUT it would be a huge precedent in a later milestone release. Some of the larger automated testing tools like <a href="http://support.smartbear.com/articles/testcomplete/manager-overview/">SmartBear</a>, QT, and others that could integrate with the framework. You have to build this testability into the framework, more so than just making it unit testable. It&#8217;s a huge endeavor.</p>
<p><strong>Component Conclusions</strong></p>
<p>That handles the introductory component plan. Remember, v3 is an iteration on the existing Widget v2, but with a specific OS focus. The v4 is simply an iteration on top of v3&#8217;s foundation to provide a stepping stone for those developer evangelists in v3 to showcase v4. V4 runs atop the Lua and Workflow improvements mentioned below. The hope is the philosophy will be the same, as the API, but taking full advantage of improved native and Lua API&#8217;s to provide a more robust component framework. There isn&#8217;t really a need to cover v4 in detail because once you get v3, and see where Lua should go, you&#8217;ll see v4 is just a component framework with built in MVC on top of an improved/iterated Corona platform.</p>
<p>Why V4: To compete with native implementations from a cost perspective.</p>
<p>Isn&#8217;t that what Corona already provides? Not for larger application development, no.</p>
<p><strong>Lua Improvements</strong></p>
<p>There 2 main Lua improvements that have to happen in order for v3 to take off, for a good designer/developer workflow to flourish, and for a v4 to even happen. These are:</p>
<ol>
<li><span style="line-height: 16px;">API consistency</span></li>
<li>More robust programming language</li>
</ol>
<p>Without these, you&#8217;ll have continued slow growth, and lack of serious community investment to more serious application development atop Corona.</p>
<p><strong>API Consistency</strong></p>
<p>For the current incarnation of Lua, whether this is 5.1 or 5.2, many of the API consistency issues I&#8217;ve already mentioned above such as event syntax, but other things like a display.newLine&#8217;s stroke width using the &#8220;width&#8221; property whereas a display.newRect&#8217;s stroke width being a strokeWidth property.</p>
<p>The Corona team needs to take a breather, and do an architectural review from an API consistency perspective on their current SDK. Next, they need to publish these naming rules for those building atop it in the form of a white paper. This includes their native plugins. This can simply be a dot release, such as 2.1.</p>
<p>Lua&#8217;s actually worse than JavaScript with regards to &#8220;everyone doing their own thing&#8221;, which is remedied by taking a stand and dictating the standards.</p>
<p><strong>Another Language?</strong></p>
<p>The battle for robust vs. light, strong-typing vs. variant, etc. will continue to rage. Regardless of your opinions and inferences, the facts are those building applications in the Enterprise use robust languages to do so. While many use Python and Ruby and PHP just fine, if you want the guys who make the big money to invest in building mobile applications atop Corona SDK, and thus justifying to investors while you&#8217;re spending tons of your money on this break from the gaming philosophy that hasÂ primarilyÂ driven Corona SDK so far, you need some quarterly profits to show. You get those profits by providing an SDK people will actually use.</p>
<p>For those company demographics, Lua is not the gateway language to use. That&#8217;s Java, or even C#.</p>
<p><strong>Reflection and Dependency Injection</strong></p>
<p>A short note on reflection API&#8217;s. Right now, Lua&#8217;s support for language metadata is pretty horrible. Even if you stick with Lua 5.1, attempting to do runtime <a href="http://www.martinfowler.com/articles/injection.html">Dependency Injection</a> is pretty miserable. The package API&#8217;s were some kind of attempt that seems&#8230; unfinished? 5.2 doesn&#8217;t make it any better. You basically have to find a lexical parser to do runtime parsing of classes at runtime to handle the injection ofÂ dependenciesÂ with some convention on constructors. I only bring this up because if you say, &#8220;Of COURSE our platform supports Inversion of Control!&#8221;, you immediately set a lot of Enterprise Java devs mind at ease.</p>
<p><strong>InterpreterÂ Challenges</strong></p>
<p>Beyond the obvious advantage of Lua&#8217;s ease of integration with a variety of hardware and native code which forms the crux of Corona SDK&#8217;s value for mobile, you can&#8217;t easily just swap that out with another language.</p>
<p>You have 2 options here. The first is to bite the bullet, and pick one that provides a long term gain, such as Unity did with C#. The problem with Java &amp; Objective C is that segments a market. You imply you can &#8220;build cross platform apps using Objective C vs. just 1&#8221;, but that masks really what Corona does, both good and bad. So those 2 languages are out. While C# certainly appeals to the gaming &amp; Microsoft crowd, the Microsoft realm already has mobile solutions with their existing platforms, with a heavy Windows Phone bent.</p>
<p>The other option is create or use existing cross compilers so developers can use more robust languages, but still compile to Lua inÂ theÂ background. ThisÂ significantlyÂ lessensÂ the engineering effort, but increases the communication &amp; leadership requirements around the workflow initiative. Someone has to keep in sync the tooling, the existing SDK features, all the while trying to drive the languageÂ philosophyÂ IN FRONT OF thoseÂ initiativesÂ vs. behind. Rails was built on TOP OF Ruby, just like Django; those frameworksÂ espouseÂ the good in those languages. Without the language being fully baked, you have a starting timeline problem even on Day 1.</p>
<p>Worse, it could be incremental. Examples of those are <a href="http://www.typescriptlang.org/">TypeScript</a>, <a href="http://coffeescript.org/">CoffeeScript</a>, <a href="http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=Part2_AS2_LangRef_1.html">ActionScript 2</a>. ActionScript 2 was created in response to ActionScript 1 not being application developer friendly enough. It fixed a few things in the ECMA Script based language, notably JavaScript&#8217;s lack of super, but at the end of the day, still compiled down to a JavaScript &#8216;esque prototype based language. All compile time checking was runtime based, all classes, like TypeScript does as well, compiled to prototype based implementations for performance reasons (vs. closures), and all packages were name space based. AS2 effectively &#8220;bought&#8221; time for Macromedia to make ActionScript 3, the ideal (at the time anyway, before Haxe) <a href="http://net.tutsplus.com/articles/news/ecmascript-6-today/">ECMAScript 6</a> (known as 4 at the time, heh) based language. ThisÂ satisfiedÂ thoseÂ ornery, OOP craving Java Developers.</p>
<p>CoffeeScript sought to solve the lack of proper package, class, and built-in scope support for JavaScript. The lack of strong-typing and tooling really makes CoffeeScript less than ideal for those wishing for more support.</p>
<p>&#8230;which is what TypeScript satisfies AS WELL AS making ECMA Script 6 easier to use, today, vs. using Google&#8217;s <a href="https://code.google.com/p/traceur-compiler/">Tracer compiler</a>. The problem with TypeScript is that, currently, the only tooling support of significance is in (surprise surprise) <a href="http://www.microsoft.com/visualstudio/eng">Visual Studio</a>.</p>
<p>All of those languages open up problems with &#8220;why not just code native JavaScript?&#8221;. It&#8217;s a good point. Many large scale Sencha applications (most behind a firewall, lulz) are proof you CANÂ developÂ large scale, client-side applications, but the point here is SHOULD you? I mention client side since technically, for GUI reasons, client side code can be quite verbose to API style server-side offerings. If your code base is large, and science shows less lines of code is better, what is the happy medium?</p>
<p>Lua already cross compiles, but lacks the OOP constructs we need. No, Lua 5.2&#8217;s de-facto module approach is not enough.</p>
<p>One strategy could be have C# compile to Lua, another could be to just pivot and starting using C#. I don&#8217;t know enough about the current Lua community demographics to give an effective suggestion, but my gut says just use C# compiling down to Lua for v3 until v4 can be fully baked with it&#8230; or not. There are native speed ramifications that C# can offer, but the engineering effort is quite profound. :: flips a coin ::</p>
<p>Bottom line, Lua ain&#8217;t it, Java or C# is. ECMA 6 is out merely because it has a web bent. Corona, currently, doesn&#8217;t need the web developer demographic. Yes, sharing libraries and having Agencies whipping out crossÂ compiledÂ applications using Corona SDK vs. Appcelerator is great for initial growth and platform relevancy &amp; validation since Agencies are first movers, but that&#8217;s not theÂ demographicÂ we want. We want B2B consultancies and software shops. They ain&#8217;t going to jive with this Lua nonsense when building largerÂ initiatives.</p>
<p><strong>Workflow</strong></p>
<p>The workflow support, right now, is pretty harsh. <a href="http://www.youtube.com/watch?v=KAWQc7ZK05U">My ghetto setup with Sublime</a> and my colleagues support in testing various other implementations randomly found on Github is an indication of how much work there is to do.</p>
<p>Specifically, 3 things need to happen:</p>
<ol>
<li><span style="line-height: 16px;">We need an official IDE.</span></li>
<li>We need v3 and v4 Components to default to the viewport style scaling for applications.</li>
<li>We need on-device debugging.</li>
</ol>
<p><strong>IDE</strong></p>
<p>I don&#8217;t care what is chosen; <a href="http://www.eclipse.org/">Eclipse</a>, <a href="http://www.jetbrains.com/idea/">IntelliJ</a>, or even <a href="http://www.sublimetext.com/">Sublime</a>. Bottom line, we need intellisense &amp; code hinting/completion for both productivity and teaching the API, the ability to set breakpoints and step through code (even just forward as opposed to <a href="http://www.mydevelopersgames.com/Glider/">Lua Glider&#8217;s</a> backwards ability), and package/class/refactoring support. This includes the IDE&#8217;s ability to know what a class is so when we refactor it, it can change it, not just some &#8220;move&#8221; option. IntelliJ&#8217;s a good example for this, but ultimately anything that even copies 10% of Visual Studio is a win.</p>
<p>This includes v3 and/or v4 API&#8217;s. If a cross compilation is chosen, it needs to implement source maps to ensure theÂ compiledÂ code can re-map back to the the development code.</p>
<p>I personally prefer IntelliJ, but it&#8217;s slow as all get out on Mac. Eclipse is a stamp of acceptance from large companies, so I&#8217;dÂ reluctantlyÂ recommend it since you&#8217;d at least beÂ immediatelyÂ perceived as wearing a collared shirt and tie to get into the exclusive enterprise club from a development standpoint. This also spits in the face of the &#8220;immediacy&#8221; philosophy that Corona SDK currently has, so&#8230; I&#8217;ll just sit by and let Corona make the hard choices while IÂ critiqueÂ from afar.</p>
<p><strong>Viewport</strong></p>
<p>A quick note on Viewports. The existing Viewport options in Corona are confusing, and I&#8217;d argue all applications, not games, only need 1 option that can be a standard config.lua provided to all (yes, ALL) Corona SDK applications. They should draw to the size they have and allow Corona SDK to scale up based on the existing DPI.</p>
<p>Right now this topic is kind of &#8220;flexible&#8221; because each game is created differently, for different devices. Apps are not. There is a reason why responsive design took off in the web world: because it works both from a technical perspective, and from a business one. The implementation details are tons easier on Corona SDK, however, and this ability should beÂ capitalizedÂ on by further making it more simple: unknown to the developer so they only care about the DPI they areÂ targeting, period.</p>
<p>The existing Corona graphic support of high rez is great, it just needs supplementation with v3 abstracting this away, and the developers responsible for their own form/composition component layouts. To be clear, I&#8217;m not suggestion a point based system like iOS does, simply defaulting config.lua to a letterbox scale, a specific device size, and the v3 components will handle detecting the API unless one is set in the config.lua so it can scale accordingly.</p>
<p>The IDE should code gen this for you; developers should NOT be messing with this beyond project setup. Obviously it&#8217;d be nice to have more support in the simulator to know what DPI you&#8217;re really looking at. The amount of current Stage properties regarding with, height, and scaling are indicative of the current problem we have. <a href="http://getmoai.com/">Moai</a> style exposure of lower level size constructs are NOT a good thing and this is not congruent with Corona SDK&#8217;s ease of use &amp; development speed philosophy.</p>
<p><strong>On Device Debugging</strong></p>
<p>Not much to say here. The use case is I set a break point in the IDE, hit run, it launches on my connected device, and the IDE pauses the runtime on the current break point I set in the code. I can then step through the code and see the variable values.</p>
<p><strong>Conclusions</strong></p>
<p>As you can see, the above is a ton of work, and a multi-yearÂ initiativeÂ even assuming the capital investment is there. The justification is that the mobile industry has billions in growth, and with the death of Adobe AIR (death by no one caring because of Adobe&#8217;s &#8220;doubling down&#8221; on HTML5 vs. Flash in case I get ravaged in the comments), Corona is ripe to leverage it&#8217;s cross platform development and deployment runtime + growing plugin market place to really make some serious growth here.</p>
<p>One thing working with Corona the past 2 years has taught me is that there is always more to learn about our industry, not just by using another technical stack, but also another market segment at the same time, in this case gaming. In doing so, I&#8217;ve met a lot of new people who&#8217;ve taught me a lot I didn&#8217;t know about how products in this vertical work. Given that companies like EA have adopted Corona Enterprise as a vehicle for some of their offerings, it&#8217;d be strange to see Corona pivot and go enterprise app dev, opposite of the path Adobe took with the Flash platform. That said, the ground work is there, you just need 3 years, more investment, hard work&#8230; and some luck.</p>
<p>Speaking of which, I&#8217;ve spent over 2 years having fun with Corona in a hobby capacity, and <a href="http://jessewarden.com/2011/08/corona-has-momentum-but-does-it-have-money.html">haven&#8217;t made any money</a> on a platform I&#8217;ve invested so much time. I don&#8217;t mind since it&#8217;s been purely a hobby, fun, and a way to get out of my comfort zone (ie game dev vs. application dev). That said, this is not rose colored glasses talk. There is a great opportunity here, and I believe in the platform solving these mobile development problems. Companies are using the HTML stack on top of PhoneGap because they have to, not because they want to. That, and the innovation is going way too slowly for what we need. The simplicity of Corona combined with some API improvements, a solid component set, and a reasonable IDE are all we need, the above is just the ideal. This won&#8217;tÂ supplantÂ the existing competition; we&#8217;re already in a red ocean here. It WILL however, really create a lot of great opportunities for those wishing to build mobile applications faster and easier.</p>
<p>If you agree with the above, <a href="http://www.youtube.com/watch?v=duXJ_gy5wwk">bring the ruckus</a> on the <a href="http://forums.coronalabs.com/">Corona forums</a>. Let &#8217;em know this is valuable to what your company is building, wants to build&#8230; or is the complete opposite of what you believe Corona should focus on.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jessewarden.com/2013/07/taking-corona-sdk-to-the-next-level.html/feed</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>MVC in Corona via Robotlegs</title>
		<link>https://jessewarden.com/2013/06/mvc-in-corona-via-robotlegs.html</link>
					<comments>https://jessewarden.com/2013/06/mvc-in-corona-via-robotlegs.html#comments</comments>
		
		<dc:creator><![CDATA[JesterXL]]></dc:creator>
		<pubDate>Thu, 06 Jun 2013 00:03:19 +0000</pubDate>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[corona]]></category>
		<category><![CDATA[coronasdk]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[modelviewcontroller]]></category>
		<category><![CDATA[modelviewpresenter]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[mvp]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[responsivedesign]]></category>
		<category><![CDATA[robotlegs]]></category>
		<guid isPermaLink="false">http://jessewarden.com/?p=3560</guid>

					<description><![CDATA[I&#8217;ve recorded a new video series that goes over how to do Model View Controller development for medium to Enterprise mobile applications in Corona SDK via Robotlegs. It&#8217;s a popular framework from the Flash/Flex world that I&#8217;ve spent the last 2 years on and off porting from ActionScript 3 to Lua. It&#8217;s mature enough now [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve recorded a new video series that goes over how to do <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">Model View Controller</a> development for medium to Enterprise mobile applications in <a href="http://www.coronalabs.com/products/corona-sdk/">Corona SDK</a> via <a href="http://www.robotlegs.org/">Robotlegs</a>. It&#8217;s a popular framework from the Flash/Flex world that I&#8217;ve spent the last 2 years on and off porting from ActionScript 3 to Lua. It&#8217;s mature enough now that I can start actually recommending its usage, primarily to garner feedback for guiding it&#8217;s future implementation.</p>
<p>Additionally, I recorded a code walkthrough separately below. Code&#8217;s in the <a href="https://github.com/JesterXL/Robotlegs-for-Corona/tree/master/examples/cafe-townsend">Cafe Townsend</a> section in the <a href="https://github.com/JesterXL/Robotlegs-for-Corona">repo</a>.</p>
<p><iframe loading="lazy" src="http://www.youtube.com/embed/videoseries?list=PLZEZPz6HkCZkQk_jnPczqab-Vk7rZ7mLf" height="360" width="640" allowfullscreen="" frameborder="0"></iframe></p>
<p><iframe loading="lazy" src="http://www.youtube.com/embed/6MpuB654_hM" height="360" width="640" allowfullscreen="" frameborder="0"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://jessewarden.com/2013/06/mvc-in-corona-via-robotlegs.html/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
