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.

Newcomers DBPro Corner / Some General Advice

Author
Message
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 21st Mar 2004 22:41
With DarkBasic, or DarkBasic Pro, by looking in the help file you will notice that there are an immense number of commands. You may wonder how on earth you will ever learn all these. My advice is don't. Using functions, you can do a lot of things by yourself. By creating your own functions, you will get more programming experience, and you will understand how the function works better. I find it a lot easier to decide what I want and then make the function than to find the darkbasic command and try to figure out how it works (e.g. camera following object).
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 21st Mar 2004 22:50
you'll find that writing your own functions usually includes using built in ones as well. You also have to remember to try and not reinvent the wheel every two seconds. Putting effort in learning how to code is good advice that you posted but also investing some time in knowing your tools and whats available is also good advice.



Home of the VB.NET Class Builder Utility - Demo available now!
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 21st Mar 2004 23:15
Of course you shouldn't try to make everything by yourself. But often, the advantages of making your own functions suited to your own needs outweigh the advantages of having a ready-made one available.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 21st Mar 2004 23:47
exactly but knowing what tools are available in the language, to help you write your own functions is a quintessential element of programming.



Home of the VB.NET Class Builder Utility - Demo available now!
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 22nd Mar 2004 01:20
It doesn't work quite so well in darkbasic as the builtin functions can be a lot faster than the ones you could write, try writing your own GET IMAGE function for instance.

Also the inbuilt functions should be bug free and fairly tested.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Mar 2004 02:23
I agree with what Winch is saying, not that anything else here is innacurate. The statement:
Quote: "But often, the advantages of making your own functions suited to your own needs outweigh the advantages of having a ready-made one available"

kinda makes no sense. If there is a function that already does what you need, to the letter, then use it - if not make one that is "suited to your own needs". All I am saying is making one that is "suited to your own needs" will, at some point, encompass using ones that exist, so knowing your tools AND knowing how to "code-your-own" is the best mix of both worlds, IMHO. Not "one way" or "the other". Kinda like the silly argument of subs vs. functions (not to get that started again) but having both in your arsenal can only help, not hurt. Same for code-your-own vs using-built-in - there is no set formula, period.



Home of the VB.NET Class Builder Utility - Demo available now!

Login to post a reply

Server time is: 2024-11-26 09:41:48
Your offset time is: 2024-11-26 09:41:48