BASIC

Author Topic: Functions in Types?  (Read 20135 times)

Offline codegit

  • Dr. Type
  • ****
  • Posts: 270
    • View Profile
Re: Functions in Types?
« Reply #15 on: 2010-May-02 »
Cool............tks  8)
------------------------------------------
1 X Acer TravelMate 4270, laptop, XP PRO
1 X Dell Studio 17 laptop, Windows 7
1 X MacBook Pro 2,2 GHz Core 2 Duo, 2 GB RAM, 160 GB HDD, 9400M
2 X iTouch
1 X HTC Desire (Android 2.1)
iPad soon to be added

Offline Quentin

  • Prof. Inline
  • *****
  • Posts: 915
    • View Profile
Re: Functions in Types?
« Reply #16 on: 2010-May-02 »
yes that would be great

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2640
    • View Profile
Re: Functions in Types?
« Reply #17 on: 2010-May-02 »
Brrr!  :giveup:

:P
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)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5028
  • O Rly?
    • View Profile
Re: Functions in Types?
« Reply #18 on: 2010-May-02 »
Hmm i think thats not realy a "Must have" :)
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kuron

  • Mr. Polyvector
  • ***
  • Posts: 238
    • View Profile
Re: Functions in Types?
« Reply #19 on: 2010-May-03 »
It some ways, it seems like what made GLB a great language syntax wise is slowly being chipped away.  GLB used to be a rock-solid BASIC, now it is going to be another half-assed OOP implementation like BlitzMax?


Uhm, well.
I don't like it. I won't support it much, but you asked for it until my ears were bleeding.
If you don't like it, you shouldn't do it  ;)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10723
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Functions in Types?
« Reply #20 on: 2010-May-03 »
why - o why did I start that at all...
It's giving me great headaches just to get the basics running again, and there's a wish list that's blowing my mind...

Here it is:  :giveup: :D

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2640
    • View Profile
Re: Functions in Types?
« Reply #21 on: 2010-May-03 »
I must admit I am a little worried about this, it all seems pretty harmless but the OOP disaster that was the conversion from Blitz3D to BlitMax, destroyed an otherwise vibrant large community.

Yes, its optional but that can lead to fragmentation of users, into OOP and non-OOP ones.

Who knows, maybe it will be a good thing but I don't see me using it personally as it adds nothing the the actual functionality of my code execution.

Hmmm, sorry if this sounds a bit...  >:D

« Last Edit: 2010-May-03 by 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)

Offline Quentin

  • Prof. Inline
  • *****
  • Posts: 915
    • View Profile
Re: Functions in Types?
« Reply #22 on: 2010-May-03 »
Why should a new feature destroy a community? I even don't think this was the reason for Blitz-Com going down. (is it really down? I don't think so)

Look! I don't like IPhone, I don't like Apple and I even don't like Steve Jobs  :P But many GLBasic users enjoy programming for IPhone. So there is no reason for me to speak against it. I just don't want to use it.

So Live and let live  :)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5028
  • O Rly?
    • View Profile
Re: Functions in Types?
« Reply #23 on: 2010-May-03 »
No way... it splitt nothing...
GLBasic are one language, and
Blitz3d and BlitzMax are two different languages!


Thats not realy OOP... you just have functions in types not more.
If you don't like it, don't use it ;)
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kuron

  • Mr. Polyvector
  • ***
  • Posts: 238
    • View Profile
Re: Functions in Types?
« Reply #24 on: 2010-May-03 »
Quote
nothing that's there is being taken out.  You can continue ploughing on like you used to.  Nobody is going to enforce the usage of new functionality upon you.
This is not necessarily true.

Quote
B.t.w.  never knew these birds have teeth like that!     Courtesy of PhotoShop?
No teeth, but they have powerful beaks and can really hurt you if they grab on to you.  Luckily, the ostriches I have been around were quite docile and playful.

Quote
why - o why did I start that at all...
It's giving me great headaches just to get the basics running again, and there's a wish list that's blowing my mind...
You have opened a gate that can never be closed.  Generally, once a language starts moving in the OOP direction, the users will never stop asking for more, as everybody has their own idea of what OOP should be.  You will never quit getting requests for new features, changes or improvements on the OOP side. 

Quote
I must admit I am a little worried about this, it all seems pretty harmless but the OOP disaster that was the conversion from Blitz3D to BlitMax, destroyed an otherwise vibrant large community.
Indeed, Blitz has never recovered. DarkBasic and PureBasic really saw an influx of Blitz users after BlitzMax was released.

OOP in indie languages almost always is a bad thing because the best industry-leading OOP languages out there are now free.  If a language implements OOP features, that is who the competition now becomes.  No longer is it an indie language trying to compete against other indie languages, it becomes an indie language trying to compete against VC++, etc and an indie language can never win that fight.

Where indie languages traditionally succeed is when they stick to their roots, stick with a simpler syntax, and target beginners, hobbyists, bedroom coders, and indie developers who are traditionally ignored or overlooked by the mainstream programming languages.

Quote
Who knows, maybe it will be a good thing but I don't see me using it personally as it adds nothing the the actual functionality of my code execution.
It adds unnecessary overhead =D

Quote
If you don't like it, don't use it
This is one of those things, where you don't have a choice.  You have to use it whether you like it or not, unless Gernot is going to keep two versions of the language going  :D  Just because you do not use a feature, doesn't mean that its code isn't compiled into the EXE.  Besides what this may add to the EXE in size, and any effect it may have on speed, will any bugs introduced also affect those not using the new OOP features?

Gernot:  Would you consider one last 7.X patch before the new features go in and we jump to 8.0?

Offline Kuron

  • Mr. Polyvector
  • ***
  • Posts: 238
    • View Profile
Re: Functions in Types?
« Reply #25 on: 2010-May-03 »
Quote
Gernot is NOT offering any OOP - he's merely extending TYPEs a bit, to allow better encapsulation.
Yes, encapsulation is a crucial part of OOP, what was your point again?  :D

Quote
there's no need to use it if you don't want it or don't like it...
The only way not to use it would be not to use GLB.  This isn't platform support, this is something that is a part of GLB whether you use it or not.  It can contribute overhead and it can affect EXE size.

Quote
Let's just let Gernot do his thing and see what he comes up with....
Unfortunately, some are not content with this,  Gernot has said he doesn't like it, but people keep pushing for it.  I call your words an intentional misrepresentation of the facts.  =D
« Last Edit: 2010-May-03 by Kuron »

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5028
  • O Rly?
    • View Profile
Re: Functions in Types?
« Reply #26 on: 2010-May-03 »
The only way not to use it would be not to use GLB

Thats wrong wrong wrong wrong and wrong!
You have NO performance loses with that methods-thing, so the only thing is:
If you don't like it, don't use it!
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5028
  • O Rly?
    • View Profile
Re: Functions in Types?
« Reply #27 on: 2010-May-03 »
Right on, SchranzOr !     :enc:

like everytime :D  :glare:
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10723
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Functions in Types?
« Reply #28 on: 2010-May-03 »
Thing is: GLBasic is BASIC. And the main purpose of GLBasic was a) easy to use and b) fast execution.
I'm not making GLBasic more complex. I just add the availability to not only have variables in a type, but also functions that you can call with a type's instance. No static functions, no overloading, no inheritance, no generics.

Instead of:
Code: GLBasic [Select]
TYPE Tvec
x;y;z
ENDTYPE

LOCAL a AS Tvec
vec_add(a,a)

FUNCTTION vec_add: a AS Tvec, b AS Tvec
   INC a.x, b.x; //...
ENDFUNCTION
 

you "can" do this:
Code: GLBasic [Select]
TYPE Tvec
x;y;z
FUNCTION add: b AS Tvec
   INC self.x, b.x
ENDFUNCTION
ENDTYPE

LOCAL a AS Tvec
a.add(a)
 

Nothing more and nothing less. And you won't convince me to add anything else now. That's really the maximum extend BASIC might go in my head.

Offline Kuron

  • Mr. Polyvector
  • ***
  • Posts: 238
    • View Profile
Re: Functions in Types?
« Reply #29 on: 2010-May-03 »
If you don't like it, don't use it!
Like I said, we don't have a choice, it is in there whether we use it or not :nana:

Quote
And you won't convince me to add anything else now.
Good news :nw: