Where is such magics defined?

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Where is such magics defined?

Post by operator+ »

Are they ever documented? Or only the developers themselves know and use it?

I saw this snippet on another freebasic forum:

https://retrocoders.freeforums.net/post/166

Notice: are you see his constructor a bit strange?

Normally it would be like this:

constructor Window()
end constructor

How could he know and use this syntax?

constructor Window() : end constructor

And how could new users/normal users/non-freebasic-compiler developers know about this syntax to use?

These syntatic sugar is useful for only those know about them and is troublesome for those don't know about them to understand.

Sometimes I'm very confident I have read the OOP document on freebasic wiki and I'm sure I'm know most if not all about it.

Only until I saw some people's random code posted on this forum that is full of hidden magics like this.

This make me questioning: what the heck is this?

Another example: At first glance I think freebasic got generics support when I first saw this:

viewtopic.php?t=31458

You know? Foo<Bar> is reserved for generics on most language: C++, C#, Java, Pascal,...

Only after reading the thread it turns out to be just an undocumented data type!

The OP of that thread is a long time freebasic user! But he's still have no idea what the heck it is!

I'm sincere asking: how many hidden magics does this language have?

How many parts of this language that still being undocumented?

I'm really afraid. Don't tell me to only use the parts I know. Please. Using a language is not only about writting your own code but also using other people's code. Being able to read and understand their code is as important as being able to write your own code. I feel like after I have IELTS 8.0 but still don't understand what native speaker said. It's very disappointed.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Where is such magics defined?

Post by fxm »

1)
In Programmer's Guide, see the Line Separator documentation page of the "Lexical Conventions" section.

2)
fxm wrote: Feb 14, 2022 6:00
deltarho[1859] wrote: Feb 14, 2022 3:28 I saw Uinteger<32> here. Some of you may say: "How come you didn't know that?". Well, I didn't, and I cannot find it described in FBWiki.
Simply on pages: INTEGER and UINTEGER
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: Where is such magics defined?

Post by Munair »

Some really seem to have difficulty USING or taking the time to READ the documentation. I find the documentation extensive and easy to use. I still get the impression that laziness is a significant factor in this. Complaints and criticism as a result of this laziness doesn't do right to the FB developers nor its documentation maintainers, who take HUGE amounts of time to offer all this for FREE. Please think about that!
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Where is such magics defined?

Post by fxm »

3)
operator+ wrote: Feb 19, 2022 7:08 Sometimes I'm very confident I have read the OOP document on freebasic wiki and I'm sure I'm know most if not all about it.
That would surprise me a lot !

In addition to all keyword pages in relation with OOP, and the 'Object Oriented Programming' section of the Community Tutorials, have you also read in the Programmer's Guide all pages of the 'User Defined Types' section ?
Lost Zergling
Posts: 538
Joined: Dec 02, 2011 22:51
Location: France

Re: Where is such magics defined?

Post by Lost Zergling »

A relevant remark. Historically (?) udt's support was the way oop was first approached in FB.
I suppose this point widdely explain the structure the documentation is done.
Also consider multi paradigmatic constraints. Agreed doc could be better, one can always make it better.
Not so bad althought !
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where is such magics defined?

Post by St_W »

Everything you're asking for is described in the official documentation: https://www.freebasic.net/wiki/FBWiki

In my opinion it's also pretty easy to find. For example if you're wondering what a constructor is just read the Key Page "Constructor". I do agree that the search implementation of the wiki software in use is definitely not great (the best results are usually at the bottom and it just shows the internal page IDs), but it's definitely usable.

And when you're programming I'd suggest to use the offline help in CHM format: https://users.freebasic-portal.de/stw/b ... manual.chm
That is exactly the same content, but you have better search. The only downside is that it doesn't update itself automatically, you should download a new version from time to time (same link). I'm aware that offline help sounds a bit dated, cause nowadays everything must only work when connected to the internet, and Google is the only source of documentation for many newbies.

But learning how to search for information is also a crucial thing to learn besides learning programming techniques, if you want to do programming. And that isn't only about how to formulate your search query in Google. Not relying on a single source of information is so important in other areas as well - so get out of your bubble! :-)
Post Reply