DB,Blitz, OOP, And Syntaxes...
Miscellaneous Forums/General Discussion/DB,Blitz, OOP, And Syntaxes...
... and why, in spite of some of its more arcane commands, DarkBASIC syntax is starting to look a lil more friendlier than Blitz3D's to me... especially if you are gonna be working with TYPEs in both...
ok... ok... someone spray some mace in the direction of those guild members over there raising a ruckus... and take away their flame throwers... this is supposed to be a peaceful gathering...
i'm not trying to dis Blitz3D or start a flame war or anything... this is simply meant to be a discussion of a point of view... for mature, inquiring minds :)
alright now... first, lets look at some particulars...
1- my quest is to create an object oriented programming environment from which to make games in as simple a way as i can... using objects... but all i have is these two non object oriented BASIC dialects to work with...
2- i'd really like to be able to leverage what little experience i have in programming in BASIC and c by using one with a similar syntax... just to ease the pain of this endeavor...
3- i'm not licensing or relearning anything else right now... i've gotta use what i already have...
well... these don't seem tooabsurd so far... right... lets continue...
addressing particular #1... c is not object oriented by default, but can be made to use OOP paradigms... and since BASIC is very much like c, we are in good shape here...
what was that you said... pointers... sorry, i can't hear you over the noise from the left side of the room...
particular number #2... well, VB uses this dot notation type syntax to address object.property or object.method... hey, that's just like c... i'm already familiar with this... what about Blitz and DB...
now, they both have TYPE delcarations... we can use this to create our 'classes'...
in DB...
Type Person_Class
name As STRING
age As INTEGER
ENDTYPE
in Blitz...
TYPE Person_Class
field name$
field age
ENDTYPE
already we see some slight, though not really consquential differences, as well as a slight, though non consequential departure from the norm...
lets continue... lets declare an instance of our new 'class' in each...
in DB...
aPerson As Person_Class
in Blitz...
aPerson.Person_Class=New Person_Class
the Blitz syntax catches the unitiated a lil off gaurd... but again, no biggee...
now lets access one of the properties of our Person_Class...
in DB...
aPerson.name="Hugh Heffner"
and in Blitz...
aPerson\name="Hugh Heffner"
while DB uses the same, familiar object dot property syntax... Blitz uses something a lil... well, lets say different in it's implementation... just a lil bit uncomfortable, but definitely no showstopper...
i guess that i'm making a bit to do about very little here... just wanted to get some opinions on this as i've run into it while doing my thing over here... and to be honest, i find myself running into a lil self imposed resistance when using Blitz for this sorta stuff... based soley on what i've commented on above...
what's your take on this... and am i missing something here...
--Mike
[Off topic]I'm still wondering why you love so much those "..."
I can't remember a single post of you without those 3 dots on each line.
This is a real genuine question, I really wonder.
I swear I'm not trying to be smart and mock, but after like 3 years here, you know what it is, there are these little odd details that you just *have* to ask about.
Now that you mentioned it, I can't help but to see the dots! Although I use the dots in excess on occasion...
As far as blitz OOP goes, BMAX is by far more OOP friendly than what you're showing there!! You should turn to BMAX and use their D3D commands :)
A few years back Michael R-something-or-other wrote a translator for how Red talks. It's in the Code Archives somewhere.
and in Blitz...
aPerson\name="Hugh Heffner"
and in BlitzMax:
aPerson.name="Hugh Heffner"
Individual preference for . or \ varies. If you are a complete beginner, \ makes more sense in some ways as you can draw an analogy with folder structures. But if you have exposure to Microsoft languages (and probably many others), you'll likely know and love . as your separator. If you know C++, you'll expect to see something else again.
It's all about where your starting from and your existing knowledge (although personally I too prefer .).
@ Koriolis...
petend we are chatting instead of reading each others sentences ala traditional text messaging... the dots are pauses... not complete sentences, but more like the way we actually speak... look at it as if i was speaking, and the dots represent a pause for breath...
@ Matt... yep... i'm waiting for the official 3D module... then it'll be Blitz all the way... and DB will be deleted from the hard drives... along with a lot of other prospective dev tools...
... i have faith in the Sibly!!!
--Mike
But if you have exposure to Microsoft languages
Microsoft languages? You ought to be shot for a statement like that. How can you call yourself a programmer after saying that? How do you live with yourself?! :O
Noel: Stop browsing the web in computer lab ;)
Microsoft languages? You ought to be shot for a statement like that. How can you call yourself a programmer after saying that? How do you live with yourself?! :O
Okay, Micro$oft abominations. Rather than hang my flag on my (now outdated by .net) knowledge of VB, I was trying to be vague enough to cover all of their sins. ;)
petend we are chatting instead of reading each others sentences ala traditional text messaging... the dots are pauses... not complete sentences, but more like the way we actually speak... look at it as if i was speaking, and the dots represent a pause for breath...
Errrrr, OK. Except for me it's really the other way around: I really read you posts as real stuttering, your dots really don't make the reading more fluent. It's more like hearing a scratched disc to me. Why? Because I don't know any other people that needs 3 dots every 5 words, so guess what, I read *normal* posts as chatting. All IMHO, and the like.
... then just think of it as rap...
eeeh... ehh..ehh.. ehhhhh... ehh..eh.. ehhhhhh....
yo... word up!!!
:)
--Mike
What thread was it where somebody made up bro-ified programming syntax?
So, the only options are 2 non-OOP products.
I know virtually nothing about DBPro but could you use these for B3D...
B3D OOP Faked OOP As far as slight differences go, using Bmax after B3D was a bit tricky with the . rather than \ *BUT* I still trip up on the drawtext coords parm order.
yup... thx TG... good links...
this is where i got my ideas from a lil while back... i've wipped up something similar to this already, allbeit it is incomplete...
BMax syntax is still preferable over all...
--Mike
Okay, Micro$oft abominations. Rather than hang my flag on my (now outdated by .net) knowledge of VB, I was trying to be vague enough to cover all of their sins. ;)
Microsoft didn't create C, C++, Java, etc. -- you can thank AT&T Bell Labs, Sun, etc. for all that. So don't go calling them Microsoft languages.
As for VB, it's a BASIC variant, so once again it is not a language Microsoft invented.
All they've done is provided implementations, and lately said implementations have been top of the line.
Matt: I don't go to school or have a computer lab.
you can kiss up to the corporates Noel ;)... as for me... if i'm gonna thank anyone, it'll probably be the likes of Kernighan, Stroustrup, Grosling, and their friends and colleagues...
--Mike
> eeeh... ehh..ehh.. ehhhhh... ehh..eh.. ehhhhhh....
What the hell?!? 2 and 4 full stops?
its techno rap cheeze head... above your level of comprehension...
eehhh... eh.. eh..
:)
--Mike
Microsoft didn't create C, C++, Java, etc. -- you can thank AT&T Bell Labs, Sun, etc. for all that. So don't go calling them Microsoft languages.
So by that logic BlitzMax isn't a language? Sheesh. While I agree that microsoft products are language variants building on previous works, arguing over a pedantic mis-interpretation of a single word biased by a (valid) hatred of a particular corporate entity is not a game I'm willing to play. I only cited "MS languages" as an example as I know for sure that they use . but I don't know squat about Java / C++ / Delphi / DB / blahblahlanguage to know whether anything else might or might not use . as an accessor. goodbye dear thread.
1- my quest is to create an object oriented programming environment from which to make games in as simple a way as i can... using objects... but all i have is these two non object oriented BASIC dialects to work with...
I think you are really going to be fighting an uphill battle. I lost lots of time trying to force blitz to act oo. Even with the best intentions, and sticking to guidelines for naming and accessing things, it gets messy and hard to use, very quickly. You are manually doing, what a compiler should be doing for you. And even then, you are still hacking in a lot of stuff a real oo language would make transparent for you.
You could always write an oo preprocessor.. I thought of doing that but thats gonna be quite a project right there :)
3- i'm not licensing or relearning anything else right now... i've gotta use what i already have...
Why? I mean really... why? If the tool you use isnt cutting it anymore...
To each his own I guess ;)
Anyways regarding your syntax stuff.. I find the dot operator both easier to read and easier to type then "\", but its definitely not a make or break thing for me.
I don't like the "identifer As type" nonsense though( worse in vb though with the "dim identifer as type" ). Very long winded.
just wanted to get some opinions on this as i've run into it while doing my thing over here...
The \ syntax is taken from AmiBlitz. It's always been one of those characters that were free and available and I suppose Mark came from an Ami-asm background, rather than C.
BlitzMax uses .
petend we are chatting instead of reading each others sentences ala traditional text messaging... the dots are pauses... not complete sentences, but more like the way we actually speak... look at it as if i was speaking, and the dots represent a pause for breath...
Punctuation is there for the sole purpose of providing pauses for breath. One full stop is adequate, along with commas and semicolons (although the use of the comma in your above sentence was unneccessary). As a side note, Amiga speech translated ... as 'and so on'.
its techno rap cheeze head...
Wouldn't that be more like 'one, zero, zero, one, one mother@#!*in' one'..?
@ Orca... you're probably right... about that uphill battle thing...
as far as not licensing anything else right now... i've already got licenses for B3d,DBPro,DB,3DRAD, Torque, TV3D, 3Impact... and still not finished one game in any of em yet... i think it's time i started to excercise a lil self control...
... i'll treat myself to a new toy after i write something.
@ Toby... punctuations are there to help enforce a standard... period... if you believe otherwise, then you probably also believe in the tooth fairy, wmds in iraq, and the force...
i speak the way i want... if it bothers you that much, then i suggest you move on to the next post... where all the spelling and grammar is written in a manner that fits very neatly into your single dimensional view of how the talking monkeys should comunicate...
... and be happy.
--Mike
i think it's time i started to excercise a lil self control...
Y'think? You old men and your senility never cease to amaze me O_o
yeah... wisdom has a way of confounding the young and naive...
it's understandable...
--Mike
Forget about trying to make blitz3d OO, just write a game the way blitz3d intended. Its not really going to make THAT much of a difference if you have to do this:
select v\vehicle_type
case sub
Move_sub(1)
case truck
move_truck(1)
end select
instead of using a method:
move_vehicle(1)
Noel did you get your GED? XD
I dont mind Blitz's quirky way of doing things when creating types, but I would prefer to use dots than slashes when acessing a type field as that make for more readable code (personal opinion) onscreen throughout the source file, creation is only done every now and then so conforming to Blitzisms is not an issue.
I never programmed much before I started using blitz, so the slash notation is perfectly natural to me. And I don't have any trouble switching to dot notation when I need to; I have since done work in languages that denote objects that way, and it was never a problem.
Personally, I have bigger difficulties with other aspects of the syntax. For example, I like how BASIC languages don't complicate If statements with brackets and such, but it can be confusing when your condition and statement are all on one line.
I think brackets purely pwn the basic styled "end if" etc. I'd prefer the use of brackets over having to use end function, end method, etc, etc.
What makes blitz so great is that it comes with loads of easy to use functions.
but it can be confusing when your condition and statement are all on one line.
If it's a particularly nasty IF/STATEMENT I started to use the '..' to split the line but then found it harder to check for missing 'endif'.
I still might use if/endif for single statement if the condition is quite long.
Yeah, I usually use if/endif even for single statements because it's easier to scan over the code and see what's going on.
I dont mind Blitz's quirky way of doing things when creating types, but I would prefer to use dots than slashes when acessing a type field as that make for more readable code (personal opinion)
I agree. I definitely prefer this:
If (x / (2 - obj.Value) / obj2.x) Then
over this:
If (x / (2 - obj\Value) / obj2\x) Then
- because when you use anything similar to a backslash (like the divide symbol) it gets really confusing.
i speak the way i want... if it bothers you that much, then i suggest you move on to the next post...
I agree. I rarely even notice things like this, and it definitely doesn't bother me. The "..."s are his style of writing and I am certainly not going to criticize it.
Anyway, back on topic:
In Blitz:Function Update(person.TPerson)
In DB:Function Update(person As TPerson)
^--
ERROR!!! DB cannot pass types to functions (
Note: This may have changed since I last updated DB, though)Red: If you are concerned about OOP, doesn't DB's usage of
numbers to represent meshes, images, textures, sounds, etc. bother you more than anything else? That is one of my most disliked "feature" that DB has. IMHO, it is 100% counter-intuitive and anti-OOP.
Anyway, good luck with your sub game :)
I know I am in the minority, but I have always preferred DB's syntax over Blitz's.
JohnJ... yes, it did bother me... but, my lil OOP system in DB makes the number thing an abstraction... i never wind up using numbers...
and example...
i have a GAME_ENGINE type and a GAME_OBJECT type...
one of the fields in GAME_ENGINE is ObjectCount...
whenever a new object is created, it fetches the next available ObjectCount (integer) and assigns it to whatever i am creating... and ObjectCount is incremented for the next new GAME_OBJECT...
therefore... i can write my code like this now...
myMustang As INTEGER
myMustang=CreateCar("c:\models\mustang.x)
the object number is now referenced by the integer var myMustang, and i never have to deal with object numbers...
--Mike
i speak the way i want... if it bothers you that much, then i suggest you move on to the next post...
All I did was correct you when you shot someone down for correcting you. If I cared I would have brought it up sooner. If you want to be naive about it be my guest. No need to become to agressively defensive though. It almost seems like I hurt your feelings or something, sheesh.
All I did was correct you when you shot someone down for correcting you.
sorrry... i apologize...
try and understand... i'm really not trying to be grammatically correct... put yourself in my shoes for a few minutes...
... would you like someone who is certainly not an english teacher, and who also makes grammatical and spelling errors in the posts they make here... errors which, by the way, are not singled out or highlighted...
... would you like them to be making a point of your poor typing or grammar.
also... i'm writing a lil code on another machine... and doing a bit of modelling in TrueSpace while i'm chatting away here...
you mighta caught me right when TrueSpace decided to crash after 15 minutes worth of fine tuning a set of vertices without a save...
... again, i apologize.
--Mike
i'm really not trying to be grammatically correct...
I know and like I said I don't care =] A lot of people have their cute little mannerisms. It's all good... makes the world go around and all that fluffy cr*p.