Hello all,
We are a lot of oldschool coders there, having some experience with several programming languages, mixing paradigms as needed, learning for hours with websites, books, forums and so on. I remember the beginning of java, php, python and the pleasure I had with them. What I wanted to say is that the coding community enthusiasm is what leads to success. It's what happened each time.
So, the question is : what is giving a coder pleasure and fun ?
For me, easy : new horizons, breakthrough, not headache. I'm delighted when a language or a tool allows me to do something new, or something else better, faster, and I don't care if I have to learn to use it. The wow effect is what I'm looking for, too.
I have to say that with python, we have some of these breakthrough. And it is what I'd like to see in PB.
BASIC has always been the choice to discover coding, to learn, to do things and test ideas easily. Now, some things are easier with Python or PHP. I think that these languages are born because other languages were considered as limited. But BASIC shouldn't be seen as fixed in the past. What is BASIC : something easy to understand, to use, to manipulate. BASIC is what we decide it is.
An example : I'd like to see in PB easier large data manipulation. I'd like to play with arrays, lists, maps, vectors as with variables. I do not want the "power" of C, overloading, defining operators. I want it easy. I want to save, load it, send and receive it. The background is already there, but I don't want a new function : I want it integrated beautifully in the language, so that it seems natural.
And you, what would you want to see natively in a today's BASIC ?
Programmer's delight
Programmer's delight
Last edited by djes on Tue Jan 22, 2019 10:40 pm, edited 2 times in total.
Re: Programmer's delight
What is surcharging?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Programmer's delight
Overloading, translation mistake...skywalk wrote:What is surcharging?
Re: Programmer's delight
A lot of this could be achieved if we had runtime reflection capabilities, then you could do all sorts of magic.
Fred has already added some reflection ability when he added copystructure back in 4.2 i think.
but it's just the minimal info to copy data structures with PB objects in them but there's no reason
why that couldn't be extended.
Fred has already added some reflection ability when he added copystructure back in 4.2 i think.
but it's just the minimal info to copy data structures with PB objects in them but there's no reason
why that couldn't be extended.
Windows 11, Manjaro, Raspberry Pi OS
Re: Programmer's delight
You could do most of this (besides vectors I think) with the JSON lib, or am I misunderstanding something here?
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{Downloads}.:|:.{History Viewer Online}
Re: Programmer's delight
Yes, in fact, JSON is showing what should be native. I'm talking about all these functionalities that could be added to give coders pleasure.
For example :
For example :
It's just an illustration of what could be imagined to enhance PB, with the BASIC spirit...Dim MyArray = (("id", "name", "x", "y"), (1, "Point 1", 133, 10), (2, "Point 2", 27, 40)) ; The parser should recognize this kind of writing without anymore declaration. Be easy !
; Note the array without parentheses to distinguish from a normal array
; Note the automatic color to distinguish type instead of other decoration, could be applied to every type
SaveArray(MyArray, "C:\temp\Array.json", #JSON)
MyArray + (3, "Middle", (MyArray(1, "x") + MyArray(2, "x")) / 2, (MyArray(1, "y") + MyArray(2, "y") / 2))
-
- Addict
- Posts: 4519
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Programmer's delight
I agree, that would be nice to have.djes wrote:It's just an illustration of what could be imagined to enhance PB, with the BASIC spirit...
As long as this is not built-in in PureBasic, we can do something like this.
Re: Programmer's delight
We don't even have inline array initialization (incl. direct passing as parameter to procedure)... Array initialization is VERY awkward in PB. In fact, I do not know any other language which does not allow one to declare and initialize an array with a one liner and the PB way makes some code ugly quickly.
Side note, I wish PB would introduce the [] as optional alternative for () since in PB the number of ('s start getting out of hand sometimes.
Side note, I wish PB would introduce the [] as optional alternative for () since in PB the number of ('s start getting out of hand sometimes.