If you were going to add to the Xojo language

Brainstorming is not very useful if I don’t understand the rationale for a feature request.

What can I do with closures, with friend, with generics and with the other feature requests that I can’t do now?

1 Like

They’re legitimate questions
How about googling those rather than derail the thread ?
Or start another thread asking that ?

2 Likes

If you don’t understand a languaje feature, you dont have to use it, but being there, others can use it

3 Likes

I do understand that you LIKE to use just the most simple parts of the programming languages, and this thread is not about removing them. Adding advanced features does not add obligation to use them. All “desired” functionalities exists (at least the parts I listed) and they are used in other modern languages designed by language engineers based on necessities they found during their career discussing with users and other engineers, so they are legitimate and useful. If you, or anyone, don’t get it, or prefer to use other ways, just skip them and do what you want in the prolific, redundant, blocking, less practical, fatter binary, and many times slower way, if possible, as you wish. Ptr, memoryblocks, bitwise math, declares, contructors and destructors are in Xojo, and many citizen devs even don’t know they exist or for what they exist, but they exist and are very useful.

1 Like

I have to use C in my embedded life and it has shown me some other things (one of which was already mentioned) that I would say seem natural to me when swapping between C and BASIC.

++ and --, they make sense, none of the other C stupidity does, like +=y, nope completely unintuitive.

why oh why do we have to use THEN, that’s completely wasted.

I would like to have the OPTION to have () around stuff, largely to force the brain to click that something is a function rather than variable.

Some things in Xojo allow it, some don’t (such as multiple elements in a select statement).

as mentioned, I expect some choices can be turned on/off in options, were that ever to be an option in this new and all encompassing compiler…

If you don’t understand what something is, or why someone thinks it is useful, just ask… you might find something that could change your perspective… I know this has happened to me hundreds of times in my career, and I expect it will happen a few more times

I’ve thought Typedefs could be useful. Probably not for the average user though.

Coding comodities / Language features have no direct corelation to better compiled code. :roll_eyes:

do you mean as type aliases like

    typedef *int intPtr ;

or something else Ie/ structure definitions ?

Yeah. So in a situation where I need int32/64 on Mac and only int32 on windows but double on Linux I could define a new type that the compiler would translate based on the current target. I would prefer it to look just like structs in the ide. Being able to inline it would be ok but not as useful. I’ve only had a handful of times when I would have used it though. Pre-cgfloat days being one.

Not just like structs but scope wise and in classes or modules etc.

fair
Like I’ve said this is just a wish list at this point
Whether anything ever comes of it who knows

When I requested it the response was that it’d be too confusing for new users so…

TBH I dont care what Xojo thinks with the list posted here :stuck_out_tongue:

When used correctly yes. For example, Beatrix asked Why Local Functions? To remove something used more than one time only in such place. Let’s suppose you have a large equation with dependencies you kill with few IFs in a complex routine, let’s suppose a 20 lines routine, at the start of your Function MainCalc() and inside it you declare your Function CalcComplex(a, b, c As Double) As Double and do what want and call CalcComplex 2 or 3 times in few lines with few IFs. Without it you have 2 options, a fat ugly code repeating those 20 lines where necessary (hence making your object fatter) or moving this internal function to the outside, like Xojo likes today, creating a kind of “function used in just one point that should not be exposed, exposed”, that makes the thing an ugly, ugly design.

2 Likes

I really like the fact that Swift allows inline functions/classes etc…if the only time that BAR is used is inside of FOO, the it makes sense the code should be there too. Making FOO a self contained and now 100% portable piece of code. Instead of moving to another project later and having to go back and find all it dependant pieces

anonymous functions have uses and they definitely vary depending on the language

java frequently uses them for UI “event handlers”

Lambdas or Anonymous Functions, are another great feature, and needs a bit more of thinking on how to translate to the world of Xojo. But I do remember creating a kind of pre-proposal for that once.

I always enjoyed that any kind of “list” in VB.NET could be manipulated as though it was SQL, through what they called “Linq”. I used it quite a bit.
https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/linq/introduction-to-linq

Languages with “Functional Features” have Map, Reduce, Filter, that does data manipulation “kind of like SQL”, but using functions, for transformation, aggregation and selection.