Blog about development using Corona

If you are interested, I have been posting my experience learning Corona/Lua, while developing my first iPhone app. There you will find a honest view of my learning/development process. Hope you enjoy!

blog: http://www.asouza.com
twitter: @alexandres

Thanks,
Alex [import]uid: 4883 topic_id: 906 reply_id: 300906[/import]

Hi,

Thanks for the info. You said in your blog that you had to writw a function to count how many items a table has. How about this:

Count = #yourtable

The # infront of a table identifier returns the number of table items. This is basic lua functionality.
[import]uid: 5712 topic_id: 906 reply_id: 2100[/import]

Yah, I found a lot of your blog to be pretty negative.

The documentation for Corona is good stuff (especially in comparison to a lot of other packages).

There are a bunch of sample applications provided and example code here on the forums.

Google has plenty of lua examples.

The Blue Programming in Lua is up-to-date with the latest stable release of Lua (not behind as you seem to indicate)… you just have to buy it. The API doc for lua 5.1 is free and up-to-date.

Some parts of lua are indeed not available for any number of reasons. The case you point out of dofile, I imagine this is not included as it could easily be a security risk since you can arbitrarily execute code. Aside from dynamically generated code, I’m not sure I see the benefit of dofile anyway… at least nothing that can’t be easily handled via encapsulation.

Overall, it just really feels like you haven’t done your homework in terms of learning Lua and you seem to project that because Ansca hasn’t implemented everything you desire, that this is a crappy system.

Corona is very graphics oriented, anyone should be able to pick that up after looking through the API. If you’re looking for something to make a “forms” type App, then you should be utilizing Appcelerator or any number of other toolkits. I’d be very interested in your appraisal of Appcelerator’s documentation in comparison to Corona’s (lol – Appcelerator’s is a joke… that said, the toolkit is very nice for forms apps).

In the end, Corona is a young toolkit. Your expectations are, IMO, simply too much, too fast. Sure it’d be great to have all the stuff you list and I’m quite sure it’ll be there in the future, but building a toolkit like this isn’t just a simple little exercise.

I strongly recommend you stop working on your current project, buy the blue PiL, and *learn* the Lua language. It’s a good book and it’s easy reading with good examples and tutorials. Lua itself is an easy language to master because of it’s simplicity. Once you understand how it works, you’ll truly see how powerful it is.

Scott [import]uid: 5659 topic_id: 906 reply_id: 2104[/import]

Scott,

thanks a lot for your reply. Let me try to clarify some things here. My blog is just sharing my experiences trying to learn Lua and Corona at the same time. I am not a professional developer and I think this is a good start to people like me, trying to figure out how easy is to create apps for iPhone using Ansca SDK.

When I mentioned Corona documentation is far from well documented, I was clearly comparing with documentation provided by Apple or event the PHP.org website, for example. Of course there is good content in Corona’s sample but, again in the view of a non-Lua developer, the documents could have much more info and examples.

Sure a search on the web will bring Lua results but, have you compared this against other languages? For your info, I learned PHP, Dreamweaver and Google Maps/Javascript in less than a month (trial time of Dreamweaver) just using a book and the web examples to build a pretty complex site (www.ppgplaces.com). Why was I successful? Because the amount of examples available and an amazing book with samples. Lua/Corona are not there yet. This is a fact.

About the blue book on Lua. This was the first thing I bought and read. The book (mine is 2nd edition) can be used as a reference for sure (although some of the sample codes are different in the live site) but it is not enough to help a beginner to create complex applications (and besides I think the language used was confuse - but this is just a personal opinion).

Thanks to people like you, I am getting more knowledge and confidence using the language. The dofile limitation, for example, was mentioned because it is available in the book as sample, but didn’t run in Corona. Again, as a beginner, I would love to have this mentioned in Corona’s documentation (like a table with non-applicable functions).

I am evaluating Appcelerator too (and maybe it should be a best bet here). My decision in to start with Corona was based on a hybrid app that I am planning to develop. It will need good graphics tools but also “forms” like feature. Also, Corona seems to be easier to code for me, considering my experience as Lingo developer. Agree with you that Appcelerator documentation are much worse than Corona but, their KitchenSink and Snapost apps are a good way to learn to code. I would love to have something like KitchenSink from Ansca.

I understand the huge challenge of write a SDK but you have to admit that Ansca could be more clear in some answers. There are several postings here where their team mentions that request/feature A or B will be implemented soon and the “soon” never happened.

I will keep my learning process and I hope to continue to learn even more from the community.

To end, just a reminder that my blog is not an official statement about Corona or Lua, it is just another opinion, based on my limited experience with the tools, which I clearly stated there.

Again thanks a lot for your feedback!
Alex [import]uid: 4883 topic_id: 906 reply_id: 2110[/import]

Mike,

Thanks a lot for this tip! Do you recommend any other good source of info about Lua?
Alex [import]uid: 4883 topic_id: 906 reply_id: 2111[/import]

That’s kind of what I was hinting at… that tidbit about the length of tables is straight out of the chapter on tables in the blue PiL. There’s about 2 pages of examples using it and talking about how things are counted. The length operator (#), getn, and maxn.

Scott [import]uid: 5659 topic_id: 906 reply_id: 2112[/import]

Yeah I would say the Corona docs are not fully featured but then neither are Apple’s. Both expect you to know the language you are required to code in.

It took a couple of weeks to completely pick up lua and Corona but after that its all good.

What I did struggle with the most was an easy way to include files (dofile, require etc…) but after a lot of experimentation I ended up using the exact same way as Ansca do to include their ui.lua, sprite.lua etc…

I would recommend for bigger projects that you separate the application into similar parts.

For example I have one called accelerometer.lua
in there there are numerous functions some local which work out orientation, x / y acceleration etc…, some local variables to store current orientation, x / y acceleration etc…

Then I have function called getOrentation() which any part of my app can call to get the current loop’s orientation, one called setListener(), one called removeListener() etc…

I find once you structure the app like that you can keep each element of the app in a separate lua file [import]uid: 5354 topic_id: 906 reply_id: 2384[/import]