4 features that would make PB even Better

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Rinzwind
Enthusiast
Enthusiast
Posts: 679
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

4 features that would make PB even Better

Post by Rinzwind »

1 ByRef/ByVal option for procedure arguments, especially strings (makes PureBasic more 'Basic' right? Instead of hurting your brain with pointers). So one can easily return multiple results from a procedure through output arguments.
2 Procedure overloading. Same name, different number of arguments or argument type
3 Unsigned data types (it's all about internal representation right?)
4 More platform specific standard libraries like registry and task scheduler handling for Windows. Things that many users will frequently need when programming for their platform. Again, make basic tasks Basic.
5 Hard one... easy ActiveX usage?
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: 4 features that would make PB even Better

Post by Tenaja »

Rinzwind wrote:1 ByRef/ByVal option for procedure arguments, especially strings (makes PureBasic more 'Basic' right? Instead of hurting your brain with pointers). So one can easily return multiple results from a procedure through output arguments.
2 Procedure overloading. Same name, different number of arguments or argument type
3 Unsigned data types (it's all about internal representation right?)
4 More platform specific standard libraries like registry and task scheduler handling for Windows. Things that many users will frequently need when programming for their platform. Again, make basic tasks Basic.
5 Hard one... easy ActiveX usage?
How do you define "more basic"? The Basic languages I learned on did not have ByRef or ByVal, so adding them does not make it more basic to me. (I actually prefer most of the features of PB that take it further from "basic".) I would guess your definition of "more basic" is more accurately "more Visual Basic".
...Does anybody know the first occurrence of those keywords in a language?

While I do agree that most of those would make PB "better" (by some arbitrary definition) had they been implemented in the first place, I am certainly going to vote

-1

to all except 1 & 3. However, keep in mind that Fred makes up his own mind on this stuff, and is rarely influenced by comments.

#1 Those keywords do not actually add capability to the compiler. They just handcuff you, the coder into an old mindset. Pointers are very simple, once you have done it a few times.
As an alternative until Fred does implement this (likely never), you can make macros yourself to replace a ByRef, although you will need one for a call and one for a proc definition. (Macro ByRef : @ : endmacro). Implementation for a Proc definition will be a lot more complicated, depending on what you want out of it. ByVal is redundant, since that is what PB does now.

#2 will most likely never be implemented, because it will break a LOT of old code. I think the updates are manageable, however, it is just as easy to append a Type to the procedure name, since you still have to create multiple procedures. And by appending that Type, you are keeping within PB's style. i.e. PeekS, PokeS, PokeL, etc, you can just as easily create MyProcL and MyProcS.

#3 is actually my favorite, but also very unlikely--it has been requested before. (Although it is already implemented for Byte and Word vars with .a and .u.) Right now, there are only three Types that are not available for Unsigned. For every type Fred adds, there must be a conversion to all of the other types. That means that if he adds ULong, UInt and UQuad, he must create conversions from ULong to Byte, Ulong to Ascii, Ulong to Char, Ulong to Word, Ulong to Unicode, Ulong to Integer, Ulong to Long, Ulong to Float, Ulong to Quad, Ulong to Double, Ulong to UInt, Ulong to UQuad, and Ulong to any other I missed. AND he has to create a conversion to go in the opposite direction for all of those types. Then repeat it for UInt and UQuat. That is at least 72 new conversions he'd have to manage.

#4 & 5...I would much rather Fred focus on Linux and Mac, and bringing them up to the robustness of Win. There are plenty of Windows specific libraries on this forum to handle registry mods, and numerous examples available scattered throughout VB, C# and C++ forums as well. Since they are merely API calls, there will be negligible language barriers to convert them to PB.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: 4 features that would make PB even Better

Post by ts-soft »

Rinzwind wrote:5 Hard one... easy ActiveX usage?
Is this the latest implementation or the theme as COM, OLE, OCX ... ...

I think, this bad implementation is not required and is not BASIC, only VBasic/OBasic.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Rinzwind
Enthusiast
Enthusiast
Posts: 679
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: 4 features that would make PB even Better

Post by Rinzwind »

Basic as in what the language should mean. Make programming tasks basic to do. Basic never had a fixed design. It evolved from time to time and system to system.

ActiveX and the component object model are the building blocks of Windows, surprisingly more so on 8+ versions (Windows Runtime/WinRT) thanks to the Windows dev core team who does not really like that .NET stuff on top of their system ;) whether you or I like it or not...

Ooo wait.. 6. A build-in string formatting function
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: 4 features that would make PB even Better

Post by luis »

Rinzwind wrote: 2 Procedure overloading. Same name, different number of arguments or argument type
http://www.purebasic.fr/english/viewtop ... =3&t=55335
Rinzwind wrote: 3 Unsigned data types (it's all about internal representation right?)
http://www.purebasic.fr/english/viewtop ... f=3&t=6896
http://www.purebasic.fr/english/viewtop ... 95#p296495
"Have you tried turning it off and on again ?"
A little PureBasic review
Post Reply