Some notes after my first PureBasic experience

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Thorium
Addict
Addict
Posts: 1305
Joined: Sat Aug 15, 2009 6:59 pm

Re: Some notes after my first PureBasic experience

Post by Thorium »

GPI wrote: My problem with many posts here is, that they can be summarised to "I hate objects! Don't include it!". When you have an argument, why PB should not support object handling, tell us. Than we can discuss about this. But "fred said no" - yes we know. And of course I am trying to change is decision. That he said no is not an argument.
There are two arguments. The first and most important is: It's a design decision. PureBasic's design revolves around the imperative programming paradigm. It's a way to do things, it's a philosophy. It does not revolve around the object oriented programming paradigm, which is a different way to do the same things, a different philosophy.
You can argue that OOP is better for your tasks and i can argue imperative is better for my tasks.
The fact is PureBasic is a tool for imperative tasks. Thats what it is. Thats the design decision Fred took.

So why not just add OOP, so everyone can use what he wants to use?
Because that would mean to change the whole design of the language. Breaking all compatiblity to older code. Alienateing all users that choose to use PB because it's imperative. Which i guess is the biggest part of the user base. I Mean: Why would you use a imperative language if you want OOP? Makes no sense.

You think you can keep both imperative and OOP?
No you can't. If you don't change the whole design of PB, you actualy allready have what you want. You can program OOP style in PB. The only point in introducing OOP into PB would be to take full advantage of it and change the whole language accordingly.

If you want OOP just take one of the countless OOP languages out there. I dont get the problem.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Some notes after my first PureBasic experience

Post by Dude »

GPI wrote:There are countless request for it. There countless solutions, how to add objects here in forum. And my personal opinion is, that when something like this happend, fred should talk to his team about a standard for this problem.
He did talk about it, and he firmly decided no. Why people can't accept that, I'll never know.

What part of "PureBasic won't be object oriented, period" don't they understand? :shock:
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: Some notes after my first PureBasic experience

Post by StarBootics »

Dude wrote:What part of "PureBasic won't be object oriented, period" don't they understand? :shock:
I share your curiosity on this matter.
The Stone Age did not end due to a shortage of stones !
User avatar
TI-994A
Addict
Addict
Posts: 2704
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Some notes after my first PureBasic experience

Post by TI-994A »

GPI wrote:...not long ago there was no #pb_any. Why? Because Fred decided, that the programmer should generate an id! He changed his mind and added #pb_any.
And many great others have been added since. But mere functions are a far cry from implementing a new architecture.
GPI wrote:My problem with many posts here is, that they can be summarised to "I hate objects! Don't include it!". When you have an argument, why PB should not support object handling, tell us. Than we can discuss about this. But "fred said no" - yes we know. And of course I am trying to change is decision. That he said no is not an argument.
Absolutely; nothing like a healthy discussion to enrich our perspectives. And if the development team ever decides to implement the OO model, it'll be a real game-shifting landmark for PureBasic.

But just as "I hate objects!" is not a compelling argument, neither is "Fred's statement is stupid...".

You should take your own advice. :wink:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
the.weavster
Addict
Addict
Posts: 1576
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Some notes after my first PureBasic experience

Post by the.weavster »

Lunasole wrote:There are also Python, it has some advantages, but in fact just another poor scripting language, which is too high-level, too unoptimized, and misses compilation to machine code.
Python code can be compiled to machine code by using Cython.
Also, what do you mean by 'too high-level'? Python makes this too easy so nobody will be impressed with how clever I'm being?
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Some notes after my first PureBasic experience

Post by Lunasole »

the.weavster wrote: Python code can be compiled to machine code by using Cython.
I know about Cython and several other translators, but such translation is not a Python feature itself (and I guess that generated code is thrashed anyway pn large projects and would not be better/faster than compiled PB executables (for example)). Poor crutch for poor language in fact.
the.weavster wrote: Also, what do you mean by 'too high-level'? Python makes this too easy so nobody will be impressed with how clever I'm being?
I mean that it forces high-level abilities usage, while using normal things to do something nontrivial is tricky or simply impossible.

Danilo wrote:@Lunasole:
If you like OOP for your (cross-platform?) game programming projects, you may want to
take a look at MonkeyX and the upcoming MonkeyX 2.

They support OOP from the start, including Classes, Inheritance, Templates/Generics, Properties, Function/Method overloading.
Additionally to Win/Linux/Mac you can develop for Android, iOS, HTML5/JavaScript, If you like to release your game for mobiles and tablets.

MX2 should be useable at the end of the year and will add even more OOP Features like
operator overloading, lambda's, function pointers, and more. It will be free and open source,
supported by community donations.
Thanks man, looks interesting, I will inspect it later.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: Some notes after my first PureBasic experience

Post by heartbone »

Lunasole wrote:looks interesting, I will inspect it later.
I'll bet that it won't be what you seek. :o
Just so you know Lunasole, I'm still on my first PureBasic experience.

What I know so far is that we could (and should) give a competent OO programmer and a competent BASIC programmer the exact same generic program development scenario. Something reasonable like a small game, with well written specifications (UI, I/O, and algorithms).

As long as both compilers support the requested functionality,
the BASIC programmer will implement the code faster than the OO programmer by over a binary order of magnitude!

Over twice as good given any measure: Development speed, adherence to the specs, or stability of the resultant modules.

That is my gut feeling and I'd love to see any empirical statistics related to my unequivocal assertion.
Keep it BASIC.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Some notes after my first PureBasic experience

Post by Danilo »

@heartbone:
Don't forget that many OO programming languages support plain procedural programming
as well. MonkeyX with 'Function', C++ has functions, and in some OO languages it is called
'static methods' or 'static classes'. So, If you like to, you don't always design classes and methods.
In fact, most languages have a static function 'Main' as the starting point for execution.
ElementE
Enthusiast
Enthusiast
Posts: 139
Joined: Sun Feb 22, 2015 2:33 am

Re: Some notes after my first PureBasic experience

Post by ElementE »

Danilo wrote:In fact, most languages have a static function 'Main' as the starting point for execution.
In PureBasic it seems that the "Main" starting point begins at the first line of executable code that is not contained in a procedure.

Sometimes I place a comment before the start of the main program code so that I can find it quickly.

Code: Select all

; *** Main Program Starts Here ***
Think Unicode!
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Some notes after my first PureBasic experience

Post by Lunasole »

Lunasole wrote:I'll bet that it won't be what you seek.
Right ^^ In total "it lacks some good spirit" that PB have, like many other languages I've compared already
No one is totally good, but for now I see PB closest to it than any other (if not mention those flaws with OOP, etc).


What about topic, besides OO there is 1 more "classic of wishlist".
Yes, this is byref support. I don't know why PB still doesn't offers it for any type it uses.

Using tricks like that instead byref is not wise and easily can make troubles (if passed value < 4 bytes, for example), but I don't see better way, cause passing structures everywhere where byref is needed is too annoying

Code: Select all

EnableExplicit

Procedure Test (*MouseX, *MouseY)
   ;CopyMemory(@Result, *MouseX, 4)
   PokeL (*MouseX, PeekL (*MouseX) + 1)
   PokeL (*MouseY, 1024)
EndProcedure

Define MouseX.l = 5
Define MouseY.a = 5
Test (@MouseX, @MouseY)

Debug MouseX ; 6 as it should be
Debug MouseY ; you just silently got pain in your ass

Also some little thing just for note: would be nice if IDE had an option "Add EnableExplicit to all new files" or something like that
And some kind of unified IIF (inBoolExpression, outIfTrue, outIfFalse) would be handy
Last edited by Lunasole on Wed Nov 11, 2015 3:55 am, edited 5 times in total.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
TI-994A
Addict
Addict
Posts: 2704
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Some notes after my first PureBasic experience

Post by TI-994A »

Lunasole wrote:In total "it lacks some good spirit"...
Worded perfectly. You must be psychic! :lol:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
the.weavster
Addict
Addict
Posts: 1576
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Some notes after my first PureBasic experience

Post by the.weavster »

Lunasole wrote:passing structures everywhere where byref is needed is too annoying
I realise it's a manifestation of my fondness of scripting languages but I like JSON objects, they have the ability to morph into different forms in a way structures don't. Not only that but you can pass them easily from procedure to procedure irrespective of their form because you just have a handle.

If you organise your code into modules and bundle related data into JSON you can create an object(ish) type feel without having to do any big-brain stuff.
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Some notes after my first PureBasic experience

Post by DK_PETER »

Jeeeez...What a repetitive, boring waste of reading...again.
One single newbie rekindle the perpertual oop debate...again
and the minority choir steps in - convinced that they speak for all of us...again.
I can't believe, I stepped into the snakepit and read through it all...again.
Stop wasting your time and do some programming instead!
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Some notes after my first PureBasic experience

Post by Keya »

"Hi Fred I love that meatlovers pizza you make, but instead of ham bacon and pepperoni can you just make it with tomato olives and onion, i think it'd taste better", gosh! :lol:

OO seems more of a product request than a feature request because of how much it affects the overall language (and while i cant speak for Fred if i was in his shoes id only be wanting to work on one not both), in which case wouldn't it make more sense to go and find an existing OO language rather than taking a non-OO language and asking the developer to redesign and change everything he's ever done (possibly alienating the majority of userbase in the process)!?
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Some notes after my first PureBasic experience

Post by Lunasole »

Keya wrote: (and while i cant speak for Fred if i was in his shoes id only be wanting to work on one not both), in which case wouldn't it make more sense to go and find an existing OO language rather than taking a non-OO language and asking the developer to redesign and change everything he's ever done (possibly alienating the majority of userbase in the process)!?
The procedural part of PB looks great and evolved for all the years, so I don't think it requires any major work on it now, of course if adding some OOP doesn't require major changes (I don't think it requires, just see what a great stuff [but currently hard for me to understand it completely] GDI posted in his topic using existing PB features).

And it doesn't seems that most users so much dislike OOP for last years overall as you mentioned. Cause more and more people anyway sometime trying it and seeing that it has some advantages, makes life a bit easier, code shortest (and so on :) ) and the time when it was subject of global holy war also passed away. I'd rather said that users might be leaving PB and going for another poothon or similar if they already tried OOP and appreciated it, and this is totally bad for PureBasic. You can like it or not, but OOP became mainstream and nowaday it would be hard to find a programming newcomer who starts from pointers&procedures instead of Class1.

Well, I'm already repeating what was said before ^^ So that makes no sense.
Currently I'm writing all my stuff procedural way anyway and like it enough, so do not counting on some theoretical PureOOPBasic, but who knows.

the.weavster wrote:If you organise your code into modules and bundle related data into JSON you can create an object(ish) type feel without having to do any big-brain stuff.
Thanks for idea, currently I didn't tried modules in PB yet. Will see what can do with them when got some time to experiment.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
Post Reply