Making Codea even more noob friendly

Hey TLL guys,

I am learning programming from absolute zero knowledge and am using Codea and lua as my starting points. I picked it up a few days ago and so far, it’s fantastic. The in-app examples are good and varied and the Codea reference is also handy.

There are a couple of things that I would find handy that I will list below. I apologise if these have been covered before, I had a quick look in the forums but maybe it was just a boys’ look.

• Auto formatting — to teach me what tidy code should look like. Things like detecting where an ‘end’ should be tabbed and automatically tabbing it to the right spot if I didn’t place it correctly. Or adding a space after the comma in-between colour values etc.

• Auto complete — Perhaps extending the auto-complete to include functions and parameters that I’ve already declared/defined to ensure I always have the same spelling (which helps avoid errors). Auto complete could be taken to the next level by ending functions for you, in a similar way to parenthesis are placed closed, with the cursor in between. That is an awesome feature. It may be hard to strike a balance that helps the noob but doesn’t hinder a pro, but I’m sure you guys can find it.

• An easier way to undo — I find myself making many mistakes and using the undo via shaking the device, or the undo on the keyboard is a little tedious. I certainly wouldn’t want unnecessary screen real estate being taken up but perhaps there’s an elegant solution?

• Adding to the reference guide to explaining the functions of things like “then”, “if”, “do”, and some other basic commands (or whatever the correct terminology is!). Maybe it’s just a cheat sheet of how they have to be laid out with the correct syntax. Maybe it’s already in there and I’ve missed it.

• In the reference guide, would it be possible to tap a line/chunk of code, which would copy it to the clipboard so I can paste it directly into my project. It could really help noobs and speed up workflow, instead of having to open the reference up all the time to check word for word.

• More tutorials — Easier said than done, I know. The several you had on your site were amazing for someone like me, who knows literally nothing about programming. A few more that ramped up to a secondary level would do wonders. I’m using Google (and for general lua tutorials but find they’re not so friendly explaining WHY you do something and how it relates.

That’s all I can think of at the top of my head. I’m loving what Codea is right now, and I can’t wait to see where it goes in the future.

Cheers. :slight_smile:

I would like to add-on to this thread for ease of reference. My noob question/request is whether someone in simple terms could explain how to get your working app designed in Codea exported from the iPad to an iPhone. I do not mean an app that is ready for the app store. I just want to show my working app on an iPhone without going through all of the steps required for getting an app submitted in the app store. I know I can do visual simulations using the simulator, but I want to see it running on an actual iPhone. Thanks for any suggestions to this question and any of the others from the OP.

@JeffHertz you will need an Apple developer license to compile for an actual device. This will let you compile your Xcode Codea project and run it on a real iPhone

@BattleCat very nice suggestions. Thank you for your clarity of writing and insight.

  • Auto formatting — this is harder than it sounds. Lua is quite a dynamic language, so the correct formatting may not be possible to determine in all cases. However we can certainly attempt some more naïve tidy-up algorithm.

  • Auto-complete — adding function and parameter completion is a great idea. It would be much appreciated if you could add this to the issue tracker as it will remind me to work on it. (Link in the forum header.)

  • An easier way to undo — agreed. Undo needs to be improved, and a proper button added to the input bar.

  • In the reference guide — I suspect we will need to re-write the reference guide so that it doesn’t use a web view, which is slow, clunky and doesn’t allow copy and paste. We may be able to find an interim solution by injecting javascript callbacks. I’ll have to consider what’s best.

  • More tutorials — I would like to find the time to do this, but at the moment users like @Reefwing are providing some quality tutorials and help.

@Simeon perhaps if said “noob-friendliness” (to use said coined term) could be toggled on or off at will? Like maybe in an option panel or in the ipad’s settings menu.

Its just that Ive done some coding on the included notepad. You know the one that comes with the ipad simply called Notes.

Its been my experience with the auto-correct spelling feature on? It often times will highlight my correct syntax take vec3 for instance and then when I go to space? Never fail it deletes it?

Special care should be taken Simeon with correct spelling some words don’t need to be corrected. I think context needs to be taken into consideration as well as correct syntax.

@Simeon try coding in ipad’s Notes with all Auto-options on and I think you’ll see what pitfalls to avoid in implementing such auto-features.

@Orso, I agree. The noob friendly features wouldn’t want to interfere with an experienced programmer. That’s the last thing I would want to see happen.

Instead of an autocorrect feature in terms of what we’re used to on other Apple devices, to be more accurate, I mean something that corrects formatting and suggests when something is wrong without correcting it, just like what it already does with the suggestions above the keyboard as you are typing.

@Simeon, I would rather see small steps to improving it then a potential large one and alienating the more experienced programmers, for sure.

As an add-on to this discussion. I noticed the advanced programmers will often recommend, “try using a mesh. It would speed up your code.” Many beginners may be unfamiliar with meshes. Personally, I’ve used meshes in 3D Studio and other 3-dimensional programs, so I understand triangles and vertices. Yet, I’m still unsure how to use them in a 2-D application. The forum discussions make it appear as if converting your program to use meshes is a relatively easy task. Can someone write a tutorial that points out some of the needs, requirements, and lessons learned when using meshes?

@Ric_Esrey have a look at my code in the Sprites vs Meshes discussion for a demo of doing the equivalent thing with both sprites and meshes.

As a beginner sprites are great to use as they are easier - a single line as opposed to the 5 or 6 used for a mesh. I still often use sprites to test ideas before converting over to meshes to get the speed.

For a second demo of meshes, this time using a single sprite sheet image and looping through different regions to get animation then look at my code here ( it’s fairly well commented)

Thanks @West that was incredibly helpful. There’s about a factor of 10 speed difference. Do you have an idea of the maximum size sprite sheet you can use?

It will be constrained by the opengl limitations. According to @Simeon it is 2048 by 2048 pixels

By the way, I just found the Mesh tutorial (part 1) in the Codea tutorials section. I’m not certain if it was there the whole time and I just missed it. Anyway, It is excellent. Thanks to whomever put it together.

Hello @Ric_Esrey. The author of the mesh tutorial on the wiki was @Vega.