Coding Shorthand

This is C shorthand - which was conceived … nearly 50 years ago :slight_smile:

I wouldn’t argue passionately against (nor for) x++ being part of the Xojo language these days. After coding in other languages, I do miss it briefly when I return to Xojo. But I can’t say it’s important enough to dedicate any Feedback points to :slight_smile: And I soon get over it.

@Nicholas Henson, Feedback is a useful tool if you want to support changes in Xojo.

Please say that!!!

  • Karen

You are making my point. You’re already 50 years behind! lol. I’m just kidding… I love Xojo and i wish more languages would take note of the IDE.

[quote=166602:@Karen Atkocius]Please say that!!!
[/quote]
I can say that ++ in either form probably will not

but +=, -=, /=, *= and maybe a few others ARE still on the “things to maybe consider one day” list

I could live with

i += 1 instead of i = i + 1

BUT … this is NOT a promise they will arrive at any time
Just they have no been set in the “No way in hell we’re doing that” bucket :slight_smile:

I’ve argued ad nauseam for this in the past, and it is simply not going to happen. For me, the frustration comes not from when I have to type:

i = i + 1

but rather when it’s something more like:

aVeryDescriptiveVariableNameThatIsRatherLong = aVeryDescriptiveVariableNameThatIsRatherLong + 1

I’d much rather be able to say:

aVeryDescriptiveVariableNameThatIsRatherLong++

But that’s how I was trained (C, Java, PHP) so I’m used to such syntactic sugars, and the meaning is plain as day to me. I find the ++ notation much easier / faster to grok. I’ve given up hoping that such shortcuts will arrive in Xojo, because in spite of the obvious argument that it will only help those who want it and nobody will be forced to use it, I’ve relegated myself to 2 realities: 1) I’m in the minority in wanting this as I’m not really Xojo’s target market and 2) there are MUCH bigger fish to fry.

You are indeed right sir! I will fry the bigger fishes now =). Thanks everyone for the insight.

[quote=166606:@Norman Palardy]I can say that ++ in either form probably will not

but +=, -=, /=, *= and maybe a few others ARE still on the “things to maybe consider one day” list[/quote]

They have not been set in the “No way in hell we’re doing that” bucket

Just the whales need slaying first :stuck_out_tongue:

err … is greenpeace going to come get me now ?

[quote=166602:@Karen Atkocius]Please say that!!!

  • Karen[/quote]
    That’s like going to a restaurant and saying “Well, I don’t like cake so table five can’t have cake.” even though it has no effect on you or what you’re eating.

[quote=166612:@Norman Palardy]They have not been set in the “No way in hell we’re doing that” bucket

Just the whales need slaying first :stuck_out_tongue:

err … is greenpeace going to come get me now ?[/quote]
Whales like indent visibility? :wink:

More like
We own the restaurant & we’re not making that cake - at this time - and we may never - or maybe we will one day
But it might not be exactly made the way YOU want it (typical restaurant)

There’s invisible whales ?

[quote=166618:@Norman Palardy]More like
We own the restaurant & we’re not making that cake - at this time - and we may never - or maybe we will one day
But it might not be exactly made the way YOU want it (typical restaurant)[/quote]
I was referring to the way Karen is behaving on the subject. Saying that if the restaurant serves cake, that she will never return even though she doesn’t have to order the cake - the ice cream is still on the menu.

You don’t know how much I hate C syntax and how hard I find it to read. That is why I got involved with REALBasic.

  • Karen

[quote=166622:@Karen Atkocius]You don’t know how much I hate C syntax and how hard I find it to read. That is why I got involved with REALBasic.
[/quote]

I should have never introduced the word syntax to the discussion. This is not my intention for the subject.

You can write that as

if condition then s = something else s = nothing

Which is still one line and MUCH more readable.

This C stuff is really horrible. Xojo is not C. I’ve been playing around with Python for the last year and I would like to see:

  • case-sensitive variables (I quickly learned to use _ for variables)
  • indentation instead of “end if” or similar (awful, awful)
  • being able to return multiple values from a function actually is not a bad idea

[quote=166657:@Tim Hare]You can write that as

if condition then s = something else s = nothing

Which is still one line and MUCH more readable.[/quote]

I rarely use one-line If statements, and never the way Tim suggested. Why? When debugging, it’s very hard to tell which way it branched when stepping through the code. Obviously this example is not a great illustration of the potential issues, but hopefully you get my drift.

Just some food for thought.

Good point. Yet another benefit of non-compact code.

Lads, be creative! Write your own functions! For all those who know Borland Turbo-Basic / Power-Basic:

increase or incr / counterpart decrease or decr

incr( aVeryDescriptiveVariableNameThatIsRatherLong, 1)

or

decr( aVeryDescriptiveVariableNameThatIsRatherLong, 34)

Or an Extends.

aVeryDescriptiveVariableNameThatIsRatherLong.Inc

The problem with using a method is the speed penalty. You won’t notice if you use it here and there, but you’ll wonder why things got so slow in a long loop.