
FreeBASIC's Official Forums
|
| View previous topic :: View next topic |
| Author |
Message |
|
|
Posted: Jul 07, 2007 22:15 Post subject: Tutorial/Article Request Thread |
|
|
While there's already a *massive* list of articles on the internet for game development, there's not as many of those written in FreeBASIC. Many are also lacking the information that you need to begin real development, leaving you to "fill the blanks" yourself.
If you have a topic that you'd like someone to write a tutorial or article about, please request it here. If you're wanting to write about something, but don't know what, you can look here as well.
Thanks,
Pritchard |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 09, 2007 6:56 Post subject: |
|
|
| Article on "objects for beginners" so that they would know when to pass byval or byref. |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 10, 2007 22:36 Post subject: |
|
|
Some of us are probably kind of afraid to ask what would be seen by others as noob questions. I don't like RTM questions but there are questions I might have that aren't necessarily in the manual but might get flamed on anyways... Hopefully this will help, if I think of any questions I'll ask :)
I really loved Lachie's tutorials, too bad he only wrote two of them... |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 11, 2007 3:35 Post subject: |
|
|
| relsoft wrote: | | Article on "objects for beginners" so that they would know when to pass byval or byref. |
I cover the byref/byval issue a little in part 2 of my object tutorial, in the sections "Deep/Shallow copy" and "Passing objects to functions ByVal". Maybe it could be more detailed?
http://www.freebasic.net/wiki/wikka.php?wakka=TutBeginnersGuideToTypesAsObjects2 |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 11, 2007 20:01 Post subject: |
|
|
Can't believe several people actually found my tutorials useful. Glad to know that all the effort that went into writing them wasn't in vain.
But I'm perfectly aware that most experienced programmers probably dislike them, if not hate, and I understand that. Nevertheless, I honestly think that tutorials written in a "conversational manner", as mine are, tend to help a certain percentage of programming noobs (I won't go guessing their percentage) much more that the usual type of programming tutorials, the highly generic ones.
notthecheatr, the truth is, my programming knowledge is rather small. I'm pretty sure I have few more tricks to share, but this "knowledge" is not something I like to flap around with since experienced programmers would probably find it silly. But I'll see. This feedback and few emails I got just pumped up my motivation.
First I should rewrite the code from the tutorials so it would compile in FB v.0.17. I really hate how FB v.0.17 wants to murder every piece of code written before it. And I remember well the promise from FB v.0.16. I wonder what a C-like nightmare FB v.0.18 will be, and what changes will HAVE to be implemented so FB would wrap in “I don’t know what”. -lang parameters is fine, I just don’t like HAVING to use it.
If you ask me, necessity to declare EVERY variable is plain silly. It doesn’t service the user on any possible way. It’s mainly a thing compiler developers prefer. Same crap as every PHP line having to end with “;”. Annoying to user, great help to PHP developers. I’m talking nonsense? Most likely.
I’m such a programming noob. :P |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 11, 2007 20:39 Post subject: |
|
|
| Quote: | | If you ask me, necessity to declare EVERY variable is plain silly. It doesn’t service the user on any possible way. It’s mainly a thing compiler developers prefer. |
lol, once you get to higher level programming, it will be something you'll be very glad for, trust me. =p |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 11, 2007 20:41 Post subject: |
|
|
W-what? NOT declaring every variable is plain silly to me. There's not much you can complain about these days, anyways! We have VAR now, which makes things a ton easier.
Why in the world would I want the compiler to even let me use a variable if I hadn't declared it? O.o;; I had no problem with implicit variables in the past, but explicit is good. I think FB's found a decent balance between the two, although a couple things like STRINGs kinda bother me right now.
| Quote: | | It doesn’t service the user on any possible way. | Knowing the type of variable something is? Knowing it's the variable that you meant? Protecting you from errors such as:
| Code:
|
|
abcdefhi = 10 abcdefih += 1 |
|
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 11, 2007 20:45 Post subject: |
|
|
| yeah, especially once you start dealing with pointers =X |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 11, 2007 21:43 Post subject: |
|
|
| Lachie Dazdarian wrote: | Can't believe several people actually found my tutorials useful. Glad to know that all the effort that went into writing them wasn't in vain.
...
notthecheatr, the truth is, my programming knowledge is rather small. I'm pretty sure I have few more tricks to share, but this "knowledge" is not something I like to flap around with since experienced programmers would probably find it silly. But I'll see. This feedback and few emails I got just pumped up my motivation.
...
If you ask me, necessity to declare EVERY variable is plain silly. It doesn’t service the user on any possible way. It’s mainly a thing compiler developers prefer. Same crap as every PHP line having to end with “;”. Annoying to user, great help to PHP developers. I’m talking nonsense? Most likely.
I’m such a programming noob. :P |
No it wasn't in vain! I would be happy to see more, and I sure wouldn't mind if you updated the code either. But of course you don't have to do that stuff, I've figured out how it works on my own.
I actually kinda guessed that, looking at your code, but if you're a noob I'm a whole lot worse! I liked your tutorials because I actually learned something from them - a lot of tutorials are too hard to understand or assume you already understand --- while not everyone does. It's kinda funny - sometimes in your tutorials you would say something like "I don't really understand ---" and I was surprised because I *did* understand - yet *most* of the tutorial was stuff I didn't understand before o.O I guess my background is a bit different, I started programming by studying the low-level stuff, so I understand something about how it all works but I have problems with implementation: my code is really confusing and badly put together :P Plus I never finish any projects I start - at least your projects look nice, even if technically the code isn't written so well :)
Yeah, I hate having to declare every variable, but I suppose it's best. Not doing so can make code more confusing. |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 11, 2007 22:18 Post subject: |
|
|
Yeah it depends on the point of view.
with my Pascal/Delphi/FreePascal background where you have no choice to declare your variables, I've been declaring variables even back when I was using QB, so to me, this new default is not a problem and never any weird or big conversion factor either.
My Color Triple Yahtzee game (announced elsewhere in this forum) for example started out as a QB program that I ported to native FB (so I don't have to do a -lang qb to compile it). I'm happy to report that in this case, it took about 5 minutes to port this to native FB. Part of this easy porting effort is definitaly due to the fact that I always declare my variables I'm sure of that hehe.
But yeah, it's a good thing all in all in my book. the more complex the program the more benefits you reap from this new default for sure. |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 12, 2007 19:47 Post subject: |
|
|
So what is now the point of OPTION EXPLICIT? Is served a perfect purpose for those who really NEED to declare EVERY variable.
Anyway, I still see no point in having to, for example, declare countstuff variable that is used in this sort of "local" FOR loops:
| Code:
|
|
For countstuff = 1 To 90 MyObject(countstuff).X = MyObject(countstuff).X + MyObject(countstuff).XSpeed Next countstuff |
And this rule does not prevent me to make a mistake like:
| Code:
|
|
For countstuff = 1 To 90 MyObject(countstuff).X = MyObject(counstuff).X + MyObject(countstuff).XSpeed Next countstuff |
|
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 12, 2007 20:20 Post subject: |
|
|
| Code:
|
|
For countstuff As Integer = 1 To 90 ... |
|
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 12, 2007 21:19 Post subject: |
|
|
| Thanks. We learn new things every day. :P |
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 12, 2007 21:26 Post subject: |
|
|
If you want to follow some macro hell examples, you can shorten it up too. :p
| Code:
|
|
#define _ai As Integer
For i _ai = 1 To 99
Next
|
|
| |
|
| Back to top |
|
 |
|
|
Posted: Jul 12, 2007 22:05 Post subject: |
|
|
| Code:
|
|
Type i As Integer
For dovar As i = 0 To 101 Print "0 to LOL!" Next Sleep |
That's short. No wait, it's INT! |
| |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|