[ANTRAG] Methoden in Types

Previous topic - Next topic

trucidare

Hmm ich glaub ich hab vorhin vergessen Absenden zu klicken ;)

Also nochmal ich wünsche mir Methoden in Types:

Code (glbasic) Select
TYPE moop
     a
     b$
     
     METHODE Create()
           _list = NEW List
     ENDMETHODE

     METHODE Add()
           ADDLAST(List,_list)
     ENDMETHODE
ENDTYPE
aufrufen dann mit moop.Create() oder moop:Create().

na wir wär das?
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

Kitty Hello

Hä!? Ich hab geantwortet:
Nein, weil das für den GPC so unglaublich viel Stress bedeuten würde. Ausserdem finde ich:
TYPE moop:

ENDTYPE
FUNCTION MoopCreate: m AS moop:
ENDFUNCTION

auch nicht komplizierter. Und Vererbung wird es eh nie geben. Da tick ich voll aus.

WPShadow

Danke Gernot!

Damit erleichterst du den "Prozedurialen" das Leben ungemein!!! ;)
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

trucidare

Aber Vererbung ist doch sooo ein einfaches thema ;)
Nunja egal war ja nurn vorschlag hehe
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

sechsrad

QuoteAber Vererbung ist doch sooo ein einfaches thema
was nützt es das wenn es einfach ist, aber saumässig viele ressoursen kostet.

kostet nur erbschaftssteuer, also lassen wir das.

mfg

bigsofty

Ich bin gegen Methoden in den Arten, seinen ein Schritt in Richtung zu programmierendem OO, das in grundlegendem ein Niveau der Kompliziertheit hinzufügt, das weg vom Puting zum kompletten Anfänger sein kann. Betrachten Sie BlitMax, sein so gutes wie weg von der beträchtlichen BlitzBasic Gemeinschaft getötet, die für meinen Deutschen traurig ist.
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

@bigsofty: Häää? Nach zweimaligen Lesen hab ich den text noch immer nich verstanden ;) aber ich weiß was du sagen willst.

EDIT:// Google übersetzung ist böööööse ;)
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

Kitty Hello

Ich glaub er wollte sagen:
1. Er ist dagegen, in Richtung OOP zu gehen, weil das zu BASIC zusätzliche Schwierigkeiten hinzufügt. Das könnte Anfanger von GLBasic wegziehen.
Beipsiel BMax: scheint alle deutschen Entwickler von Blitz abgeschreckt zu haben.

.. oder so :D

trucidare

Das problem gerade bei der spieleprogrammierung ist es das oop ein sehr hilfreiches mittel ist. Klar es ist zwar nicht so einfach aber ein kompromiss könnte man schaffen. ich weiß nich ob du die types mit structs oder mit classen machst. mit classen da würde es gar nich so schwer sein den kram umzusetzen.

nunja nevermind.

schranzi - bitte tread schließen ;)
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

Schranz0r

Hier der Nachtrag aus Gernots Antwort aus dem Englischen Forum :D

Trucidare du Schlawiner du :D

Quote from: GernotOh no!. Hast Du eine Ahnung, wie viel Arbeit das inerhalb meines GPC bedeutet? Ich find's auch nicht soo wichtig, weil:

TYPE TAuto
   METHOD Hupen:
   ENDMENTHOD
ENDTYPE

oder:

FUNCTION Hupen: A AS TAuto
ENDFUNCTION

eigenltich nur anderer Stil ist, oder?
Und Vererbung... vergiss es
Andere Thema würde gelöscht...
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

trucidare

Ahh nun weiß ich wo mein erster Thread abgeblieben ist ;) hab schon gedacht ich bin nich ganz fit im kopf.
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

Schranz0r

Hätte da nen anderen Vorschlag :D

Mit Funktionen:

normal gehts so:

Code (glbasic) Select
TYPE test
X
Y
res
ENDTYPE

LOCAL tests[] AS test
LOCAL t AS test

t.X = 10
t.Y = 20
t.res = Add(t.X,t.Y)
DIMPUSH tests[],t

WHILE TRUE

FOREACH t IN tests[]
PRINT t.res,10,10
NEXT


SHOWSCREEN
WEND
END


FUNCTION Add: x, y
LOCAL res
res = x+y
RETURN res
ENDFUNCTION
Mein Vorschlag wäre:

Code (glbasic) Select
TYPE test
X
Y
res = Add(X,Y)
ENDTYPE

LOCAL tests[] AS test
LOCAL t AS test

t.X = 10
t.Y = 20
DIMPUSH tests[],t

WHILE TRUE

FOREACH t IN tests[]
PRINT t.res,10,10
NEXT


SHOWSCREEN
WEND
END


FUNCTION Add: x, y
LOCAL res
res = x+y
RETURN res
ENDFUNCTION
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

bigsofty

Mein Deutscher saugt grosse Zeit! :D
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)

Schranz0r

Pls post in english, thats terrible :D
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

bigsofty

Hehe, 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
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)