Corona Editor, why Sublime?

Caleb, you are right.

I am biased toward IDE since I’m coming from coding java, objc-c etc. languages, where without proper IDE you are lost.

I do use versioning system, I do use debugger, I am working in a team so code merges are common.

I’m just wondering… why limit the possibilities so much for your developers, and instead of using an IDE, go with Sublime?

I understand Caleb, that you may not feel a need for an IDE, but have you actually tried using one? I’m just wondering, what would Sublime have, that someone couldn’t find in Idea.

Now that I look at my 1st post it looks pretty much like a rant… It just reflects my disappointment. 

I do agree that IDE’s are essential for low-level languages (I use XCode when coding in C++).

I have tried out using IDE’s (check out my original post’s edit), but still don’t feel the need for the extra features (I’ve never even used Corona’s command-line debugger before).

One of the things I love about Sublime is that it’s very lightweight. “Big” IDE’s like XCode, Corona Complete, CPM, or Glider (haven’t tried Idea) slow down my computer, while I can run Sublime (edit my code), the Corona Simulator/Terminal (run the code), and Chrome (discuss why I like Sublime :)) at the same time.

The only thing that’s not so good about Sublime IMO is that it’s $70. That’s a big issue, especially for a “freebie-lover” like me, but I’ve found that Sublime is entirely worth the price.

  • Caleb

Sublime Text is one of the most popular editors in the community.  It’s extensible.  You can have add in’s like Mercurial to do source control.  IDE’s tend to be bulky and slow.  

Sure, everyone would love for us to produce an IDE.  Maybe we could have gotten IntellJ working, but I don’t know much about that IDE.  I think I tried it once and quickly decided I didn’t like it.   Now I’m an old school person.  I still edit a lot in “vi” from the command line prompt.  I want something fast, where things like code completion doesn’t get in the way but enhances the product.  I need indentions to work correctly.  I need powerful search/replace features.

I have a ton of editors installed and in all honestly, I would live in Komodo Edit if it wasn’t so freakin’ slow.  TextWrangler is good for quick edits… I actually write my blog posts in it.  But of all the editors, and IDE’s I’ve tried, for Corona, Sublime is my editor of choice (not that I had any influence)

Something I like about Sublime is that I do other programming such as javascript, css and html5, and maybe a hint of php or what have you.  Sublime works for all those plus Corona so I was very happy when I saw the announcement of Corona Editor for Sublime.  

Right.

I think there’s my problem. Most of the Corona developers background, are languages like javascript, html, php, which are not really programming languages, but scripting languages. There are no real IDEs for them, thus you don’t have experience in those, thus you don’t feel the need for one. From that perspective IDEs do feel like bloated software. Don’t get me wrong, it’s not like there’s something wrong with that, we just have different needs. Right… I’ll just shut up about Sublime and get back to adding the only missing ingredient I need - debugging support in Idea - on my own :wink:

Yes, the debugging support would be great.  Actually I worked with Visual Studio for years - c# and VB.net,  and did like it quite a lot.  I also do native iOS development in xCode, so I currently work with that IDE as well.  I suppose if I could do all my development in Visual Studio for all languages and environments I would.  However, choosing between xCode and Sublime -  even though Sublime is “just an editor” - I’ll take it any day.   I think it is often simply how it feels to work in an environment.  Visual Studio felt great.  xCode doesn’t. Eclipse doesn’t. Sublime is really growing on me…

Yes… I HATE xcode… Thankfully there’s AppCode :slight_smile:

Once you get Sublime set up nicely and start utilising plugins I don’t think that for a language like Lua you really need much else that an IDE would provide:

http://net.tutsplus.com/tutorials/tools-and-tips/essential-sublime-text-2-plugins-and-extensions/

I came from five years of Java game development coding in Eclipse and a bit of Obj-C coding in xCode and since switching to Python, Lua and Javascript and Sublime I’ve really never looked back. For reference I use Tower as a git client, with Kaleidoscope as a diff/merge tool and a mix of Python/Applescripts + Alfred workflows and Fruitstrap to do the little automation I wanted. 

The only thing I’ve found myself missing were Eclipse’s refactoring tools, but I doubt they could be implemented for Lua; the language too flexible. If anyone finds some, let me know! 

In fact I can give this testament: recently when I did a little coding in Processing (Java) I used Sublime rather than Eclipse. It’s just become natural.

In case it helps here’s the Sublime Packages I’ve got installed:

Corona Editor, SublimeREPL, InactivePanes, Origami, LastModifiedIndicator, PackageControl, Pretty JSON, SublimeLinter, Themr, Emmet, SublimeXiki, Vintageous

Also thanks for tip on AppCode - I keep meaning to pick up Obj-C again, but have never really got on with xCode. 

tap32: thanks a lot for info and your list. I will definitely try that.

Because I don’t like when people whine about something they do not know, I’ve used Sublime for quite a few days exclusively.

What I missed most was proper code coloring, ability to click on a function to get to its definition and sense of working with few files instead of one [that’s kind of linked to the previous requirement: click on a variable to get to a definition in another file, or just LIST them when typing - I use constants a lot, and this kind of blows the whole point of using them if I have to go to another file to check the correct spelling/name].

Anyway… I will definitely try again with your plugins to see if my experience improves. For now, it looks like sailing against the wind.

Hi Krystian6, 

No problem, glad to help! I think code colouring should be there, if you set syntax to Corona SDK - Lua or Lua. Also regards definitions, Sublime 3 (beta) does have the GoTo Definition feature, which actually for the small project I’m currently working on is working far better than I expected (though for some reason the shortcut isn’t triggering…).

Here’s the example code:

File 1

[lua]

require “piece”

local p=piece.create()

board.moveTo(p,10)

[/lua]

File 2

[lua]

local M={}

piece=M

local display=display

setfenv(1,M)

function create()

  return display.newImage(“img/piece.png”)

end

return M

[/lua]

Selecting Go To Definition on create in File 1 is correctly taking me to the definition in File 2. I assume it’ll have to offer multiple choices once I start defining several create functions in different files (though I would be seriously impressed if it managed that).

In terms of getting a feel for Sublime, the following free course was a massive boon to me, and even after a year of development in it, it opened my eyes to new ways of working:

http://net.tutsplus.com/articles/news/perfect-workflow-in-sublime-text-free-course/

My 2 cents as well…

I looked at Sublime with the Corona plugin with a bit of interest, but as Krystian said above, I come from .NET, VB, Pascal, etc, and I prefer more of an IDE as opposed to a text editor. 

I think what Corona Labs is providing is great, but for me, I already had Glider, which has a debugger (I LOVE using the debugger over a bunch of print statements), accelerometer tools, code management features, and a bunch of other features I won’t go into, and it costs less than Sublime.  For quick text/Lua/etc editing, I use Notepad++.  I know there are a few other choices as well.

I guess, it is just another option, and if you like it, by all means, use it.  It does look pretty cool, and if I were just starting out, it would definitely be an option

I think if Corona Labs is going to have a “supported” editor, it ought to be an IDE, and included with the price tag when you buy the pro or enterprise versions. The free versions can work as they do today. 

I completely agree that an IDE brings more to the table than just text editing. The integrated revision control capabilities, built in debugger support, Corona SDK intellisense, etc. All these things come along with a decent IDE. Currently I use M.Y. Developers Lua Glider. I would love to see some kind of link up between Glider and Corona. Or if that isnt good enough, maybe start with some other system and really purify it for tight integration with Corona. Then you could do away with the stand alone corona simulator program and have it integrated with a proper IDE. This would take you a long way down the “complete solution” curve. 

For me, the important issues are:

1.) Tight debugger interop. Let me view variables, and breakpoint on lines of code set from within the editor. 

2.) Great text editor. I want syntax colors, highlights for errors, global checks, indentation, tabbed open files, etc. You know.

3.) project management - I want to have deploy targets that I can manage so I can have custom build.settings or config files. 

4.) I want a project/files listing like MS Developer Studio has (or LUA Glider). Shows all my files in the project including subdirs.

5.) Tight integration with GIT or Mercurial. This needs to work flawlessly and is easy to use all the time. So we will use it.

6.) Great differ tool built in. 

7.) Refactoring tools for big variable renames or function renames etc. 

So when you look at my very incomplete list of what standard IDEs can do for you, it seems Corona should consider starting with something like Eclipse or Netbeans or even work with somebody who has already made a cross platform IDE like M.Y. to get an agreement going. This would be the starting point that makes sense to me. 

Maybe Sublime is heading this direction. Maybe since Corona is making hay about this editor, they will contribute the additional code required to make it a more IDE-like solution. Its going to take a lot to make me stray from Lua Glider though. It may have some rough edges, but it certainly does fulfill most of my needs. 

I sincerely hope Corona Labs doesn’t head toward something based on Eclipse, Netbeans, etc. Just because you can develop games like it’s 1990 doesn’t mean you should. Seriously, there are so many options that speed up development time rather than an old-fashioned IDE that I would just cry if they did that.

Either “do it right” or don’t waste time on it. What is “right” in my book?

  • Visual editor that’s a first-class citizen. If I drag and drop asteroid.png into a scene I shouldn’t have to go in and also write the code for display.newImageRect(“asteroid.png”) - the IDE should handle that behind the scenes. But while the visual editor should be easy to use, there’s also…
     
  • …a marriage between visual and code editor that doesn’t force you to use both. So you can use display.newImageRect() to create an object if you want. Which makes it perfect for people just getting into game development but doesn’t handcuff the professional developer who is more code-focused.
     
  • An IDE where code you don’t care about is never seen. Example: all the housekeeping code for storyboard. Exactly the same code is used 99.7% of the time from project to project, so you should never have to see it. The IDE can keep track of it and generate it when you run the app, but you don’t have to look at it.

Go play with Construct2, Stencyl, or GameMaker Studio for examples of what can be done visually. Then take the general idea of that and integrate it with the code handling capabilities of the Xojo IDE and Corona SDK will turn into something that Unity 2D won’t be able to touch.

But just give us a freakin’ “Granddad’s IDE” and nothing will happen except a slow decline while state-of-the-art development environments take over.

If it sounds like I’m passionate about this, it’s because I am. I think Corona has the best language+API for mobile games right now but that’s not enough. It was a couple years ago, but it’s not anymore. Unity 2D is going to hit within weeks and I’m not sure the advantages Corona has will be enough to stop what could turn into a full-fledged thrashing.

 Jay

PS - Lest someone get the wrong idea, I have no intention of moving away from Corona SDK (at this point) as my “go to” framework. I have Platino and Unity video tutorials to create scheduled over the next couple months, but if you cut me I bleed orange.

I’m really happy with Sublime and Corona SDK. The advantage Sublime has, is that (probably like Eclipse) it’s very easy to write plugins for and has a thriving ecosystem of them.

Any tool you want, can probably be written for it if it doesn’t exist - version control integration (https://sublimegit.net/), REPLs (http://sublimerepl.readthedocs.org/en/latest/), weird code expansion (http://docs.emmet.io/) etc.

The downside of it is that you actually need to dig around a lot to realise that features exist. It took me ages to realise what the projects were for and how to use them effective. Frankly I’m pretty sure I’ve not really grasped all that they can be used for (different build settings, formatting options, lint configs etc.)

Regards all the calls for a more fully fledged IDE to be supported, I wonder whether it might make sense for Corona to support LuaEclipse too (http://luaeclipse.luaforge.net/manual.html#introduction)? Eclipse seems to be easy to write plugins for too, and would give everyone a heavy weight IDE to use.

Regards refactoring Lua code, are there any good tools that do that at the moment? I’ve not seen anything that’s not just equivalent to a find/replace.

Personally I’m not going to switch to an IDE, though I could be tempted by a visual editor (ala Unity) if I can edit scripts in my editor of choice. But for the most part, I find Unity just to complex to do what I want to do.

As someone who not only tried it, but put close to 60 hours in trying to make it something more akin to a regular IDE, I’ll have to say that I want so bad for Sublime to be the solution, but alas it’s not…for seasoned programmers.

While I think it will be great for those just starting up, as stated above, it’s missing some features so that if you’ve come from any kind of IDE background – “grandpa’s” or otherwise – you’re going to trip up on few things, and those few things are enough to slow down workflow, instead of increasing it.  No matter how cool the editor is, or how much I love Corona, it comes down to my workflow speed.  I can’t compromise on that.  I can’t spend a week trying to make it work better for me.  Those solutions already exist.  I’ve used LUA Glider for awhile, and while it’s bloated, it’s also got some awesome features like built-in history, etc.  To not have really tight auto-complete right out of the gate for Corona Editor has had me scratching my head since the announcement.  And it’s something I tried to correct in my build, but it’s still not perfect.

If you are using Sublime, I can point out a few helpful things:

  • Make sure “Corona Lua SDK” is selected under View->Syntax.  You need to check this for every new page.
  • You can navigate methods, etc by selecting Goto->Goto Symbol in Project (as mentioned above, where is the shortcut for that!?!)
  • Sublime “auto-complete” works better if you don’t use the period, and just type straight through (no dots) until it pops up.  (This is one of the major things I changed in the Coronium build.)

Again, I put a lot of time into making a more useful type-through as well as some other tid-bits, so you can check out the package if you’re interested.  I’m going to try and keep it updated if the need is there, and still going to see if anything can be merged with the main branch, but I’m hesitant to spend too much more time on it now that I’ve peeked under the hood and see the limitations, at least from an “IDE” perspective.

Like most things, options are good, so it’s nice to have Sublime as one of them.  But as far as being the supported editor, it seems to be a little premature at this stage, in both announcement and functionality.

Cheers.

+1 for simple text editor over IDE, it’s simply more suitable for Corona SDK development.

I much prefer TextMate but I can understand why you went with Sublime especially the lack of windows version for TextMate… 

Still, TextMate 2.0 is free and opensource and sublime is not expensive but for a product I like less I will not pay and I got the Corona add on for TextMate which adds some joice to it…

I think supporting a free editor would be a better option,

I think it quite depends on the project you have to manage and the size of your team.

BTW, using Intellij Idea [free] is extremely fast. Right, you have to start it, but once it is started, its speed is awesome [Eclipse and Netbeans are left in dust] and it does not lack any of ‘special’ text editing feature Sublime has.