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.

DarkBASIC Professional Discussion / [LOCKED] Criticisms of DarkBASIC Professional

Author
Message
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 30th Sep 2009 06:39 Edited at: 30th Sep 2009 14:18
I've recently been doing a lot of programming in decent languages(C++, lua) and my eyes have been opened. After coming back to DBPro to write a small example I noticed many limitations with the DBPro language that just make no sense and do nothing but impede development time and make using the language much harder for many users, especially beginners.

I will break this thread down into two sections, the first is what I deem to be issues and/or limitations of the language that are arbitrary, stupid or just shouldn't exist, the latter are issues that aren't required but would otherwise improve the language a lot, while keeping it within the spirits of BASIC.

Keep in mind, while some of these issues can be worked-around, or otherwise hacked in using various plugins people have written, I won't mention them because all of these features should be part of the core language, also, using work-arounds impedes learning and development time so it doesn't make much sense to suggest them over having the core language improved. Now for the first list:

1-1) Lack of arrays in UDTs

This is an obvious one, it's been banged on about since day one. Allowing arrays in UDTs would make so much code far easier to implement and read, very often you see users asking about how to implement various features where using this(if implemented) would be the logical answer. You also often see new users who have followed tutorials on variables, arrays and the like, learn of UDTs they try and incorporate arrays into them and are hit by this arbitrary limitation and must learn some far more involved methods of working around this limitation or use very inefficient methods such as using a 2D array to work around this.

Example:


1-2) The inability to return a UDT from a function

Yet another UDT based limitation, this shouldn't need a long explanation as the name says it all. There is no reason why you shouldn't be able to do this, every language I can think of that supports UDT/struct/class style objects has this ability and not allowing it is just arbitrary and detracts from development time.

Example:



1-3a) Global variable declarations have to be 'executed' for initialization to happen

For example, the statement 'global var as integer = 1337' is only initialized(the value being set to 1337) once the statement itself is stepped-through. For purely literal assignments this limitation makes no sense, and the above statement isn't the same as declaring the variable and assigning whatever's after '=' to it. This limitation is particularly annoying when dealing with multiple source files, as you want to somewhat separate the files but you find you must create a special routine to initialize these variables as they are likely never stepped-through.

Example-Main.dba:

Example-MyInclude.dba:


1-3b) Global array declarations have to be 'executed' for initialization to happen

Before you say crazy stuff like the compiler has no idea what size to make the array as you can have multiple 'dim' statements, I am fully aware of this. The issue is that once you call 'dim something', the array itself is never created until 'dim' is run. Thus if you have multiple source files and you have 'dim something' at the top, the array isn't actually accessible until you step-through this line, or one like it. This again makes no sense and forces another initialization routine, by default arrays should have a size of -1(no indices) and only once you run a 'dim' with a different value or you add an index should this change. At present you get a completely unintuitive error that the requested index doesn't exist(it reports as having an 'array count()' of 0). Who knows, perhaps this is a bug, but it's still very similar to 3a and is still a limitation. Perhaps this could be fixed by implementing 'dim' and 'redim', 'dim' can only be called once for each array, that would at least make more sense.

Example-Main.dba:

Example-MyInclude.dba:


1-4) The inability to pass UDT data from an array to a function

This limitation makes even less sense, you can pass the contents of arrays that use any of the basic types to a function and you can assign the contents of any kind of array to a variable, but you can't pass a UDT array's contents to a function??? This limitation is again totally arbitrary and does nothing but impede development and confuse beginners.

Example:



1-5) The lack of a distinct 'elseif'/'else if' statement

While you can do separate 'else' and 'if' statements to work around this limitation, this requires you to close the new condition with an 'elseif' which can easily lead to a long line of 'endIf's which is very unintuitive to look at.

Example:



1-6) Inability to do complex statements on 'exitFunction'/'endFunction'

The inability to do something like: 'endFunction something * 5' makes little sense in many cases, I could understand if DBPro was strict about data types as such a return might be ambiguous as to the type you wish to return, but in many cases it should be obvious by what variables you use in the statement, and any truely ambiguous statements should flag a warning. Thus this limitation makes no sense and just adds needless lines to your program.

Example:



1-7) No function overloading

Function overloading is where you can declare multiple functions that bare the same name, but their arguments(variables passed to them) can either differ by data type, amount, or both. This feature is already present in the default command set and plugins, i.e. 'position camera X, Y, Z' or 'position camera ID, X, Y, Z' thus I see no reason why it isn't present in the language itself.

Example:




And now for a list of less-important features that should be added to make development time faster, but don't exist for some apparent reason:

2-1) Lack of option explicit

Some users believe the ability to randomly use variables without declaring them beforehand is a feature, while this may be true, you should also have the ability to disable it as it can very quickly lead to issues that are very hard to debug.

Example:



2-2) Vectors and matrices aren't basic types

Both of these concepts are heavily used in game programming among other fields, but their implementation in DBPro is terrible to say the least. In addition to being basic types they should support the basic operators like addition, subtraction etc and generally behave somewhat like they do in HLSL.

Example:



2-3) No methods in UDTs

UDTs are nice and all, but they are still very limited when you wish to alter their contents. Methods are essentially functions that are bound to an object, a UDT in this case. Just like you can access a variable in a UDT using: 'myUDT.someVar = 5', with methods you would be able to have: 'myUDT.someMethod( 1337, "hello" )'. In addition to this, you would be able to access the local variables within the UDT as if they were global variables, this greatly allows you to encapsulate functionality and saves you from having to write a list of global functions that alter a UDT's contents.

While you can do similar to this using functions that take UDT input and... once implemented to the language can output them, one distinct difference is that because DBPro lacks references you can't(without using more hacks) have a function that outputs something like a boolean to indicate if the routine succeeded because the return type would be of your UDT type, unless it doesn't modify the contents. However there are enough instances where this would be an issue to warrant their implementation.

Example:



2-4) No references

References are data types that act just like normal data types, except they merely reference a separate, existing variable. Think of them as 'instance object', except when you alter the instance, or reference in this case, you're altering the original. Thus any changes you make to a variable from a reference essentially propagate to the original and anything else referencing it. Such a feature is very important if you want to support multiple return values, for example: you could create 2 variables, pass them to a function that accepts 2 variables of their type that are references, and when the function modifies the input reference variables they will alter the ones you declared before calling the function, thus the function essentially just returned 2 types. There are other uses for this feature as well, this is just the tip of the iceberg.

Example:



There are probably many more issues I neglected to mention, but these are the ones that stood out that I could think of. If you have more then feel free to post, if you have an objection to any of the posts then feel free to post too, just make sure you read the whole point first.

Also remember that this list is mainly aimed at the issues/limitations of the core language, I could easily rant about the poor: compiler, editor, help files, default libraries etc, but this topic isn't the place for that(maybe a sequel?).

Lastly, I'm aware that these features are present in most other languages, such as C++ with GDK, but still, these features are incredibly important and implementing them wouldn't add complexity to the core language as you would still be able to write the same old code. I'm not asking for this language to be made into the next C++, C#, Java or whatever, but most of these suggested features are so obvious and have been implemented into so many languages you just have to wonder why they aren't in this one. DBPro is touted as being a simple language, ideal for people who want to get into game programming, but many of the limitations mentioned above just impede development time and confuse would-be developers, they may even turn them away if they're told this is the easy solution and find aspects of it make no sense, so hopefully some of these get implemented at some date.

Thanks for reading.

[edit] added one more, and some examples.

Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 30th Sep 2009 12:18
Now this is the sort of post I like to see, because you actually approached the criticisms in the right way. The only point I can see there that wouldn't be of use to me would be 1-6.

veltro
User Banned
Posted: 30th Sep 2009 14:23
IMHO what DBPro lacks is modularity

As an example let say you use your false/true constant to increase source readibility



You can't write it in a separate .dba files, cause DbPRO appends includes at the end of the main source files

So you need to write this little piece of code every time in your main .dba file

This little example could be easily extended to other cases, where you have source code that can be shared by different programs

The solution is to have modules with a well defined scope visibility rules for variables and functions, like many modern languages do

By the way the concept of modules where investegated,developed and implemented more than 30 years ago.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 30th Sep 2009 14:55
Wonderful post, now let's place bets on how many people post things such as "you can create workarounds for all these things" and "these don't stop you from creating a game", completely missing the point of this thread.

I agree with all of the points listed, especially in the first section. I've been attempting to develop something in DBPro recently after using C++ for a long time and I've found that development is being bogged down due to having to create workarounds to the modularity I'm used to. It's ironic that it's taking more time in DBPro considering I've always thought of it as quite a RAD language.

For me the biggest issues are the lack of arrays in types (meaning I have to create some functions to simulate this, but due to the lack of modularity I have to do it for each type that uses an array!), and the inability to return a UDT from a function. The latter of which is usually a basic requirement for a type system.

I'm not sure if Lee wants to continue developing the language and compiler, but if so I'd be pleased if he took a look at some of the popular scripting languages, such as Lua and Unreal Script, as there are many features which can improve development time and management of code, particularly in areas of game creating.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Sep 2009 15:10
I'm not disagreeing with any of the points raised, but I'd like to remind you all that DBPro is a BASIC language, most users won't be bothered by these issues until it hits them, IF it hits them.

I could do with some expansion on types but it's not a show stopper, the speed at which things can be developed largely makes up for these shortcomings IMO. What I would like to see is someone from TGC telling us what is happening with the future of DBPro, it can't expand to include these more advanced features without a clear path. I expect though that these additions would take a lot of re-working the data handling stuff, which is just not easy in the case of DBPro, otherwise we might have arrays in types already. There's a big difference between returning a variable from a function and returning a typed variable - same goes for handling an array compared to handling an array bound to a typed array. Quickly becomes very complex I think, maybe too complex to consider changing.


Health, Ammo, and bacon and eggs!
nitrohaze
20
Years of Service
User Offline
Joined: 21st Apr 2003
Location:
Posted: 30th Sep 2009 15:37
I dont often post but.....

I work all day, I enjoy developing software.

DBP gives me instant gratification, or allows me to develop substantial apps easily over a long period of time.

It has a few shortcommings, and the points above are valid. But I suspect that many like myself have little time to sit down and develop as we would like to, with the demands on already precious time.

I would however like to see a roadmap for the product, but Im more than happy with it. If I wasnt, I wouldnt use it.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 30th Sep 2009 16:18
The pot is brewing! This isn't the first post complaining about the language, but it is the first post I remember which lists everything clearly and objectively. Well done.

I agree with all of your points, except I think 2-3 and 2-4 would complicate the language beyond what DBPro is intended for. I mean, we get posts asking about how to register mouse clicks, can you image the posts about why is method X() failing inside this UDT? Besides, something tells me the language will never change (unless there is a completely new language made).

One reason why TGC probably doesn't feel the need to change the language is they already opened up the 3D engine and various commands to your favorite friend C++. Someone wrapped it for C#.NET and VB.NET.

Another reason is simply there isn't much $ in selling a programming language. They can develop iCashIn type apps in a week and make plenty of $. Who knows what their next Gamemaker type product will look like, it will probably be big. That's where their energy seems to be going.

For your more OOP requests in your post: Why ask for DBPro to change its syntax so you can access the 3D Engine in a way you'd prefer, when they've already opened up these avenues via DarkGDK and DarkGDK.Net?

I'm not a real programmer but I play one with DBPro!
JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 30th Sep 2009 16:57
As a software developer for 25+ years, I've experienced and created corporate and games from 6502 and 8080 assembler, gw-basic, turbopascal, delphi to C++. Each one has its own limitations.
With the introduction of Delphi I learned something: RAD or Rapid Application Development means that you can skip a lot of development time by using someone's work.
In the case of delphi, the libraries and VCLs are premade programs.
Gamemaker is a RAD tool too. Even C++ libs and DirectX are premade, as well as 3dGamestudio routines.

All pre-made programs will have something you don't like or is not optimized as you would have done, but nevertheless you save time. A lot of time.
TGC products are RAD tools indeed. FPSC, DB, DBpro. Not perfect but they deliver fast. They lack a lot of features, but their strong point is their rapidness. They are great for learning too. But they are not the only kid in town.

As an electronics and software engineer my work is to find solutions and get the best of the tools I have. If one is not able to do it, I will use another.

If you get to the point where you can play a more complicated instrument and feel more comfortable, great! But don't forget the target market for TGC products.

Bottom line: On these "babel tower times" of programming, DarkBasic Pro is a nice language to speak easy. Wanna do Shakespeare or Oxford? Probably use another tool, but you will need to learn more. And pay more...

I purchased Torque software and discovered that I have to pay 5k+ bucks per title published, unless I advertise them, on which case the pro license is more than 1000 bucks. And their scripting language sucks!

May the 3d force B with U
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 30th Sep 2009 17:11
Quote: "There's a big difference between returning a variable from a function and returning a typed variable - same goes for handling an array compared to handling an array bound to a typed array."


Perhaps DBPro has some really crazy implementation that makes this hard to do, but in theory it's very simple, especially the returning of UDTs; like variables they are just blocks of memory and all that needs changing stack-wise is the amount of data copied. Of course the compiler would also need to be changed to accommodate this, but really, how badly can it be written?(don't answer)

Quote: "Besides, something tells me the language will never change (unless there is a completely new language made)."


Indeed, and it's a shame.

Quote: "Why ask for DBPro to change its syntax so you can access the 3D Engine in a way you'd prefer, when they've already opened up these avenues via DarkGDK and DarkGDK.Net?"


Because DBPro is good... in theory. I would like to use it for what it's intended for but it's just faster to use C++, these points are just observations about the limitations of the language, I couldn't really care less if they ever get implemented or not as I won't be using the language for anything serious. But the same doesn't go for other users, others may not know other languages thus may not know what they're missing out on, they may not have even conceived of some of these features or had a second thought over these limitations. As I've used both DBPro and C++ quite a lot, I can clearly see the issues with both and I know what features are arbitrary, make no sense and otherwise impede development time and posted them here. These features are for the benefit of other users, and to new people who want to learn this language rather than jumping into the deep end of C#, C++ etc, currently DBPro is the shallow end with random poles sticking out of the floor for no reason making it hard to swim.

Also remember that I could have suggested function pointers be implemented, operator overloading, data hiding, libraries etc but they aren't really things that would speed up development time much, plus they add a lot of complexity, thus the list above are the bare bone features I think this language should have. I don't think adding methods would add complexity, don't people essentially write methods in their code anyway? By prefixing functions with what they belong to, like player_update(), player_spawn() etc, adding methods just makes that much more intuitive and with editor Intellisense it would be trivial to use. The object example in the OP was purely an example as that was the first thing I could think of that took a value, returned one and altered the state of the UDT, it would be very beneficial to almost everything.

Quote: "They lack a lot of features, but their strong point is their rapidness."


This is one of major points of this thread and most of my suggestions though(did you read them?), with the amount of workarounds required to do seemingly obvious tasks, this is not only very counter-productive with regard to development time, but it's also a pain to learn the language as a lot of these limitations don't make any sense. Thus, at present, DBPro isn't very rapid, with the addition of most of these features DBPro will be not only faster to use, but it will also be easier for beginners to learn.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Sep 2009 17:27
Many a time have I pondered the idea of creating a wrapper for DBPro's commands that runs on a Virtual Machine. Means I could play about the syntax all I want, and you still get all the DBPro commands. It would be a decent fix to the problem, and really, not that much speed would be lost, because it's not like DBPro compiles to ASM that well anyway


Anybody interested? I'm not making promises btw. Just an idea.

"everyone forgets a semi-colon sometimes." - Phaelax
Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 30th Sep 2009 18:38
@ Veltro:

I just use the numbers 0 or 1... it's faster to write and there's no need to make constants. I just think "Off" and "On" when I see 0 and 1.


@ Everybody:

I'm sure that if those were implemented I would use them eventually but the one that I would use almost immediately is function overloading. The only good thing about the current method is we're less likely to repeat the same code within the functions because it forces us to use only one function name.

Alfa x
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 30th Sep 2009 18:53 Edited at: 30th Sep 2009 18:55
Quote: "Wonderful post, now let's place bets on how many people post things such as "you can create workarounds for all these things" and "these don't stop you from creating a game", completely missing the point of this thread.

I agree with all of the points listed, especially in the first section. I've been attempting to develop something in DBPro recently after using C++ for a long time and I've found that development is being bogged down due to having to create workarounds to the modularity I'm used to. It's ironic that it's taking more time in DBPro considering I've always thought of it as quite a RAD language.

For me the biggest issues are the lack of arrays in types (meaning I have to create some functions to simulate this, but due to the lack of modularity I have to do it for each type that uses an array!), and the inability to return a UDT from a function. The latter of which is usually a basic requirement for a type system.

I'm not sure if Lee wants to continue developing the language and compiler, but if so I'd be pleased if he took a look at some of the popular scripting languages, such as Lua and Unreal Script, as there are many features which can improve development time and management of code, particularly in areas of game creating."



Quote: "I'm not disagreeing with any of the points raised, but I'd like to remind you all that DBPro is a BASIC language, most users won't be bothered by these issues until it hits them, IF it hits them.

I could do with some expansion on types but it's not a show stopper, the speed at which things can be developed largely makes up for these shortcomings IMO. What I would like to see is someone from TGC telling us what is happening with the future of DBPro, it can't expand to include these more advanced features without a clear path. I expect though that these additions would take a lot of re-working the data handling stuff, which is just not easy in the case of DBPro, otherwise we might have arrays in types already. There's a big difference between returning a variable from a function and returning a typed variable - same goes for handling an array compared to handling an array bound to a typed array. Quickly becomes very complex I think, maybe too complex to consider changing."



In my opinion DBPRO needs to be expanded. Passing types by reference is a very basic (and necessary) feature in a development engine (The most important exapnd in this momment in my opinion, and shopuldn't be so hard if this is C++ based). It increases modularity, and still conserve the basic-ness of the DBPRO. I code in Visual Basic for Excel, and passing types is something I do everyday. I have too a bottleneck in UA (the RTS project), because I can't pass objects by reference, and have to have different arrays for different players (so I don't have to use fixed size arrays), and have the same code repeated eight times...

I''m not saying I don't like DBPRO. I think that this aspect (and others) can be very troublesome for big Projects...
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 30th Sep 2009 19:37
"Global variable declarations have to be executed.."

That's been true of almost every programming language I've ever worked with. I've simply made an include file "Variables.dba" with a label and a return, and at the top of my main source file I just do a Gosub InitVars. (been doing that for years)

"The lack of a distinct elseif.."

Select Case performs the same function.

"Function Overloading.." & "Arrays in UDTs.." & "References.."

Those would be very useful. No doubt about it.

--------------

The rest (to me at least) aren't that important, as this is basic after all. When you start adding those other things you start getting into the reasons why people move on to languages like C++ or C#.Net.

tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 30th Sep 2009 19:47
@ Veltro

#constant does not need to be executed they are picked up in an early pass of the parser/compiler. I too use TRUE/FALSE for readability and have them tucked away in a separate Constants.dba with no problems.

I'm not a real programmer but I play one with DBPro!
HavokDelta6
14
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: United Kingdom
Posted: 30th Sep 2009 19:49
I can understand that you all want to defend DBP, but Kistech. Case?

I think we'll all agree on the fact that:

In any decent programming / scripting language there are at least 10 different ways to accomplish one task.

I dont mean like changing a variable, but we should not be forced to do something due to a limitation which should be ammended or is non-standard.

Thats my two cents
Havok

dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 30th Sep 2009 20:02
Quote: "That's been true of almost every programming language I've ever worked with."


Like what? It makes no sense to be able to declare globals anywhere( i.e. they don't have to be executed/stepped-through) but only get initialized when they are executed. If this is an intended feature for the language then why impose restrictions upon what you can assign to it? At present it almost seems like it was intended for you to only be able to assign literals to them, with the difference being you can also assign variables. i.e. 'global var as integer = x' works, but 'global var as integer = x * 2' doesn't. Perhaps the language just wasn't created with multiple files in mind from the outset.

Quote: "Select Case performs the same function."


No it doesn't, good luck trying to do my 'else if' code snippet using select, without wasting a trillion lines.

HavokDelta6
14
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: United Kingdom
Posted: 30th Sep 2009 20:05
Ah thats what you meant by case, in which case i back up DarkCoders point, if's are vital

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 30th Sep 2009 20:12 Edited at: 30th Sep 2009 20:41
Ok, ok, so Select Case has it's limitations too..

Bad example.

I can't say I really recall when I first saw an elseif. It may have been an early version of VB. There's been so many languages over the years, I guess I'm moldable to whatever is given to me. There's always had to be a "technique" or "workaround" for something or another. No language gets it perfect.

I guess you could say I'm defending DBPro a little bit, but there are still some things I would love to see improved.

[edit]

@Havok,

I didn't say we don't need ifs. (although that's probably not what you're saying I said.)

Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Sep 2009 20:37
What I would like to see in DBPro is a way to compile to a code library.

This would make compilation times MUCH faster, and would make the entire language more modular. It would also not be that difficult to do!

It is actually possible to make our own language with DBPro's commands. It is not too difficult to read string tables from dlls, so you would just need to make a compiler, and then convert the command names to dll calls.

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th Sep 2009 21:48
very doubtful the issues here will be addressed in DBPro as we currently know it, but i do hope they are considered during the development of X10. and, maybe they already have been, which is why i'd like to see lee post something solid about x10 and where it's going. i don't think i've seen an official x10 Suggestion thread yet but this (unusually constructive) post would would be a good start.


Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 30th Sep 2009 23:25
I wish I knew a workaround for the absence of the Option Explicit statement mentioned as limitation 2-1, other than "don't ever make a typo". I don't regard this as an esoteric feature because I used it and benefited from it for years with other forms of Basic. If I had to chose a single item from Dark Coder's list as the most important to me, it would be that one by a mile.
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 30th Sep 2009 23:36
Quote: "wish I knew a workaround for the absence of the Option Explicit statement"

You can create a type, like this, for all of your global variables...



Then every variable you declare would be game.whatever. If it's not declared then you will get a compiler error. It doesn't make up for Option Explicit being missing but it is helpful.

This is the best DBP criticism post I've seen. DBP is fine for what it does, the problem is that it isn't meant to do much. It's easy to create something easy but it bottlenecks quickly as a game increases in complexity. Not to say that it can't make an awesome game, but to do so you have to be a workaround expert. That's DBP, at least there is DGDK. I look forward to switching.


Come see the WIP!
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 1st Oct 2009 00:07
Wouldn't it be quite simple* to write a pre-parser that ensures that any used variable has been previously declared?

Anyway, most of those are good points (yeah, I admit, I read the original post this morbing and haven't re-read it now, so I don't recall everything perfectly).
Of the top of my head, the else if functionality as well as arrays in udt's and udt returning functions are great issues though. As would classes be, but that might just be out of scoop.

* Read "not impossible"

tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 1st Oct 2009 00:14
Quote: "i'd like to see lee post something solid about x10 and where it's going"

He did say it, I forget where (newsletter?), but it said there are no plans for X10 version of DBPro. At this stage of the game, with Vista 2 years old or so, I don't think they're going to bother. Maybe they'll just jump to X11 !

I'm not a real programmer but I play one with DBPro!
Gamer Making
17
Years of Service
User Offline
Joined: 20th Sep 2006
Location: sitting at the comp programming
Posted: 1st Oct 2009 00:34 Edited at: 1st Oct 2009 00:35
yea those a few of many flaws with DBpro, but overall it is a pretty good language. But yea all of em affect to me, especially the inabilty to do complex statements in the functions one, so that probably will be added in the future.(maybe?) 1-6

Bach Tran
Neuro Fuzzy
16
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 1st Oct 2009 02:31
The biggest thing for me is passing types into functions, and returning types from functions. I hate when i'm passing four 3d vectors into a funcntion or something and i have to write

function myfunc(x1 as float, y1 as float, z1 as float, x2 as float, y2 as float, z2 as float, x3 as float, y3 as float, z3 as float, x4 as float, y4 as float, z4 as float)

Instead of something like this:

type vect
x as float
y as float
z as float
endtype
function myfunc(p1 as vect,p2 as vect,p3 as vect,p4 as vect)

It would be alot easier. Same goes for returning stuff from functions. I hate making global variables just for returning stuff from functions.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 1st Oct 2009 03:57 Edited at: 1st Oct 2009 04:34
@Neuro Fuzzy:

Huh? If I couldn't pass UDTs into functions, I think everything I've ever written would break. Here, I just looked at the project I've got open currently and pulled a function for you to see:



But as for returning UDTs, that would be so very very helpful for me. Along with passing by reference.

Edit: I just ran into another problem: All arrays are global. Does someone know a way around that?
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 1st Oct 2009 05:42
Quote: "What I would like to see in DBPro is a way to compile to a code library."


Indeed this would be nice, though I imagine a lot of things in the language+compiler would need to be altered to make it happen. For now, DLLs kind fulfil this purpose, even if only a few people have the know-how to make them for DBPro. Plus, the language itself isn't really efficient enough to make it worth the while, obvious candidates for libraries would be improved string functionality but DBPro's incredibly inefficient at handling them so you may as well just use IanM's library for this, the same goes for a lot of things, why hasn't that been incorporated into the language yet?


Quote: "Edit: I just ran into another problem: All arrays are global. Does someone know a way around that?"


Yes, it's just another inconsistency with the language. Unlike variables which you have to specify as being global else they're local, with arrays you have to specify them as local else they're global. Keep in mind that they're not completely the same though, unless I'm mistaken arrays can only be fully global or local to a function unlike variables, which can also be local to the global scope. Also there doesn't seem to be a way to make the arrays static, i.e. have them retain their values but still be local to the function, if you put the 'local dim' statement in a condition then it only works when you execute 'local dim' which I guess is to be expected. I'd forward such static variables to be added but that might be a bit out of the scope of the language, and you can always work around it by declaring such variables/arrays outside of the function but giving them fairly obscure names. Of course, these will only get initialized once they're executed so uhh, yeah. Fun.


Anyway I'm glad to see people like the topic, keep posting ideas!

chwilly
15
Years of Service
User Offline
Joined: 23rd Feb 2009
Location:
Posted: 1st Oct 2009 06:04
Declare local in the function, I think. Works for me.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 1st Oct 2009 06:07
Yeah, works for me too. The strange part is, I was absolutely positive it didn't work for me a second before. Basically, I did something to make me think it didn't work, posted, read dark coder's post, scratched my head thinking "Huh, I thought I just tried that", tried it again and it worked. Must've done something wrong in step one. Ah well
aki
15
Years of Service
User Offline
Joined: 8th Nov 2008
Location:
Posted: 1st Oct 2009 07:36 Edited at: 1st Oct 2009 07:37
I completely agree with dark coder. I've lately switched over to C++ and TV3D, and am definitely liking the vast feature set. Though not a language limitation, I'd like to see an overhaul to a more shader-based graphics approach. For example, render surfaces, selection of A8R8G8B8 and the like, and a more intuitive camera and quad rendering system. More (BETTER) documentation wouldn't hurt either, and neither would putting out QUALITY plugins (or preferably free upgrades). While it still won't match C++ for quality and speed, it'd be incredibly more convenient than the current implementation - and isn't that the point of the language?

EDIT: Oh, and managed lighting. And LOD terrain. And a semantics list. And PMs.
calcyman
16
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 1st Oct 2009 09:08
Quote: "1-2) The inability to return a UDT from a function"


That's the one limitation that really frustrates me. When trying to make complex number functions, for example, I have to pre-create a global variable called 'return_complex'. That lacks the elegance of returning values directly from within functions.

The optimist's right, The pessimist's right.
sindore
19
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 1st Oct 2009 18:16
I've got to say the amount of times I've had to work around stuff just be cos of bad scripting or reworks, I think that dbp should make these changes, not be cos it would be better, but be cos the community demands it, and if it was not for the community then dbp would no be as big as it is now.

I would hope that this would make for an easier coding experience, and a basic lay out of what works and what dose not, better help files would be a good start, and if they do update dbp to the extent of what is being said here, then some easy and clear tutorials would not go a miss.

I have always use darkbasic and dbp, and have yet to make any really good game, I have always got messed up by crappy functions and arrays ect, and get so F'ed off with it that I abandon what I've bin working on, only to come back to it a year latter, just to find that no update has come to fix the code, so end up doing what I did not wont to do, and I rework the code like a good little boy.

guess what crappy code = crap games.

I know I'm nowhere near the best coder in the land, but I work hard toward my games only to be left with something I'm not happy with, be cos of the way it was coded.

I know not all of you fell the same, but I'm loosing faith in dbp, and after spending £100's on this code and plugins only to feel like that I've spent the last 8 years just wasting my time.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 1st Oct 2009 19:01 Edited at: 1st Oct 2009 19:04
Quote: "2-1) Lack of option explicit

Some users believe the ability to randomly use variables without declaring them beforehand is a feature, while this may be true, you should also have the ability to disable it as it can very quickly lead to issues that are very hard to debug."


I'd like to add that option explicit doesn't necessarily mean having to declare your variables, but it can be a variation on this concept by preventing you from using the value from undefined variables.

For example:



Having this feature means that while variables still wouldn't have to be explicitly declared, any incorrect variable names will be caught by the compiler, saving many headaches. In fact, there's no reason not to have such a feature.
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 1st Oct 2009 20:56
I've been playing around with "Play Basic" a lot lately and you can do most if not all the things wished for in the opening post. Since obviously "Play Basic" is a basic language, why can't some of the same things be done in DBP?
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 1st Oct 2009 23:42
Yep, all of those could be implemented in BASIC.

Alfa x
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 2nd Oct 2009 00:55 Edited at: 2nd Oct 2009 01:04
Quote: "This is the best DBP criticism post I've seen. DBP is fine for what it does, the problem is that it isn't meant to do much. It's easy to create something easy but it bottlenecks quickly as a game increases in complexity. Not to say that it can't make an awesome game, but to do so you have to be a workaround expert. That's DBP, at least there is DGDK. I look forward to switching."


Totally true. I will be switching too. I will not make a big project In DBPRO again if posible, because of this problems that you talk about, and that are caused becuase of some items that Dark Coder Said...

DBPRO is an excellent tool in any case. I really would like it to be improved.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 2nd Oct 2009 19:24
I just thought I'd throw out there that Option Explicit is an option in the BlueIDE editor. I've used it to catch some of those nasty variable typos.

I don't know about the other editors. I've not used them for more than a few minutes at a time.

Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 2nd Oct 2009 21:55 Edited at: 2nd Oct 2009 22:05
Have a look at PureGDK. With PureBasic + DarkBasic Professional you can do everything there you want and more. And it's still a BASIC dialect so it's very easy to learn.

1-1) Lack of arrays in UDTs

PureBasic can do this natively:



1-2) The inability to return a UDT from a function

PureBasic can do this natively:



1-3) Global variable declarations have to be 'executed' for initialization to happen

PureBasic can do this natively:



1-4) The inability to pass UDT data from an array to a function

PureBasic can do this natively:



1-5) The lack of a distinct 'elseif'/'else if' statement

PureBasic can do this natively:



1-6) Inability to do complex statements on 'exitFunction'/'endFunction'

PureBasic can do this natively:



1-7) No function overloading

PureBasic supports optional parameters natively:



2-1) Lack of option explicit

PureBasic can do this natively:



2-2) Vectors and matrices aren't basic types

PureGDK supports this natively:



2-3) No methods in UDTs

PureBasic supports this natively through interfaces:



2-4) No references

In PureBasic all arrays, lists, and hashmaps are passed by reference. Everything else can be passed by address to achieve the same effect.

AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 2nd Oct 2009 22:08 Edited at: 2nd Oct 2009 22:11
The fact that Mistrel managed to follow every single criticism with a "PureBasic can do this natively:" shows how valid they are. Don't give me that, "This is a BASIC language! It's supposed be basic!" crap. Plenty of BASIC languages do ALL of these things and more; PureBasic and BlitzMax both spring to mind here. The fact that a language has plenty of useful features does not necessarily make it more complex.

i like orange
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 2nd Oct 2009 22:18 Edited at: 2nd Oct 2009 22:37
Quote: "The fact that Mistrel managed to follow every single criticism with a "PureBasic can do this natively:" shows how valid they are. Don't give me that, "This is a BASIC language! It's supposed be basic!" crap. Plenty of BASIC languages do ALL of these things and more; PureBasic and BlitzMax both spring to mind here. The fact that a language has plenty of useful features does not necessarily make it more complex."


The key difference here between PureBasic and other languages is that it's simple enough to pick up and through PureGDK it supports all of the functionality of DarkBasic Professional including plugins.

If you like DarkBasic Professional and want to use it's engine with a more powerful core language then PureGDK is it. All of your plugins and code will be compatible (though the code will need to be tweaked).

It also supports features that aren't even in DarkGDK, like real vector and matrix datatypes, support for DBP plugins, and render device callbacks.

PureGDK offers a complete GUI library through PureBasic as well as complete access to the Win32 API for callbacks and advanced interaction with native windows and controls.

It completely integrates DBP's event loop with the parent window to provide seamless access to all supported events. There's no need to handle a second event loop in parallel.

Have a look for yourself. All of the DBP's commands are either native to PureBasic or supported by PureGDK:

http://puregdk.com/files/upload/PureGDK.chm

Also consider that PureGDK is useful for more than just game programming. Because of its built-in GUI library and native support for the Win32 API it's possible to create development tools and non-game applications as well:

(Source code included)
http://puregdk.com/files/upload/aspect-ratio.zip



Alfa x
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 3rd Oct 2009 00:15 Edited at: 3rd Oct 2009 00:19
@ Mistrel: AndrewT has a Point, but I think I will take a look at purebasic. (You do propaganda everytime you can , you are almost convincing me ). One problem howerver is that i have to buy tow things that summed together give a considerable amount.

Cheers.

AlfaX.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 3rd Oct 2009 00:40 Edited at: 3rd Oct 2009 18:32
I downloaded the PureBASIC demo a while back. The only complaint I had was it was restricted to the number of lines you could compile into a working program, and sadly, all of the included demos were to long to compile.

I found another gripe to add to the list for DBPro though.

- You cannot copy the contents of a UDT to another.

[edit]
Gripe withdrawn. I swear I tried it 3 times yesterday and it wouldn't work. Now, magically, it does...

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 3rd Oct 2009 01:18
Quote: "You cannot copy the contents of a UDT to another."


You can, I do this all the time. The code you posted compiles fine.
Colonel_Klink
17
Years of Service
User Offline
Joined: 20th Dec 2006
Location: Within the dark recesses of my mind
Posted: 3rd Oct 2009 01:49
I've had a play with the demos of PureGDK and PureBasic, and its a nice combination, however what kills it for me is the cost. When you add the two together, plus having purchased DBPro, the outlay just doesn't compare to DarkGDK (free until you need a commercial license) and VC++ Express (also free). The downside with those is integration with Windows controls, which I understand PureBasic does have.

I agree with AndrewT. My son has programmed in Blitz3D for years and he is dumbfounded as to why DarkBasic doesn't have the capability to do most of those things listed above. in fact he is trying desparately to get me to switch to Blitz3D so that he can assist me with my current project.

Oh my gosh! He's wearing Full Metal Pyjamas!
--------------------------------------------
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 3rd Oct 2009 04:21 Edited at: 3rd Oct 2009 04:40
Purchasing PureGDK and PureBasic is an investment. It's difficult to describe how much more powerful the language really is until you've experienced it.

Maybe for a little perspective, all of the tools and libraries written for PureGDK are programmed in PureBasic. That's tens of thousands of lines of code, dozens of static libraries, dynamic libraries, hand-coded assembly (yes, it supports in-line assembly!), multi-threading, interprocess-communication, mutexes, semaphores, Win32. It's all possible in PureBasic!

I think DarkBasic Professional is a great tool. It's so easy to use and it's really more powerful than a lot of people give credit. The only thing that's holding it back is the language. That's what PureGDK does. It separates the DarkBasic Professional engine from the language so that it can be used in PureBasic. And, in time, other languages as well.

Once you break out of the limitations of the language you can do all kinds of amazing things you never knew were possible. For example, in PureGDK (using the PureBasic language) you can do fun stuff like this:



With this function you can enumerate all objects in a list as well as return any one of its parameters based on a offset in the data structure.

Here is an example of how it might work:



Clean, simple, efficient. Points to whoever can identify what "@ObjectList" is doing in the loop.

What this example demonstrates is that by using only one function you can enumerate (walk through a list) of all game objects using only one function "GameData_EnumObjects()".

Using the same principal you can create various lists for doors, walls, floors, collision objects, monsters, powerups, etc. In a single loop you can cycle through all objects in a particular category to: open automatic doors, update AI, pathfinding, lighting, etc.

The real power is designating each of these actions to dedicated threads. One thread to control physics, one for AI, one for controls, and one for the main loop. DBP does not support structures, pass-by-address, structure offsets, sizeof, threads, or pointer arithmetic. All of these language constructs would be necessary for the example I illustrated.

All of this is possible using PureGDK!

Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 3rd Oct 2009 04:39
Thats the reason i bought DarkBasic is partly because i programmed in MS Basic 7 back in the 80'es, wanting that feel and also to learn 3D game programing, an old dream , and i have a blast doing it .
But I miss the possibility of arrays in a UDT's as Basic 7 had (Dark Coders first issue, as it should be ). It would improve the BD language immensely, and it can't be too hard to implement(?) as it's only pointers really.
Also Option Explicit, have had more than one occasion where i had variable names spelled wrong.

Regards
HavokDelta6
14
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: United Kingdom
Posted: 3rd Oct 2009 19:57 Edited at: 3rd Oct 2009 20:02
The IDE thats native with darkbasic could also be VASTLY improved, i am running 7 and i could not get codesurge to work, without lagging significntly and failing to compile

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 3rd Oct 2009 19:58
Quote: "Benjamin right or wrong, dont try and tear appart Darkcoders statement, all of these are valid points, variable decleration anyhow would be incredably nice."


Did you take the wrong pill today? I didn't tear apart any statements. You've got the wrong person.
HavokDelta6
14
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: United Kingdom
Posted: 3rd Oct 2009 20:02 Edited at: 4th Oct 2009 00:51
nope, anyway, not to sure what happend there, i was sure i read something....nvm, special moment :p

Login to post a reply

Server time is: 2024-04-20 05:21:26
Your offset time is: 2024-04-20 05:21:26