Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Does TGC-guys have a plains to create kind of Objective-Basic in TIER1?

Author
Message
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 10th Oct 2014 00:51
Does TGC-guys have a plans to create kind of Objective-Basic in TIER1? I mean using classes like c++ for example. That would be fantastic feature for the complex projects!
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 10th Oct 2014 01:06
...and probably involve a complete rewrite of the core system.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Oct 2014 12:17
Wouldn't that be very similar to Tier 2?

Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 10th Oct 2014 14:23
BatVink, no! Cause first - this still would be a BASIC, second - power of OOP with a Broadcasting feature!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Oct 2014 15:13
i think everything in possible but it need much time and will be expensive.
also u need think about backward compatible.

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 10th Oct 2014 15:29
Because of UDT's we have the first step of OOP already. Would be awesome to be at least able to point a field of a UDT to a userd defined function as an ALIAS. And a local self variable pointing inside the function the calling UDT.

Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 10th Oct 2014 16:02 Edited at: 10th Oct 2014 16:09
Markus, I don't think it's too difficult to do. This must not be a pure OOP, it all can be done by kind of namespaces(c++ structures, for example) with different access levels to its data.

This should be only for the code organization, not for the compiler!!!
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Oct 2014 16:33
The bottom line, if you need an object orientated language, use an object orientated language - BASIC is not that language!
From the very core of BASIC functionality, OOP is not a good idea, it actually makes BASIC more difficult to learn than a proper OOP language like C++.

Like that Visual Basic and the way that merged into .NET and frankly died a death. What is the point in learning an OOP BASIC if learning C++ etc is just as easy! - why would anyone turn their back on the millions of posts, articles, free resources and support that an established language has.

Anyone with reasonable programming experience can easily learn C++ - when it comes to game programming, it's specific game programming techniques that are important, not language syntax. I'd say the way TGC have split AppGameKit into BASIC and C++ tiers is ideal.

I am the one who knocks...
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 10th Oct 2014 17:49
The bottom line, может быть... может быть... Просто как идею предложил. Вовсе не обязательно на этом строить весь Tier1, но если есть такая возможность - это не есть плохо!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Oct 2014 22:06
My ideal scenario would be to use C#. This is a lot of Unity's success, being rooted in Mono.

But I'm realistic. Tier 2 is object oriented for serious programmers. Tier 1 is Basic for hobbyists and newcomers. The spectrum of programmers is covered.

Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 11th Oct 2014 17:03
BatVink, it's true - C# is the most beautiful language I know...
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 11th Oct 2014 19:24
C# is nice because it was created by Anders Hejlsberg, who designed Delphi. Personally I prefer Object Pascal for readability and cleanness. There are many similarities between the languages.

I agree with BatVink that it would be a big job. C++ and Object Pascal reside firmly on the original non-OOP languages, but the extensions are vast and significant. You have all sorts of things to consider, such as creating objects on the stack or the heap, constructors, destructors, polymorphism, inheritance, virtual functions, interfaces, anonymous functions...

Basic, and AppGameKit, are suitable for small programs. They don't need the added complexity of OOP. But when we come, as we often do, to talking about plugins - that's when OOP would massively simplify things.

However - AppGameKit wasn't designed like that. It has always tried to be a "beginners" language. It's my opinion, which others on here violently disagree with, that Basic is now a terrible language for beginners: it gives you very little help at compile time, and the most trivial errors can pass unnoticed; it has no concept of structure; its loose typing can deceive the eye into missing bugs a better language would catch*.

If you want to write big programs, use C++ or Pascal. You will probably then only use AppGameKit as a good graphics engine, which it is.

* Example:

In line 10 you write name$ = "Fred"

In line 21384 you write names$ = "Vera" although you meant to use names$.
On the screen, the name$ doesn't change, because you have mistakenly created a new string. Oh dear. This would never happen in C++ or Pascal - the compiler would refuse it.

-- Jim - When is there going to be a release?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Oct 2014 20:50
Jim, if you use #option_explicit at the start of your code it forces you to declare all variables which massively reduces the possibility of errors like that. I'm using AppGameKit this way all the time at the moment.

Yes, AppGameKit Tier 1 is best for small and simple applications and most people using Basic are writing that kind of application including me
IronGiant
AGK Bronze Backer
12
Years of Service
User Offline
Joined: 27th Feb 2012
Location: the great state of madness
Posted: 11th Oct 2014 22:27
Ahhh, the Old OOP C# or C++ or LUA or Pascal is better than Basic argument. Seen this battle on Blitzbasic's and Purebasic's site also for years.

Look, some OOP is ok, but when you start getting into classes , Methods and all the rest of the hair pulling stuff OOP comes with. well you do not have Basic anymore. And all you're left with is a language that confuses and causes people to keep manuals close by to see why their pretty classes aren't functioning the way they should. or you have to explain to newcomers what the difference between a class and a method is.

And Basic has done just fine for the last 50 years or so. We already have user defined types and maybe add overloading, and for the love of god, some kind of inline integer data would be nice.

But I do not want a Pascal/C# type language. if I did, well I'd use Pascal or C#, I dont., and the very reason is it takes me 5 times longer to debug a OOP language than it does any of my Basics I own.

And I do javascript also, so I know the uses of Classes and Methods quite well. But just as I do in AppGameKit, in Javascript I use mostly functions for my own calls, and so do most people I know, now sure when dealing with the DOM you basically have to drop down into class and method mode.

as in canvas1=document.getElementById('canvas')

but a function as in lets say, function canvas1=ReturnCanvas() would work just as well if it was part of the Javascript language system.

I think AppGameKit is great just the way it is in the coding department but I also understand people wanting to use OOP, but not I.

And No, Basic is not for Hobbyist or Beginners anymore. Basic has grown to have way more functionality than its predecessors did. Hell go look at Atari Basic and then come back and have a look at AppGameKit or Purebasic, Or darkBasic for that matter. Worlds apart in what can be accomplished with these new Basics.

And as stated, use the C++ version if you're into classes and all that, it's there too, just please let us Basic programmers have our language clean and pure, you dont see me tryin to change Pascal for the better. And there are parts that could use some improving, like readability for one.

Peace out..., now go program that killer game. we'll be waiting...

It's Bird! , It's Plane!, No its a rocket powered Squirrel holding some acorns and a smile!
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 12th Oct 2014 00:12
I did say people would violently disagree.

Any idea that it takes 5 times longer to debug an OOP language is, frankly, utter rubbish! I'd like to see a calm, reasoned explanation for that.

-- Jim - When is there going to be a release?
IronGiant
AGK Bronze Backer
12
Years of Service
User Offline
Joined: 27th Feb 2012
Location: the great state of madness
Posted: 12th Oct 2014 02:31 Edited at: 12th Oct 2014 02:32
First off Jim..., I did not Violently disagree. Trust me, You'd know when I get violent.

But anyways. My opinion is that OOP makes even simple programming tasks way harder to code in the first place , and then to change and deal with bugs later on.

Just read this article I have posted a link too about a man that used to program in OOP and switched to Procedural langauges because as he puts it, He was spending more time trying to write code perfectly in OOP than actually getting any coding done at all...

http://purplepwny.com/blog/object-oriented_programming_sucks.html

All one has to do is Google "OOP sucks" to see tons of people that either Hate OOP or tried it, and found it confusing and complicated. I always thought the idea was to make languages easier to code in as time marched on, not harder?

OOP languages make the simplest of tasks harder. Just try making your own print functions in AppGameKit,I have an example of a character drawing function to a MemBlock.



Even without the rest of my code this belongs to you can pretty much understand what is going on.

Now I'm not even going to go into what it would take to pull this off in an OOP based languages. The number of classes, Methods and data I would have to have predefined to make it all come together.

I'm sure you, Jim could convert it to his favorite Pascal and show everyone how much more complex it would become.

Look, if creating way more code to achieve the same functionality as a Procedure based language takes to do the something so simple , is your cup-o-tea , then have at it.

Myself, I like to code in as simple a way as possible. and if you want a Demonstration of how powerful and easy a Procedural language is, then fire up AppGameKit Basic tier 1, or Check out DarkBasic Pro and the games made with it, or Blitzbasic, which has an amazing amount of games written in it, Or Purebasic and it's blazing fast speed and the fact its own IDE is written in Purebasic its self.

I have no problem with anyone using OOP, go for it, just leave me my Basic. There is a reason Basic has lasted 50+ years, because its Fun to program in , So easy to follow the code , Gets the job done , and Todays Basics are compiled , so they are very fast.

And sure, you can take a few ideas from OOP languages and insert them into AppGameKit, but leave the Soul of Basic as is,

It has being doing fine without much OOP influence and I dont see AppGameKit needed much more in the Object Oriented Department.

And most Basics, and I keep going back to Purebasic, have enough OOP for me to last a life time. As I stated put in a little, but dont change it completely to C# , AS3, Pascal or any other OOP language. we have enough of those. want one? go find one, I hear AS3 is making a comeback!

And if TGC made an offshoot of AppGameKit with OOP, I would not care one bit, long as the Basic version Tier 1 was there too.

Nuff said, have fun coding and dont forget to save before closing, kidding.

It's Bird! , It's Plane!, No its a rocket powered Squirrel holding some acorns and a smile!
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 12th Oct 2014 11:13
Quote: "Now I'm not even going to go into what it would take to pull this off in an OOP based languages."

You should have done it. It wouldn't be much different if it was designed right. This is how your code could look in a OOP kinda language.



But don't worry TGC won't open up AppGameKit for this. I would bet money on it. Not that it matters anyway. There are Non pascal/C++ solutions out there already. It is just... AppGameKit has an awesome SDK. Why I don't use C++? Because I don't wanna fight more with the linker than with the codedesign myself. I love pascal but both are not that much of crossplatform tools.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 12th Oct 2014 12:46
IronGiant - I read that guy's piece. He makes some valid points, but also make some totally spurious assumptions. He says he's written beautiful code. I doubt it.

If I rewrote your function in Pascal it would be much the same. I don't quite get what it's doing, so it may be less clear than you think.

However - it's a totally inflexible tool for extracting the data from the image because it utterly assumes an image of fixed-pitch 16x16 characters of width 16 in a 16x16 grid. It is littered with constants like 16, 15, 14 1024, and therefore a good example of what not to do.

I assume that you want to create a memblock from a string, so that all the assembly of character bits doesn't have to be done again. It doesn't have to be OOP to do this even using an OOP system. There are places where objects are the solution and places where they aren't. For example, an encryption procedure does not need to be an object or in an object. You have the choice.

It wasn't me who started this thread, and I've said that I don't think it's practical to bolt OOP features onto AGK. I'm slightly Darwinian. Let people find out the hard way that they need a more powerful language.

-- Jim - When is there going to be a release?
IronGiant
AGK Bronze Backer
12
Years of Service
User Offline
Joined: 27th Feb 2012
Location: the great state of madness
Posted: 12th Oct 2014 17:38 Edited at: 12th Oct 2014 17:54
My point was, and is, that there are plenty of, Me too OOP languages out there. And if I wanted to use Classes, Methods and all that, I would still be programming in Java. I do program in Javascript , but as I stated, I mainly treat it as a function based language on my end of the coding spectrum.

There is nothing wrong with OOP if thats what the person is used to coding in, or likes. And there are Pascal and C++ ways already in AGK. So I'd like to keep the Base core of AppGameKit Basic, basic in its design. Its easy to learn, and easy to master. and you dont have to study your butt off till you get how Functions work, as I had too when I first tried to sort out the relationship and differences between Methods and Classes. Sure I get it now, the dot " . " separators and all that implies.

But almost anyone can pick up Basic and run with it. Sure AppGameKit can use some OOP behaviors, as in UDT's and I'd like to see the ablity to put default values to variables in function declarations as in
Function MemPrint(pstr$,x,y,mode=1)

But you slap on too much OOP and you have AS3 or Java. I didnt sign up to the AppGameKit Army for those languages, my weapon of choice is Basic if you please...

This is my rifle..., this is my gun...this is for fightin..., this is for fun...

I came for Basic, and yes I may get a bit defensive about people tryin to take Basic and turn it into one of those other languages. But thats because I always felt Basic has been given a bad rap all its life and its about time people realized AppGameKit, DARKBASIC PRO and other basics are not your Grandfathers Basics. these are powerful languages capable of doing anything you can do with an OOP based language,

I worry more about speed increases in the compiled code more than I want more Stuff added on top of AGK. I think it would be nice to see AppGameKit running almost as fast as C++ code , wouldnt you?

Anyways, about my code, StrMemChar(), named so, because a draw String function calls it, I have one for single characters too named MemChar().

StrMemChar(),its the underlying function to a print string command and I also have MemPlot() , a dot plotter and MemLine() , line drawing to a MemBlock and developing more, for my own uses.

I wanna use a MemBlock as basically a Canvas like you do in Javascript and then pump it too a screen sized sprite, which I already have done in my own code. Then the code no longer has to keep drawing lines to the screen, its already drawn to a MemBlock once and then put to a Sprite. still a work in progress. Oh and yes, 16x15 seems to be the magically number for the ASCii.png file. I can also redesign the characters to be anything. Just like back in the old days with character set graphics. Just an experiment. to see what i can do with MemBlocks. Just wanted to use my own code and not someone else's to show how easy Basic Code is.

Now back to coding , till they Make a version of AppGameKit that programs apps for ya, I can wait...happy programming , beep beep!

It's Bird! , It's Plane!, No its a rocket powered Squirrel holding some acorns and a smile!

Login to post a reply

Server time is: 2024-11-25 10:54:20
Your offset time is: 2024-11-25 10:54:20