Real Software Forums
http://forums.realsoftware.com/

New name, time for some syntax changes?
http://forums.realsoftware.com/viewtopic.php?f=9&t=47693
Page 1 of 1

Author:  timhare [ Wed Apr 24, 2013 2:06 pm ]
Post subject:  New name, time for some syntax changes?

I have been opposed to syntax changes in the past, especially importing C-isms into the language. But one thing I WOULD like to see is this:

Allow an optional semicolon at the end of a line of code.

On the one hand, that would ease the transition from other languages that require a trailing semicolon. On the other hand, it would allow for this:

Allow multiple statements on a line.

This would allow us to conserve vertical space. I would find it especially useful when initializing variables.

X = 1
Y = 5
Z = 7

Could become

X = 1; Y = 5; Z = 7;

What do y'all think? Have I become a heretic?

Tim

Author:  languer [ Wed Apr 24, 2013 2:41 pm ]
Post subject:  Re: New name, time for some syntax changes?

One vote for you. Everything else is changing, that tiny bit wouldn't hurt. It actually makes it more productive.

Author:  Jason_Adams [ Wed Apr 24, 2013 2:44 pm ]
Post subject:  Re: New name, time for some syntax changes?

You know, I've used a number of languages (C, Pascal, SQL, etc.) that use the semicolon to separate commands, but I hardly ever used it to squeeze more code onto a single line. I just rarely find myself wishing this was possible outside of situations where it is:
If Foo Then Bar = 1 Else Bar = 2


Where I did enjoy semicolons was in massive commands that spanned multiple lines (especially in SQL):
select
avg(numcolumn) as num_avg
string_agg(textcolumn, ',') as text_csv

FROM sometable

ORDER BY
id_col1
id_col2;


You can do this in RS (now Xojo), but have to use the underscore, and lose the ability to organize with tabs. But that's the whole point: If you don't know what you're looking for, a semicolon can be confusing, hard to find, and easy to forget. It also takes away from the simple, visual presentation of the editor. For my use, semicolons would have to be required and the whole auto-tabbing system removed. I'm happy with it as is.

Sorry, Tim, I guess I think you're a heretic. ;)

Author:  mbierly [ Wed Apr 24, 2013 2:49 pm ]
Post subject:  Re: New name, time for some syntax changes?

Yep. Definitely a heretic. :lol:

I've used Pascal/Delphi for a long, long time and don't miss the semicolons one bit!

Author:  markwalsh [ Wed Apr 24, 2013 3:02 pm ]
Post subject:  Re: New name, time for some syntax changes?

timhare wrote:
What do y'all think? Have I become a heretic?

Coming from anyone but you, I would have expected the responses to be 'This has been covered before', 'Real Basic/Studio/Xojo is not [other programming language]', etc.

Personally, I often prefer vertical space to jamming things into a single line, even when there are single line alternatives. Back in my VBA days, I would format my function calls with each parameter on a separate line for clarity. And, I never was a fan of Javascript's
Quote:
var x = (value=== "Green") ? "Go" : "Stop";
I'd rather use the following, as I find it easier to read:
Quote:
If (value == "Green") {
x = "Go"
} else {
x = "Stop"
}

But, it wouldn't matter to me if it was part of the language, I just wouln't use it much, if at all, myself. Just as long as we're not required to end each line that way (I have gotten in the habit of doing so in Javascript, but I often find myself missing a few every now and then.)

Author:  Paul Lefebvre [ Thu Apr 25, 2013 10:17 am ]
Post subject:  Re: New name, time for some syntax changes?

timhare wrote:
What do y'all think? Have I become a heretic?

Yes. :D

Author:  Markus Winter [ Fri Apr 26, 2013 5:04 am ]
Post subject:  Re: New name, time for some syntax changes?

timhare wrote:
What do y'all think? Have I become a heretic?

Burn him!

:D

Author:  J.Sh3ppard [ Thu May 02, 2013 11:51 pm ]
Post subject:  Re: New name, time for some syntax changes?

timhare wrote:
I have been opposed to syntax changes in the past, especially importing C-isms into the language. But one thing I WOULD like to see is this:

Allow an optional semicolon at the end of a line of code.

On the one hand, that would ease the transition from other languages that require a trailing semicolon. On the other hand, it would allow for this:

Allow multiple statements on a line.

This would allow us to conserve vertical space. I would find it especially useful when initializing variables.

X = 1
Y = 5
Z = 7

Could become

X = 1; Y = 5; Z = 7;

What do y'all think? Have I become a heretic?

Tim


I agree with you. Here on the forum I actually suggested multiple statements on a single line some time ago.

Since coding a lot of php (and CSS) lately then going back to realbasic it seems naked not putting a semicolon after each line, haha.

Author:  Akiland [ Thu May 02, 2013 11:55 pm ]
Post subject:  Re: New name, time for some syntax changes?

J.Sh3ppard wrote:
Since coding a lot of php (and CSS) lately then going back to realbasic it seems naked not putting a semicolon after each line, haha.

Or, I've been coding a lot in RS lately and it seems stupid to be needing a semicolon at the end of all lines in php ;)
Just had to ;)

Author:  J.Sh3ppard [ Fri May 03, 2013 12:02 am ]
Post subject:  Re: New name, time for some syntax changes?

Akiland wrote:
Or, I've been coding a lot in RS lately and it seems stupid to be needing a semicolon at the end of all lines in php ;)
Just had to ;)


Haha! That's exactly how I felt when I switched from RB to php!

Forgetting that stupid little semicolon was probably my #1 error in php.

Author:  timhare [ Fri May 03, 2013 12:15 am ]
Post subject:  Re: New name, time for some syntax changes?

The semicolon trips me up, especially now that I'm doing more javascript/php. I keep trying to put a semicolon on RB code and leaving them off in php.

Author:  J.Sh3ppard [ Fri May 03, 2013 12:23 am ]
Post subject:  Re: New name, time for some syntax changes?

timhare wrote:
The semicolon trips me up, especially now that I'm doing more javascript/php. I keep trying to put a semicolon on RB code and leaving them off in php.


What I also find annoying is that the semicolon is NOT for every single line.

When I was first learning php I didn't realize that so I was also putting in places it didn't go :)

But I do like being able to put multiple statements on a single line. Saves me a lot of vertical.

Author:  Jason_Adams [ Fri May 03, 2013 8:10 am ]
Post subject:  Re: New name, time for some syntax changes?

timhare wrote:
The semicolon trips me up, especially now that I'm doing more javascript/php. I keep trying to put a semicolon on RB code and leaving them off in php.

I hear you there! Between SQL, Pascal, and PHP, it can be a bit of a mental tongue-twister remembering the precise nuances of each syntax. Often I stare at the screen for a few blank moments, trying to summon up what I know that I knew. :P

Author:  J.Sh3ppard [ Fri May 03, 2013 10:02 am ]
Post subject:  Re: New name, time for some syntax changes?

Jason_Adams wrote:
timhare wrote:
The semicolon trips me up, especially now that I'm doing more javascript/php. I keep trying to put a semicolon on RB code and leaving them off in php.

I hear you there! Between SQL, Pascal, and PHP, it can be a bit of a mental tongue-twister remembering the precise nuances of each syntax. Often I stare at the screen for a few blank moments, trying to summon up what I know that I knew. :P


What I sometimes do in my PHP work is first figure out what I need (duh) then write working code in RB, then convert it to PHP.

Since I'm still new to PHP this reduces the learning curve and lookup time for me :)

As I've written I want an RB to PHP, Objective C, Java converter.

Author:  Jason_Adams [ Fri May 03, 2013 10:11 am ]
Post subject:  Re: New name, time for some syntax changes?

J.Sh3ppard wrote:
As I've written I want an RB to PHP, Objective C, Java converter.

As PHP is in the running for worst contemporary language in the world, I cringe at what kind of code a converter would produce. :P

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/