Recent

Author Topic: Override not working  (Read 13088 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Override not working
« Reply #15 on: June 23, 2015, 05:18:19 pm »
Here's my code, which is working since I removed "override" from the construtor and I'm intrigued to know whether there's anything wrong with doing this.

No, there is nothing wrong.

BTW, you could use "overload" for the 2 constructors.
« Last Edit: June 23, 2015, 05:28:47 pm by typo »

rvk

  • Hero Member
  • *****
  • Posts: 6944
Re: Override not working
« Reply #16 on: June 23, 2015, 05:31:27 pm »
This is the second question of yours, where I'm thinking... Shouldn't a teacher already know this? Especially when teaching A Level Computing. But, okay, maybe you were thrown into the deep-end and need to learn it yourself too. I would, however, suggest reading some (or a lot) tutorials regarding Object oriented design in Pascal first, because, like Juha already hinted at, any eager student will bombard you with questions, which you can't handle at the moment.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Override not working
« Reply #17 on: June 23, 2015, 07:25:40 pm »
You will teach virtual functions without understanding what they are? Uhhh. You really must learn the fundamental ideas behind this feature! It implements polymorphism which is an essential part of object oriented programming.

It is good I am not attending your class. In school I wanted to understand everything and asked dummy questions from teachers. You would have hard times with me!
A good teacher knows his topic thoroughly and can answer questions also outside of his teaching material.
Criticizing is ok but a couple of information details through in would be better.
This is the second question of yours, where I'm thinking... Shouldn't a teacher already know this? Especially when teaching A Level Computing. But, okay, maybe you were thrown into the deep-end and need to learn it yourself too. I would, however, suggest reading some (or a lot) tutorials regarding Object oriented design in Pascal first, because, like Juha already hinted at, any eager student will bombard you with questions, which you can't handle at the moment.
In hes position I would start by understanding what a class physically is and how it exists in the file and memory aka the internal schema of a class representation. I have not seen any tutorials for this low level information any where yet and I have no idea where to look to find that info in the rtl. So nice thoughts not much help though.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

rvk

  • Hero Member
  • *****
  • Posts: 6944
Re: Override not working
« Reply #18 on: June 23, 2015, 07:58:55 pm »
This is the second question of yours, where I'm thinking... Shouldn't a teacher already know this? Especially when teaching A Level Computing. But, okay, maybe you were thrown into the deep-end and need to learn it yourself too. I would, however, suggest reading some (or a lot) tutorials regarding Object oriented design in Pascal first, because, like Juha already hinted at, any eager student will bombard you with questions, which you can't handle at the moment.
In hes position I would start by understanding what a class physically is and how it exists in the file and memory aka the internal schema of a class representation. I have not seen any tutorials for this low level information any where yet and I have no idea where to look to find that info in the rtl. So nice thoughts not much help though.

"understanding what a class physically is and how it exists in the file and memory aka the internal schema of a class representation"
"So nice thoughts not much help though."
So, yeah. Those are your thoughts, not mine :) I wouldn't start out that low level.

My thought was more like some good books and tutorials about learning Object oriented pascal. Something like this (it's for Morfik but applies to FPC too) but than a bit more extended (or maybe even the Object Pascal Language Guide of Embarcadero itself).

The question would be... are there any other good online tutorials about Object oriented Pascal?
« Last Edit: June 23, 2015, 08:27:36 pm by rvk »

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Override not working
« Reply #19 on: June 23, 2015, 08:35:13 pm »
So, yeah. Those are your thoughts, not mine :) I wouldn't start out that low level.

My thought was more like some good books and tutorials about learning Object oriented pascal. Something like this (it's for Morfik but applies to FPC too) but than a bit more extended (or maybe even the Object Pascal Language Guide of Embarcadero itself).

The question would be... are there any other good online tutorials about Object oriented Pascal?
Not at that level. This is theory and why it is this way. Help understand and create those examples and tutorials from the base knowledge. Totally inappropriate for a course in a school. after all if the school is showing me what ever I can find on the net the it failed, hard.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

rvk

  • Hero Member
  • *****
  • Posts: 6944
Re: Override not working
« Reply #20 on: June 23, 2015, 08:44:59 pm »
Well, at the moment that school is teaching at less than basic level so it's already failing at that.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4673
  • I like bugs.
Re: Override not working
« Reply #21 on: June 23, 2015, 08:57:29 pm »
Criticizing is ok but a couple of information details through in would be better.

Polymorphism was the information detail. There is a lot of information available for anybody who wants to learn. Do you want me to copy it all here?

I try to to understand you taazz but I cannot. If a person does not know about the fundamantal ideas of OOP and polymorphism, why would he care about the physical file and memory layout.
I am puzzled, honestly. Sorry.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Override not working
« Reply #22 on: June 23, 2015, 09:11:10 pm »
Criticizing is ok but a couple of information details through in would be better.

Polymorphism was the information detail. There is a lot of information available for anybody who wants to learn. Do you want me to copy it all here?

I try to to understand you taazz but I cannot. If a person does not know about the fundamantal ideas of OOP and polymorphism, why would he care about the physical file and memory layout.
I am puzzled, honestly. Sorry.
its like trying to understand the formula of calculating the trajectory of earth around the sun with out understanding addition, substraction division etc. 
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

eurythmic

  • New Member
  • *
  • Posts: 36
Re: Override not working
« Reply #23 on: June 30, 2015, 12:34:14 pm »
I agree it's important for a teacher to know their topic well before teaching it - hence my trying things out, developing my knowledge and using this forum for advice to ensure I am getting it right before teaching it. I am grateful to those who support me in this, and can do without unhelpful comments that criticise me unnecessarily.

Thanks.

 

TinyPortal © 2005-2018