my best effort

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: my best effort

Post by fxm »

Is this a question?
If so, it is not very clear.
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: my best effort

Post by paul doe »

owen wrote:paul
Yes it is beyond them for now but not too much for them because I'm giving them a year to get it figured out.
Oh, don't worry, it will be far less, I assure you =D

I designed the code to gradually introduce more advanced concepts to them, once they have grasped everything at that level. Right now, the overall concepts they'll need to learn are (in order of appearance in the code):
  • including files and modularizing code (that's what those mysterious /' _____ '/ are for =D).
  • defining and using some simple #defines to help eliminate redundant code and improve readability.
  • defining, using and initializing some simple types and enumerations.
  • defining, using and initializing arrays, including both static and dynamic ones.
  • defining and using simple subs and functions, and why and how to pass parameters between them, to promote code reusability and maintainability. Also, what are overloaded subs and functions and how and why to take advantage of them.
  • using namespaces to group symbols by functionality and avoid polluting the global namespace; this will allow them to share their code with minimal integration issues (name clashings).
  • introduce the concept of 'utility routines' that they'll most likely use in many (if not all) of their projects. to encourage them to write their solutions once and improve them over time. Also, by building a code base, they'll spend less time chasing bugs (because they'll be using tried and tested code) and more time coding new things.
As you can see, there are many concepts to learn, but none of them is particularly difficult. This will allow us, however, to lay out the groundwork for more complex stuff, that can be introduced gradually:
  • refactor code. The game supports more than two players, and many balls (up to 8), but this isn't implemented yet. Implementing it isn't particularly hard, but requires a little code refactoring. Once they're more familiar with the concepts described before, they will undoubtedly want to make some changes, reinterpret some functions and subs (to customize them to their liking), and even use and modify some utility functions for their own needs.
  • pointer usage. As you probably noticed, the code doesn't use a single pointer, only references. For some reason, pointers are almost universally perceived as 'complex' by novices, so I left them for later. This includes concepts such as function pointers and callbacks.
  • overloaded operators. These will allow them to express things like vector and matrix arithmetic using the standard algebraic operators, among other useful things.
  • augmented types. Those are the ones that have methods and constructors, to construct them easily and associate data and functions that act on them.
  • and finally, go to full object-oriented concepts, such as inheritance, polymorphism and all the rest. By this time, they'll most likely have laid out all the groundwork needed to convert the procedural version of the game into an object-oriented one, and compare the two of them. This will allow them to understand the differences and similarities between the two paradigms, and understand what are the shortcomings of procedural programming that could be addressed using object-oriented techniques.
owen wrote:I'm trying to get them into auto mode.
Ie self-initiated investigation of freeBASIC.
The magic of discovery has to be one of the most satisfying aspects of exploring computer programming by oneself. Of course, you pick up a lot of bad habits along the way, but those can be easily avoided if you have a good foundation to start with =D
owen wrote:So it's good to throw them a list of commands to start off with. We will see how it goes and I'll try to keep you guys posted but I might have to take a little bit of a break cuz this is kind of affecting me driving a truck over the road and all I have to spend a little bit more time getting some rest.
Don't worry about it. I'll help them in whatever way I can, and provide examples (the official documentation should be the first place to look for examples, though) and explanations when required.
Last edited by paul doe on Oct 25, 2018 15:18, edited 1 time in total.
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

Re: my best effort

Post by owen »

Ok back on road 600 miles to go.
Fxm no it's not a question. Thanks for letting me know about the bug.
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: my best effort

Post by Munair »

I wonder if the namespace issue should be considered a bug. It could also be seen as an implicit shared for global namespace variables. As soon as an identical variable is declared inside a routine it gets precedence over the global one (as it should):

Code: Select all

namespace s
	dim x as integer = 4
	dim y as integer
	sub test()
		dim x as integer = 3
		y = x
	end sub
end namespace

s.test()
print s.x ' should be 4
print s.y ' will be 3
end
It just isn't consistent with the default global namespace that requires the 'shared' keyword. I actually don't mind this 'feature'.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: my best effort

Post by fxm »

Documentation at NameSpace page wrote: A variable declared inside a namespace is always implicitly static and visible throughout the entire program even if the declaration modifier Shared is not specified (static and shared are optional, but this may improve code readability).
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: my best effort

Post by Munair »

fxm wrote:
Documentation at NameSpace page wrote: A variable declared inside a namespace is always implicitly static and visible throughout the entire program even if the declaration modifier Shared is not specified (static and shared are optional, but this may improve code readability).
Visible throughout the entire program as long as the namespace prefix is used.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: my best effort

Post by fxm »

Documentation updated:
KeyPgNamespace → fxm [Added a sentence on the access syntax from the outside]
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

Re: my best effort

Post by owen »

I designed the code to gradually introduce more advanced concepts to them, once they have grasped everything at that level. Right now, the overall concepts they'll need to learn are (in order of appearance in the code):
very well though out paul. thanks.
we'll follow your lead.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: my best effort

Post by fxm »

@owen:
I just registered on your forum and I'm waiting for activation.
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

Re: my best effort

Post by owen »

Ok fxm activated
Welcome and thank you.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: my best effort

Post by fxm »

Thanks.
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

Re: my best effort

Post by owen »

Using Skype for training has been challenging to say the least. I purchased 10 laptops, 10 headsets, a widescreen TV and a Android digibox for them for this purpose. Also high speed internet from pldt (the best telcomm service available for that area).

I have been able to share my screen with them while out on the road in my truck using my T-Mobile data which has been surprisingly good 4g connections. I'm anxious to see how well it goes once I get home on my high-speed connection.

I created 11 Skype accounts fbcadcam0-10. The Android digibox logs into Skype using fbcadcam0. Arjay uses fbcadcam1 (laptop #1) and the other laptops are available for the other staff and students. Some of the students bring their own laptops and maybe logging into Skype using their individual Skype name.

At first I was hosting the Skype cast. Adding people to the group as they came in to the office. But yesterday we changed things up and instead of me hosting the Skype cast, fbcadcam1 does the hosting. This way they can add people to the Skype cast themselves instead of me having to do it plus when I lose my service and I drop out it doesn't cause us to have to start all over and reconnect everybody.

While I I am happy to be able to communicate with people Halfway Around the World from a truck stop parking lot I am also unhappy because there just is not anything like being there standing in front of them. It has been difficult trying to explain things. If I were there physically while explaining something I could see whether or not they were picking up what I was putting down. Getting them to engage is it challenge. In other words as I am explaining to them some things I ask them please interrupt me if you do not understand what I'm saying ask me to stop and explain further however I have an audience who is not quite able to ask questions yet...

I am hopelessly optimistic. My glass is always half-full. I never give up. All things are possible.
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

Re: my best effort

Post by owen »

I have informed them that they need to engage with you guys. They are very polite and respectful people but they are also very very new to programming. So do not think that your posts are being ignored it's just that they need that extra little bit of instruction. Somehow someway I will get them to engage.

I got to give them credit though. Actually is quite amazing of their achievement thus far. In fact they are actually trying to create their own how to program in freeBASIC manual for the new kids that show up. It's really cool to see them try. A+ for effort and intention and Hope Etc...

Ps I'm stl trying to get the to spell freeBASIC properly. I haven't asked them to do this verbally I have simply stated a couple times in the Forum of which obviously they are not reading or something not quite sure. I guess it's my way of testing and making sure that they're reading the form so I have a lot of work to do still obviously.
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: my best effort

Post by paul doe »

owen wrote:I am hopelessly optimistic. My glass is always half-full. I never give up. All things are possible.
It's amazing how you'd pulled all this off in less than a month. It sure is a good thing to see how this project has 'energized' you ;)
owen wrote:I have informed them that they need to engage with you guys. They are very polite and respectful people but they are also very very new to programming. So do not think that your posts are being ignored it's just that they need that extra little bit of instruction. Somehow someway I will get them to engage.
Don't worry about it. Eventually, they'll gain enough confidence to do so. You see, to them we are just two 'strangers' talking gibberish, since they all know each other and perhaps even share the same desk, so this shouldn't be so surprising after all =D
owen wrote:I got to give them credit though. Actually is quite amazing of their achievement thus far. In fact they are actually trying to create their own how to program in freeBASIC manual for the new kids that show up. It's really cool to see them try. A+ for effort and intention and Hope Etc...
That's nice! It can also prove invaluable, since it offers a peer vision of the process of coding, instead of having just their teachers vision. Also, when trying to explain things to others, their own comprehension of the topic grows, so this should be encouraged as much as possible.

PS. Check your mail ;)
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: my best effort

Post by fxm »

@paul doe,
About your "FreeBasic Excercises: 1 - Procedures and Arrays" post at FbCadCam Forum:
Maybe also specify the dimension of the arrays (I suppose the same for both equal to 1) and their datatype.
Post Reply