skywalk wrote: Wed Sep 25, 2024 3:50 pm
Quin wrote: Wed Sep 25, 2024 2:13 pm
Every time one of these arguments comes up I ask this, and no one answers it...

What exactly does "keep it basic" mean? PB is what I'd consider to be BASIC-enspired. "real" BASIC has subs/functions, dim var as string etc., and PB is one of the farthest languages from the rest of the BASICs I've used (VB, BCX, B4X, etc).
My guess at "keep it basic" is having a syntax that is more wordy and allows new programmers to quickly bring up graphical applications within hours to days of starting.
No trailing ; semicolons, pointers are pointers everywhere in the code.
(C defines a pointer once and then you must remember everywhere else it is referenced.

)
This is my favorite syntactical sugar PB brings.
Also very glad PB uses base 0 for array indexing.
It is debatable the number of keywords of PB vs C, since many are api and lib driven.
Ex. UseSHA3Fingerprint, UseSQLiteDatabase, etc. are not in C.
The existence of so many starting libs under one uniform IDE and syntax, it is a disservice to label it basic.
agree to most points of skywalk
BASIC is established syntax rules, these syntax is more readable than "competitors" so even if involves shoud do it THEIR way not "some other way"
also the exosystem with build in commands which are simple to use also.
so f.e. Create a window and throu a gadget in it, need exactly 2 commands, not 2 pages of includes 3 pages of initializations and a few more ...
Quin wrote: Wed Sep 25, 2024 3:58 pm
TI-994A wrote: Wed Sep 25, 2024 2:40 pm
As for the ternary operator, perhaps a page could be taken from Kotlin, which actually implements it with a very simple and readable BASIC-like syntax. That would be an excellent addition to PureBasic.
Ooh...you're right! That is nice!
Code: Select all
value = if (a == 1) true else false
I think that could blend nicely into PB's existing syntax.
the above example is a posible BASIC approach
IIF macro is also good and ALREADY active if wanted
however i have to agree to the thinking of "do we really need it ?"
i mean the main reason of ternary is to make a 4 line if /then/else to a single line,
but can already do it just in four lines (or cheat with :

)
consider that EVERY Adition done in PB , the team has to maintan it, that mean bugfixes/ adaption to all possible syntax now and in future (bug fixes actualyl too) and extra work in general
to me is not that important to use a single line for these speciall occasions, other stuff like raspberry support is by far more important / usefull