Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Oct 18, 2017 1:24 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: New name, time for some syntax changes?
PostPosted: Wed Apr 24, 2013 2:06 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
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


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Wed Apr 24, 2013 2:41 pm 
Offline

Joined: Wed Feb 16, 2011 1:59 pm
Posts: 74
Location: Arizona, USA
One vote for you. Everything else is changing, that tiny bit wouldn't hurt. It actually makes it more productive.

_________________
Windows XP SP3
RS 2012r2


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Wed Apr 24, 2013 2:44 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
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. ;)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Wed Apr 24, 2013 2:49 pm 
Offline

Joined: Mon Jun 21, 2010 9:25 pm
Posts: 11
Location: Warfordsburg, PA
Yep. Definitely a heretic. :lol:

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

_________________
Regards,

Mike B.


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Wed Apr 24, 2013 3:02 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
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.)

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Thu Apr 25, 2013 10:17 am 
Offline
Site Admin
User avatar

Joined: Fri Sep 30, 2005 9:35 am
Posts: 987
Location: South Portland, Maine
timhare wrote:
What do y'all think? Have I become a heretic?

Yes. :D

_________________
Paul Lefebvre
Developer Evangelist
Xojo, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Fri Apr 26, 2013 5:04 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
timhare wrote:
What do y'all think? Have I become a heretic?

Burn him!

:D


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Thu May 02, 2013 11:51 pm 
Offline

Joined: Tue Mar 23, 2010 8:44 pm
Posts: 673
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Thu May 02, 2013 11:55 pm 
Offline
User avatar

Joined: Tue Jan 04, 2011 3:02 am
Posts: 1236
Location: Jönköping, Sweden
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 ;)

_________________
Image http://www.linkedin.com/in/albinkiland
Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Xojo Pro 2013r1


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Fri May 03, 2013 12:02 am 
Offline

Joined: Tue Mar 23, 2010 8:44 pm
Posts: 673
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Fri May 03, 2013 12:15 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Fri May 03, 2013 12:23 am 
Offline

Joined: Tue Mar 23, 2010 8:44 pm
Posts: 673
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Fri May 03, 2013 8:10 am 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
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

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Fri May 03, 2013 10:02 am 
Offline

Joined: Tue Mar 23, 2010 8:44 pm
Posts: 673
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: New name, time for some syntax changes?
PostPosted: Fri May 03, 2013 10:11 am 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
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

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group