[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I'm introducing classes to my students today. What's

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 53
Thread images: 5

File: students.jpg (1MB, 2294x1523px) Image search: [Google]
students.jpg
1MB, 2294x1523px
I'm introducing classes to my students today. What's a good example to use? I'm thinking cats, dogs or cars, but that's so overplayed. Give me something unique /g/
>>
>>55771759
neets v chads
>>
>>55771759
Tell them they should know that shit already
>>
class person

class man
method earn_money

class woman
method menstruate
method complain
>>
>>55771759
game enities

OOP is cancer tbqh
>>
>>55771759
classes aka races of the human race. do it
>>
>>55771759
Animals is the easiest to follow that's why it's overplayed.

Make an animal class with properties for numbers of legs, color, and bs and then create simple constructor methods and other nonsense so you can demonstrate something like

zebra.num_legs

And it would return 4. Or fifty if they are truly retarded.
>>
>>55772755
this. OP, don't try to be unique merely for the sake of being unique. if the metaphor seems bad to you, then certainly find a better metaphor than the animals one, but don't go looking for one just because it's "overplayed". find one because you have a problem with the mental model students generate.

coming up with metaphors to teach students is like walking a minefield for various reasons. for one thing, you might end up with a metaphor that doesn't resonate with as many students. you can evaluate this, but if you're not a researcher in education then something tells me you don't know how to do this (to say nothing of not having the resources to run an experiment except with live classes, which is ethically really frowned upon). but aside from that, you might risk coming up with a metaphor similar enough to >>55772701 to be offensive to some student for some bullshit reason. if you don't have tenure, do you really want to risk a complaint spurred by you simply wanting to be edgy?

and to be clear, i'm not saying you shouldn't have freedom to teach the way you want (provided you think it's helping and there's no evidence that it's actually yielding worse outcomes), but i also feel very strongly that people who put themselves in precarious positions with their careers for *no* other reason than out of boredom arguably deserve to get burned.
>>
>>55772755
or 5 if it's male
>>
Use an actual software example. I never understood classes until I saw it in action. For example illustrate a pluggable multi-user web service architecture. You'll have a class for the main application, a class for a user's profile, classes for the web services and an abstract web service class they extend, maybe classes for "triggers" like a scheduled job that runs the job once every so often or upon user input. You can then also demonstrate things like interface patterns, abstraction, inheritance, polymorphism, etc. and their practical applications (what happens when we need to add a new type of Web service? We just create another class that extends the abstract web service class. What if a particular set of web services needs to be able to do certain common things? Create an interface or have them extend an abstract class which in turn subclasses the abstract web service class. Etc).

Or, if your students are dumb, maybe use the idea of a company in a cost tracking scenario where everything (employees and assets) inherit from a "resource" class with a cost associated with it, with a tree structure (e.g. Developer implements IndividualContributor extends Employee extends Resource).
>>
File: 1417867686680.jpg (34KB, 446x358px) Image search: [Google]
1417867686680.jpg
34KB, 446x358px
>>55771759
>He's a STEMfag
>>
>>55773134
The fuck is wrong with you?
>>
>>55773245
he's trolling. he's not even very good.

but apparently he doesn't need to be that good to get you.
>>
>>55773313
You don't understand I'm legitimately perplexed
Why would someone post that kind of reaction image next to
>He's a STEMfag
It doesn't make sense
>>
>>55773392
he's (trollishly) making it out like being in STEM is cringeworthy or something.

do you not understand the image? or are you not understanding the premise of trolling?

help us to help you
>>
>>55771759

class person
method eat
method shit

class black extends person
method steal

class african extends black
method play_bongos

class jew extends person
method get_account_balance
private method formulate_scheme
>>
>>55773420
I didn't understand the image, it looks like a man with dentures shriveled in the sun
>>
I remember my professor introduced the concept by making us read up on and write an implementation of particle swarm optimization.
>>
File: 9KGFr4k.png (189KB, 600x600px) Image search: [Google]
9KGFr4k.png
189KB, 600x600px
>>55771781
This
>>
>>55773448
sometimes memes spin off. try not to overthink things on 4chan.
>>
>>55773467
>>55771781

-T. doesn't-understand-OOP
>>
>>55773485
I hate that memes are a meme now
>here's a thing I like /g/
It's a meme
>but it has qualities like...
Meme
>But it's objectively better than
MEME!

I honestly heard SSD's called a meme once, I didn't know if he was trolling or an idiot

Why do I still come here
>>
>>55773567
that's not what i was talking about at all. did you just have a conniption?
>>
File: 1460207437952.png (313KB, 1680x740px) Image search: [Google]
1460207437952.png
313KB, 1680x740px
>>55771759
>>
Classes didn't make sense to me when they were explained as literally classifying code, and the animals thing didn't sense to me either. I understood how to make them but I didn't the see the point of classes and objects until I looked into how games work.

Show them a class called Zombie.
Make an object called Zombie1.
Show that you can do stuff like Zombie1.HP and Zombie1.move().

It's important that they understand why they would want to do something before you force them to memorize a bunch of syntax.
>>
>>55774188
explane
how would that help?
>>
>>55775041

Everyone is different but for me I find classes make more sense as blueprints than as classes.
>>
>>55774188
Or you can just have a big list of zombie structs with functions that act upon zombie structs.
Thats semi-oop without having to resort to oopshit.
>>
>>55775069
give an example
im a newbie learning classes in python but I'm having trouble understanding
pls
>>
>>55775109

Sorry I thought you were trying to say my idea was stupid instead of actually wanting an example.

Imagine you're making a Mario clone and you want to put enemies in the game.

You'll make a class called Goomba. Inside the class, you declare all the variables and functions that Goombas are going to use. You can give it a variable called 'speed' and make it equal to 5. Any time you spawn a Goomba it's speed will default be 5 because that's what you set it as.

Then you can make a class called Koopa. In Koopa you can declare another variable also called speed and set it to something like 7.

Koopas and Goombas both have their own speed variable and they can be different. Even though in the code there are two variables with the same name they don't interfere with each other.
>>
>>55775261
ok I see.
do subclasses have to support all of the paren'ts class's methods?
>>
>>55775351

You should read into "inheritance" for info on that. I'm a shitty programmer so I'm afraid of misleading you if I try to explain anything past the basics.
>>
>>55775351
In general yes, they children need to have all of the parent's methods and private member variables. It would not make sense for it to not support any parent data.

For example, a human parent class and a student subclass. A human has getName(), getBirthday(), getEthnicity(), etc. A student, also being a human, must have those methods too because students have names. birthdays, and ethnicities.

You can also override the methods to not return anything or return specific values if you want them to.
>>
>>55771759
the one where you don't ask /g/ for advice on how to teach your class
>>
>>55775466
i don't know, it just seems like a hindrance to do that
is it possible to just copy a class and some methods (or but some methods)
>>
>>55775506
That just defies the logic and philosophy of inheritance. If I was in a situation where I wanted some parent methods to return null because I didn't need them, then I'd just do away with inheritance altogether.

That's why inheritance is generally looked down upon because it takes an inhuman level of foresight and careful as fuck design. Though, when it's done right, the polymorphism it provides is brilliant
>>
File: YFW.png (238KB, 414x308px) Image search: [Google]
YFW.png
238KB, 414x308px
>>55771759
"so overplayed"

hey mosby, those kids arent your friends, stop trying to wow them. theres a reason those metaphors are common- everyone fucking gets them,
Sounds like instead of introducing classes, you should attend one... ON TEACHING.
>>
interface gender
class man implements gender
class woman implements gender
class transgender implements gender
class Christine W Chandler extends transgender
>>
>>55771759
class WhitePrivilege extends Privilege implements HateSpeech, Normative
{

}
>>
>>55771759
Vehicle (car, van, truck bike -> colour, doors, wheels, weight, capacity)
Residence (house, apartment, castle -> rooms, floors, bathrooms)
Communication device (landline, cellular phone, radio -> number, manufacturer, Pokeman Go capability)

Animal is perfectly fine too.
>>
>>55773494
Both extend Human but neet implements the autist Interface
>>
>>55771781
this

property of neet
>isVirgin:true
while chad
>isVirgin:false
>>
>>55771759
just classes or inheritence too?
simple explanation of class is user defined type.
analogies like animals, vehicles are about inheritence, is-a relationship.
>>
>>55775880
>Normative
>humans aren't allowed to have culture unless they are not white
>>
Location
->Continent
->Country
->City
They all share a name and population number, and possibly ruler, but the continent wouldn't have a ruler and return null or something, and the country might have something like languages spoken.

How's this example? I think it's pretty good compared to most of the racist and sexist things in this thread
>>
>>55771759
>modeling your class hierarchies on the real world instead of based on the data they need
>>
>>55771759
banana monkey jungle
>>
>>55778515
This.
>>
>>55772909
You're taming his post way too seriously. Shitpost some meme that is offensive, but also somewhat true and scroll on bruh
>>
>>55771759
I did Hell once.

I made an abstract class named Hell and I made children classes that represents one division of Hell.

Also obviously there were a lot of kinds of guards with different permissions. Some could operate in multiply division and such.

Also this for the residents.


Use method name like Lust, Greed..cut out heart etc.
>>
>>55775506
Most of the time I use inheritance when I need to override default behavior of some class method from some library to suit my use case or when I'm implementing some pre-defined interface or abstract class.
>>
>>55775506
If you wanted a class (call it A) that supports some of the methods of another class (B), but not all of them, then you might have A be the parent of B, since B will support all of A's methods, with the addition of a few of its own.

If they share some methods, but each have some unique ones, then you might want to have them both inherit from a common parent.

Sorry if this is confusing, but you're better off reading a book or going through an online tutorial or something.
>>
>>55773643
He brought up a related topic you conversation Nazi
Thread posts: 53
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.