[ANTRAG] Methoden in Types

Previous topic - Next topic

Kitty Hello

std::cout gibt's nicht - muss man erst deklarieren. Ebenso std::endl und std::ostream operator<<(const char*) und std::ostream operator <<(char);
Was soll das werden? Du hast ja keine Konsole auf. (Wobei's dafür auch eine INLINE Lösung gäbe).
Trucidare hat Rect.
Nimm C++ nur da her, wo Du mit GLBasic echt steckenbleibst. GLBasic _ist_ schnell - erhoff' Dir durch INLINE keinen Turbo.

Schranz0r

GLBasic ist Turbo ;)
Und um Text aus zu geben brauch man keine Console, da tuts das GLB-Fenster schon 1000x :P
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

sechsrad

QuoteUnd um Text aus zu geben brauch man keine Console, da tuts das GLB-Fenster schon 1000x
ich könnte mir vorstellen, von einem konsolenfenster die grafik im glbasic-fenster zu beeinflussen mit neuen daten.

Schranz0r

ist doch schrottig
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

AndyH

Quote from: bigsoftyHehe, ah well, I tried! ;)

Basically, I'm personally against OO being added to GLB. I saw the vast BlitzBasic community get OO added to their language (BlitzMax) and it destroyed said community. The average hobbiest programmer wants something simple to read, quick to implement and understand, esp. at the beginner stage, OO added a level of complexity to BlitzBasic that was off-putting to the point that a lot of the community simply left for a simpler life in other basics.

As I've said, this is just my personal experiences.

Now, Im off to read up on my German! :P
I've the opposite opinion.  OOP is just a tool, and can help make things clearer and easier to program.  OOP can get very involved for people new to it and be confusing I guess partly because it is different.  However I think GL Basic could benefit from some OOP principles.

As for BMax, my impression is that it's not the move to OOP that has caused a problem for users moving over (as you can still code normal procedual style programs) it's more that the documentation is a little weak and that Mark has made it so close to C++ in design, it's no longer as accessible as a whole as Blitz Basic was.

I do agree that GL Basic should not change what it is.  Afterall it is fun to program in and very quick to get going while performance is very good.  It would not hurt though to have some OOP ideas as mentioned in this thread and others as the benefits are worthwhile.   Simply being able to place in functions in to the types, which could then access it's typed variables as local variables, would be an excellent enhancement, and you can ofcourse ignore it and never use it if it worries you ;)

eg, simple TYPE that contains all the code and properties wrapped up in one place, makes it very easy to lift this up and re-use in any program you write:

Code (glbasic) Select
TYPE tPrint
  x;y
  FUNCTION Print: message$
    PRINT message$, x, y
  ENDFUCNTION
ENDTYPE

GLOBAL myPrinter AS tPrint
myPrinter.x = 100;
myPrinter.y = 100;
myPrinter.Print("Hello World")
I remember when Turbo Pascal went OOP many, many years ago it seemed very confusing and wondered what the benefit of it was over the convential procedural method we were so used to.  Once you understand how you can make use of OOP, no matter at what level you use it, it can help you organise and think about solutions in a different and sometimes better way.  It doesn't have to change how or what GLBasic is in the slightest.  Just another tool in your toolbox.  If only I could convince Gernot to add it. :)

Kitty Hello

I think it's not quite fitting GLBasic. Also, I fear for people screaming about inheritance and polymorphism (which really is a great tool - but not BASIC).

Anyway, my spare time is quite limited, too... ;)

AndyH

To be fair, BASIC isn't BASIC anymore ;)  VB.NET and other BASIC derived languages have evolved to include OOP for example.  However I'm not meaning to pester you and I'm happy to make good use of TYPES in GLB.  What do you mean your spare time is limited ? hehe ... Is it because we keep pestering you ? ;)

Kitty Hello

Nah ;) I'm just a bit busy with my life. And I also have some games I wanted to finish. GLBasic is really fun to work on, but there's times when I just want to write a game, too. I started a game for my little kid, and soon she will be too old for the game, but it's not done, yet :p

bigsofty

Well I agree with Gernot here, GLBasic is simple to use, fun and yet powerful enough to produce commercially viable games, this is something to be cherished in the word of computer languages.

BlitzMax found this out to its cost, if people wanted OOP, they'll go C++, its faster, the options for 3rd party support are infinite as is the existing code base... so why stick by a obscure new basic OO dialect that now has a steeper learning curve?

Any ways, Gernot I've a 4 year girl and my 1 day old girl (yep, Im a proud new father! :D), so make sure you do an English translation bud! ;)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Kitty Hello

Happy Birth-Day!!!!

bigsofty

Hehe, thanks Gernot :)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

AndyH

Congratulations Bigsofty!

D2O

Von, mir auch Glückwünsche :)
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

bigsofty

Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

trucidare

Und von mir auch alles Gute und Schöne ;)
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC