[POLL] Do you like "then,do,end" or "{ }"?

General discussion about LÖVE, Lua, game development, puns, and unicorns.

Do you like "then,do,end" or "{ }"?

"then,do,end" is just fine
36
82%
"{ }" would be better
8
18%
 
Total votes: 44

User avatar
XHH
Citizen
Posts: 76
Joined: Thu Jun 20, 2013 6:43 pm
Location: US
Contact:

[POLL] Do you like "then,do,end" or "{ }"?

Post by XHH » Fri Jul 26, 2013 12:24 am

I immediately noticed Lua has then,do,and end instead of curly braces. I want to know what others think of this. Vote nao plz. :nyu:
I like to draw and program :)

User avatar
slime
Solid Snayke
Posts: 2853
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: [POLL] Do you like "then,do,end" or "{ }"?

Post by slime » Fri Jul 26, 2013 12:50 am

They're both fine. As are other alternatives.
Lua is built around using words for code blocks, some other languages use braces or whitespace+newlines or parentheses.
Squirrel is a language which takes heavy influence from Lua but uses braces for code blocks.

User avatar
XHH
Citizen
Posts: 76
Joined: Thu Jun 20, 2013 6:43 pm
Location: US
Contact:

Re: [POLL] Do you like "then,do,end" or "{ }"?

Post by XHH » Fri Jul 26, 2013 12:56 am

slime wrote:Squirrel is a language which takes heavy influence from Lua but uses braces for code blocks.
Oh yea, I forgot about Squirrel. :o
Does Squirrel have a graphics/game library? If so can u link it.
I like to draw and program :)

User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: [POLL] Do you like "then,do,end" or "{ }"?

Post by Plu » Fri Jul 26, 2013 7:14 am

The problem with including {} is that you probably also need to include () in a lot of places to make your code clear and I'm not sure it'd become more readable.

If find Lua to be far easier on the eyes than Javascript and the two are quite alike in how they work, but the syntax is different. And Javascript usually turns into a mess of (}{}(()][]) at some point in development.

User avatar
Davidobot
Party member
Posts: 1149
Joined: Sat Mar 31, 2012 5:18 am
Location: Game-Dev. Land
Contact:

Re: [POLL] Do you like "then,do,end" or "{ }"?

Post by Davidobot » Fri Jul 26, 2013 7:27 am

I don't mind using {}. But then/do/end, seem to make the code look cleaner.
My library:
LovelyMoon

Check out my current project:
Raycaster

Oh hey, I have a website now!

Bobbias
Prole
Posts: 36
Joined: Sat Jun 29, 2013 1:26 pm

Re: [POLL] Do you like "then,do,end" or "{ }"?

Post by Bobbias » Fri Jul 26, 2013 7:52 am

I'm fine with either. If I have an editor that indicates indentation level it doesn't really matter which one is used (provided the indentation is consistent).

User avatar
Jasoco
Inner party member
Posts: 3650
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: [POLL] Do you like "then,do,end" or "{ }"?

Post by Jasoco » Fri Jul 26, 2013 10:03 am

I think If/Then/Do/End works well for Lua. Curly Braces wouldn't work well with Lua and its Table structure and would just be confusing. Since Functions and Tables would look so similar to each other.

User avatar
MPQC
Citizen
Posts: 65
Joined: Fri Jun 28, 2013 2:45 pm

Re: [POLL] Do you like "then,do,end" or "{ }"?

Post by MPQC » Wed Jul 31, 2013 2:15 pm

Plu wrote:The problem with including {} is that you probably also need to include () in a lot of places to make your code clear and I'm not sure it'd become more readable.

If find Lua to be far easier on the eyes than Javascript and the two are quite alike in how they work, but the syntax is different. And Javascript usually turns into a mess of (}{}(()][]) at some point in development.
Javascript always seems to turn into a mess of brackets lol, but it wouldn't be fixed by using "then/do/end", it would then just be a mess of "then/do/end" really. Most languages don't seem to go nuts with brackets, so most of the time I do prefer using them simply because of habit, not because they look ugly or anything.

User avatar
Omnivore
Prole
Posts: 18
Joined: Fri Jun 28, 2013 12:51 am
Location: West Coast

Re: [POLL] Do you like "then,do,end" or "{ }"?

Post by Omnivore » Wed Jul 31, 2013 2:50 pm

To be perfectly honest, I'd much prefer Python syntax in general. Having to type end or } feels like I'm back in either ancient Pascal or K&R C days. Lua has many advantages, but I'd just about give them all up if there was a Python version of Love. Really miss the conciseness and power as well as the 'batteries included'.
Lua lou aye, ah no its, lua louie

User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

Re: [POLL] Do you like "then,do,end" or "{ }"?

Post by Eamonn » Thu Aug 01, 2013 10:01 pm

I love the {} more than the other option. Then it'd be Python, and then Lua's syntax.

Javascript does tend to get messy.

That being said I do like do/then/end/etc. If I had to choose between one of them though, I'm a curly brace guy all the way! Maybe that's because my first language I got somewhere with was Javascript. I did try Python, but I was too N00B to find a good tutorial, and found a crap one on the internet somewhere that didn't make any sense. Looking back at that tutorial, it was a terrible tutorial. Javascript was the first language I actually got far with.

I'm also not saying I prefer a language based on what way it defines where a block of code begins and ends. I prefer a language on what's possible with it and what I want to use the language for. I tend to dislike Python because it's not that fast, and with some small Tkinter apps you can defiantly notice it. I also dislike Python because there is a lack of game libraries for it(PyGame sucks, PyGlet is good, but Cocos2d is recommended for game development. Cocos2d isn't well documented and hasn't got a big community). Lua is simple, easy to learn, powerful, and has a game framework: LÖVE! The framework is well documented, has a good sized community behind it and plenty of people are willing to help, and 99% of them are awesome people! I don't like Ruby because it's kinda slow, it does things in a strange way, and has some badly documented game frameworks. Rubygame is dead. Gosu is badly documented. Chingu hasn't got good docs either. Ruby and it's libraries don't have good communities -- if any at all! Java is great for games. There are 3 main frameworks, all of them are well documented and Java has a HUGE community behind it. All 3 have good communities. Java has great syntax and is really simple to learn.

Just my opinion on the topic :)

EDIT:
[...]but I'd just about give them all up if there was a Python version of Love[...]
That wont happen. I asked this. Don't get me wrong, I'd love a Python version of LÖVE(and I've been temped to write a port myself, based on Cocos2d-Python, but then I thought I'd have no idea how to start). Why wouldn't there be? Well, LÖVE's philosophy is based on Lua's philosophy, from what I've been told. Robin can tell me if I'm wrong, and you could add to this.

EDIT 2:

Squirrel has a game library of sorts. It's not for the Desktop, but it's for iOS and Android. I've never used it. I do know Squirrel, but I prefer LibGDX for Android and iOS development because I like Java. Check out the emo game framework. It's free, open source and seems to be pretty good. Of course, you could always use Corona. One thing about the emo-framework is that it has no "pro" version. You don't pay for more features. Of course, you can donate, but AFAIK it doesn't give you any perks.
Last edited by Eamonn on Fri Aug 02, 2013 11:44 am, edited 2 times in total.
"In those quiet moments, you come into my mind" - Liam Reilly

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests