A couple of complaints (observations)..

Linux specific forum
John Duchek
User
User
Posts: 83
Joined: Mon May 16, 2005 4:19 pm
Location: St. Louis, MO

A couple of complaints (observations)..

Post by John Duchek »

Hi, I have been away using freebasic (not its quickbasic compatible form) for a while, and I find that I prefer using it. I think that is because a lot of the basic commands have been changed in purebasic, and the changes feel arbitrary to me. I only bring this up because i am translating some programs from freebasic to purebasic and it really shows it. File loading of csv files seems to be much more difficult and awkward in pure, Using structures with the "\" seems strange and awkward. ((star(j)\rah2000+star(j)\ram2000/60+star(j)\ras2000/3600))) as an example of doing some addition and division with those. Of course the "\" means something else in freebasic. Any way I could go on, but there is a learning curve that seem pretty steep for someone already familiar with the old basic languages. If the compiler could recognize more of the standard basic ways of doing things, I suspect popularity of purebasic would rise, possibly by a lot. It has a lot of advantages. Most of the freebasic and qb64 basic people know about pure and have tried it. In my ignorance, I would think that wouldn't be too tough to do, as the commands are basically tokens to the compiler.
The reason I am translating working freebasic programs is that it has its share of disadvantages. In linux it can use static libraries (If one can find them), but normally uses shared libraries. that makes the programs not very portable, as the user has to have all the shared libraries loaded on their computer in order for it to run. That was cute when memory was limited, but everything it needs to run should be in the executable. Pure has a huge advantage here as it seems to compile so that it will run on any computer that has the same operating system.

On to the other complaint or observation. I notice that the purebasic IDE is able to find the center of my main monitor in my 2 monitor system. My compiled programs do not. When told to center themselves, they position themselves at the center of the video space, which is the crack between the two monitors so that half the window shows on each monitor. Is there any way to fix that?

I am using Fedora 33 linux 64 bit as my operating system.
John R. Duchek
St. Louis,MO
User avatar
skywalk
Addict
Addict
Posts: 3960
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: A couple of complaints (observations)..

Post by skywalk »

My dominant user base is Windows so I cannot speak to the Linux shortcomings.
But, I prefer the syntax choices PureBasic made.
The code is less wordy without the many 'Then' and 'AS DOUBLE', 'AS STRING's.
Pointers do retain their definition later in the code with the *prefix.
So, you will see *p\field * *p\field2 in your code.
Yes, the VAR\field is a compromise over VAR.field but this is because of DEFINE VAR.d or VAR.i.
But still less typing than VAR->field.
~~~
When you convert code from 1 language to another, there will always be subtleties.
If this is a repeat action, then you should code a translation tool.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Tenaja
Addict
Addict
Posts: 1948
Joined: Tue Nov 09, 2010 10:15 pm

Re: A couple of complaints (observations)..

Post by Tenaja »

I looked back on my early code last year, and was wondering what the heck I was thinking, and had to look up my macro definitions.

When I first started using pb I created macros to "fix" the "unorthodox" variable declarations, and I've become so accustomed to the pb way that I forgot I did that initially.

Variable declarations are one of the biggest complaints of pb; even o2 basic list it as a reason they made their compiler (which has no forum activity, btw; he had to beg people to post something just to keep it alive).

My point is this: every language has differences, and what's a quirk to one (mostly newcomers) is old hat to another.

Suck it up, learn the syntax, and you'll enjoy it. There's no way on earth Fred will change the major syntax things that will break 25+ years of code just because a few old timers learned in the 80s. Or 70s, or vb or qb or msb whatever other flavor of basic you want to list. The reality is that every Basic language has arbitrary decisions, because unlike C, basic has no formal industry-wide definition.

One could easily argue FB is the one that uses arbitrary syntax, as it was released around a decade after PB...
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: A couple of complaints (observations)..

Post by Mijikai »

John Duchek wrote:...On to the other complaint or observation. I notice that the purebasic IDE is able to find the center of my main monitor in my 2 monitor system. My compiled programs do not. When told to center themselves, they position themselves at the center of the video space, which is the crack between the two monitors so that half the window shows on each monitor. Is there any way to fix that?
...
1. PBs Syntax is fine.
2. U can place a window however you want https://www.purebasic.com/documentation ... ktops.html.
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: A couple of complaints (observations)..

Post by Rinzwind »

The dot is more easy on the eyes and unique.
The ( and ) are used in too many situations in pb. I would prefer the common [] to address arrays because sometimes you get a lot of nested ('s in pb.
ByRef parameters
Inline array declaration and initialization
Line formatting functionality. Should be doable to implement a pb version of printf.
An advanced grid gadget
A tiny bit of grouping data/behavior for the ones who need/want it (extend structure syntax?)

Few come up time and time again and silently ignored so little hope of seeing it implemented.
John Duchek
User
User
Posts: 83
Joined: Mon May 16, 2005 4:19 pm
Location: St. Louis, MO

Re: A couple of complaints (observations)..

Post by John Duchek »

You didn't hear me complaining about declaring variables. That change makes lots of sense. It is some of the other idiosyncrasies that seem out of place like the ones I mentioned. I am not against improvements (variable declaration), just changes that don't seem to add much but require the user to relearn various commands. It is still a great language, but it does call itself Pure BASIC. I am not sure it is. I am not trying to bash the language, just point out that the learning curve is steeper than it could be.

I know I can change the window location, but I am referring to the flags statement

#flags=#PB_Window_SystemMenu|#PB_Window_ScreenCentered

#PB_Window_ScreenCentered which puts it centered with half the window on one monitor and half on the other. I doubt that that is how it is supposed to work.
John R. Duchek
St. Louis,MO
User avatar
skywalk
Addict
Addict
Posts: 3960
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: A couple of complaints (observations)..

Post by skywalk »

Well, you called out the dereferencing operator '\' as a poor choice.
What would you use instead, since you "like" the PB variable declaration operator '.'?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: A couple of complaints (observations)..

Post by oreopa »

Backslash is not unheard of to reference structured variables in other BASIC/languages, it was exactly this way in Blitz BASIC on the Amiga at least - and PB is somewhat a descendant of that...

Also, BASIC isn't BASIC anymore. It's not like the old days of line numbers :) I think PB does a fine job of retaining the accessibility and immediacy of programming in BASIC. I did have some problems with some syntax at first... but it wasn't hard to overcome... The benefits of PB far outweight any synaptic changes you have to make ;)
Proud supporter of PB! * Musician * C64/6502 Freak
KosterNET
User
User
Posts: 30
Joined: Tue Mar 22, 2016 10:08 pm

Re: A couple of complaints (observations)..

Post by KosterNET »

John Duchek wrote:...On to the other complaint or observation. I notice that the purebasic IDE is able to find the center of my main monitor in my 2 monitor system. My compiled programs do not. When told to center themselves, they position themselves at the center of the video space, which is the crack between the two monitors so that half the window shows on each monitor. Is there any way to fix that?....
I have read your input. I have started using GWBasic on Dos 4.01, then moved to Quickbasic, PowerBasic (all for DOS) and then my adventure on VB6 (windows).

My step to PureBasic in august 2015 meant that I had to re-learn the whole BASIC-stuff again. I do not share the experience that the choices by Fred seem illogical.

On the other hand, I must definately admit that I sometimes do things 'the hard way', bescause I did not take the time to learn other possibilities yet. E.g. the day that I learned how to use Structures and Lists made a big difference on how I use PureBasic ;-) Before that I used to create a number of simple arrays with size -way-too-large- instead of 'ForEach' etc.

So, I love the language more and more every year and also admit that it takes time to learn.

About the #PB_Window_ScreenCentered, I would guess that the working should normally be the same on Windows and Linux. It would not be logical if that creates a different result on Windows and Linux (or Mac). Maybe request a change?
User avatar
Tenaja
Addict
Addict
Posts: 1948
Joined: Tue Nov 09, 2010 10:15 pm

Re: A couple of complaints (observations)..

Post by Tenaja »

John Duchek wrote:You didn't hear me complaining about declaring variables.
You missed the point:
My point is this: every language has differences, and what's a quirk to one (mostly newcomers) is old hat to another.

Suck it up, learn the syntax, and you'll enjoy it.
I was using variable declarations as one example that "others" complain about--including me, initially.
BarryG
Addict
Addict
Posts: 3268
Joined: Thu Apr 18, 2019 8:17 am

Re: A couple of complaints (observations)..

Post by BarryG »

John Duchek wrote:#PB_Window_ScreenCentered which puts it centered with half the window on one monitor and half on the other. I doubt that that is how it is supposed to work.
Sure it is. A large desktop spread over two physical monitors is still considered to be just one monitor by the Operating System, so of course it'll position the window in the middle of them.

To solve your problem, you need to manually calculate the coordinates and dimensions of your primary monitor and move your window to the center of it. The Desktop commands can help.

Or see examples here -> viewtopic.php?f=13&t=62428
John Duchek
User
User
Posts: 83
Joined: Mon May 16, 2005 4:19 pm
Location: St. Louis, MO

Re: A couple of complaints (observations)..

Post by John Duchek »

I bought purebasic about 10 years ago and have yet to "suck it up". I have read your replies, and they pretty much amount to that. It is a good language. It isn't consistent with BASIC which is my main point. As for it "correctly centering between the monitors, my question was why does the purebasic IDE correctly center its window as I thought it was written in purebasic. I assume it does it manually then.
Thanks,
john
John R. Duchek
St. Louis,MO
Post Reply