Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

``Die CIS scum''

Name: Anonymous 2012-10-17 6:06

Amazing programming explanation using examples which respect people of all genders! I think everyone engaged in IT discussion and teaching should follow this style of highly tolerant and privilege-aware writing. ``Transgender'' and ``homosexual'' should become new ``foo'' and ``bar'' in educational code snippets.

---

I'll take a crack at the Factory Method pattern:

The Factory Method pattern uses a single method to construct objects according to some run-time data rather than hardcoding with new. For example, you may have a program which in various places may need to create a MalePerson or FemalePerson object depending on input, so you'd naturally pepper your code with:

if (gender.equalsIgnoreCase("male")) {
      return new MalePerson(name);
} else {
      return new FemalePerson(name);
}


Now what if you need to handle instances of TransgenderPerson or UndeclaredGenderPerson, etc? You'll have to go back and add those conditions to each place that conditional object creation occurs.

So, instead we employ the Factory Method pattern to be able to just call

PersonFactory.makePerson("male");

This encapsulates all creation of objects based on run-time data behind a single interface.

In Java this might be implemented as

public abstract class Person {
    protected final String name;
    public Person(String name) {
      this.name = name;
    }
}

public class MalePerson extends Person {
    public MalePerson(String name) {
      super(name);
    }
}

public class FemalePerson extends Person {
    public FemalePerson(String name) {
      super(name);
    }
}

public class PersonFactory {
    public static Person makePerson(String gender, String name) {
      if (gender.equalsIgnoreCase("male")) {
          return new MalePerson(name);
     } else {
          return new FemalePerson(name);
     }
    }

}


The declaration of the corresponding classes in Common Lisp is pretty straight forward:

(defclass person ()
  ((name :initarg :name :reader name)))

(defclass female-person (person)
  ())

(defclass male-person (person)
  ())


But, in Common Lisp, methods do not belong to classes, but to generic functions which dispatch specific methods based on their arguments. There is even EQL specialization on methods, which allows for methods to be dispatched based on the equality of their arguments to a specified value. So our PersonFactory in Common Lisp would look like:

(defgeneric make-person (gender name))

(defmethod make-person ((gender (eql 'male)) name)
  (make-instance 'male-person :name name))

(defmethod make-person ((gender (eql 'female)) name)
  (make-instance 'female-person :name name))


You'll notice that Common Lisp lacks a new operator. That's because there are no "constructors" in the usual sense of the word. The standard way of creating objects is to pass runtime data either a class object or symbol that is the name of the class object to the factory method MAKE-INSTANCE.

Now, that's all well and good, but let's look at what happens when we want to add the feature to create a TransgenderPerson to our factories. In Java we have to open the PersonFactory.java class file and modify it:

public class PersonFactory {
    public static Person makePerson(String gender, String name) {
      if (gender.equalsIgnoreCase("male")) {
          return new MalePerson(name);
      } else if (gender.equalsIgnoreCase("transgender")) {
          return new TransgenderPerson(name);
      } else {
          return new FemalePerson(name);
      }
    }

}


But in Common Lisp, we do not need to modify anything. We can just extend the MAKE-PERSON generic function with a new method:

(defmethod make-person ((gender (eql 'transgender)) name)
  (make-instance 'transgender-person :name name))

Name: Anonymous 2012-10-17 14:14

>>39
Well, Hitler was a vegetarian, but I don't see what that has to do with anything.

Name: Anonymous 2012-10-17 14:16

>>36
Murder is OK as long as they don't feel it, I bet.
So ravens are murderous creatures since they can survive on a vegetarian diet, but they sometimes choose to eat various small rodents.  Fuck you and fuck your shit.  And stay the fuck away from my future farm.

One thing I am guilty of with environmental impact is cow's milk
Proceed to immediate self-flagellation!

Name: Anonymous 2012-10-17 14:17

>>40
lol get mad xD

Name: Anonymous 2012-10-17 14:18

>>42
Humans know murder is wrong, you fuckwit.

Name: Anonymous 2012-10-17 14:19

>>44
define ``wrong''

Name: Anonymous 2012-10-17 14:20

>>45
Define my anus. You (or >>38) already have dictionary.com up in another tab.

Name: Anonymous 2012-10-17 14:21

>>32
So a shark eating fish will go to hell when it dies, because the fish felt pain? That bastard!

You can always kill an animal the fast and painless way. Now, we know that never happens and slaughter houses don't seem to give a shit about animal rights. I'll give you that.

But killing a cow/pig/chicken/fish without acting like an edgy ilovelegoreXD faggot, eating it and taking care of not letting the affected species going extinct is more than enough. I don't see what's the problem in that. Animals are not required in a human's diet, but neither are chocolate cakes, hamburgers or milkshakes. And I'm not going to stop eating greasy sweet crap only because it's not necessary.

Name: Anonymous 2012-10-17 14:22

I'm leaving because I have work to do!
Enjoy your inconclusion, >>48-!

Name: Anonymous 2012-10-17 14:22

>>46
Dictionary.app actually, I prefer Oxford.

Name: Anonymous 2012-10-17 14:24

>>32
My daily intake of water is fucking up the environment, that doesn't mean I'll stop drinking water.

but you don't have a choice about that, fagshit

Programming uses electricity, which slowly fucks up the environment. I won't stop programming because of that.

Name: Anonymous 2012-10-17 14:28

I'd wish the sagespammer would get rid of this piece of a nigger cock thread

Name: Anonymous 2012-10-17 14:32

>>28

Gender is very boolean. You are either a female, and can give birth, or you are a male and cannot. This is really the only definine part of male and female. Anything else is just hormonal levels.

By the way, both males and females have both testosterone and estrogen. Having more of one than most of the members of your sex does not make you of a differing gender.

>>31

But those aren't male/female only actions, they are merely acted upon more often than not by certain genders. Also, you don't need large case statements. If you're doing a "Perform Random Gender Action", you could just make two vectors of pointers to member functions named maleActions and femaleActions, and call a random index based on a decision from a simple if/else block or ternary operator. I mean, as long as we're using entirely void functions with no arguments, we could shove them all into the same data structure and do this thing in only a few lines of code.

Name: Anonymous 2012-10-17 14:37

>>52
That's sex, not gender.

Sex is binary, gender is pretty much anything you can pull out of your ass.

I'll start calling myself Touhousexual and I'll go on parades and make my own faggot flag and whatnot.

Name: Anonymous 2012-10-17 14:38

>>2-1000
YHBT

Name: Anonymous 2012-10-17 14:42

>>44
And why is murder wrong?

Because sky-daddy said so.
Sky-daddy doesn't exist.  Try again.

My moral framework has it as an axiom.
And my moral framework has punching stupid people (like yourself) in the face.  Try again.

I derived it from the ,,golden rule''.
That only applies to humans.  A large omnivorous animal would eat you given the opportunity.  A large omnivorous animal, given the capacity to understand and practise agriculture, would do so.

Now, it's fine if you choose not to eat meat.  It's your choice.  But don't try to take choices for me, okay?

Name: Anonymous 2012-10-17 14:52

>>53
I am a mathematician, and my gender cannot be expressed using a finite number of characters.  Moreover, our flag (a Sierpinski carpet) has an area of zero.

Name: Anonymous 2012-10-17 15:01

>>53

Gender is a synonym for sex. There IS no difference here.

>>55


The term "murder" applies only to humans. Quite literally, you can kill any non-human animal in cold blood for no good reason, and it will not be murder by dictionary definition.

Name: Anonymous 2012-10-17 15:06

CIS scum
What do you have against cheap colour printing?

Name: Anonymous 2012-10-17 15:16

>>57
Gender is a synonym for sex. There IS no difference here.

No, it's meant as the social, cultural constructs associated with the labels ``man'', ``woman'' or what-have-you. The equivalence between sex and gender has been dropped for decades now, as it doesn't explain transgendered people at all.
 
IHBT

Name: Anonymous 2012-10-17 15:19

>>59
No one cares!

Name: Anonymous 2012-10-17 15:31

>>57
Not if you use the modern definition of gender, which means lel i like chicken therefore im chikensexualxD

Name: Anonymous 2012-10-17 15:33

Define ``wrong''.

Name: Anonymous 2012-10-17 15:36

wrong |rɔŋ|
adjective
1 not correct or true : that is the wrong answer.
• [ predic. ] mistaken : I was wrong about him being on the yacht that evening.
• unsuitable or undesirable : they asked all the wrong questions.
• [ predic. ] in a bad or abnormal condition; amiss : something was wrong with the pump.
2 unjust, dishonest, or immoral : they were wrong to take the law into their own hands | it was wrong of me to write you such an angry note.
adverb
in an unsuitable or undesirable manner or direction : what am I doing wrong?
• with an incorrect result : she guessed wrong.
noun
an unjust, dishonest, or immoral action : I have done you a great wrong.
• Law a breach, by commission or omission, of one’s legal duty.
• Law an invasion of right to the damage or prejudice of another.
verb [ trans. ]
act unjustly or dishonestly toward (someone) : please forgive me these things and the people I have wronged.
• mistakenly attribute bad motives to; misrepresent : perhaps I wrong him.

Name: Anonymous 2012-10-17 15:36

>>59

>Social, Cultural constructs

So you associate yourself with a stereotype. Lovely. As a man who has seen ftm transexuals that are blatantly a mockery of negative male stereotypes (perverted, outwardly rude, etc...), I find the idea that I should consider them to be anything other than their birth sex to be highly sexist.

Tell me, if a white man goes around acting like a thug with complete disregard for societal standards while simultaneously demanding welfare payments, does he have a right to consider himself trans-black, just because he acts and behaves in a way society thinks black people act?

Name: Anonymous 2012-10-17 15:45

That squirrel stole my chestnut and I chased him and got lost and it was a bad trip and oh man where am I and this isn't fun anymore and why are fruit loops coming out of my mouth?

Name: Anonymous 2012-10-17 15:56

morality is bullshite. the marquis de sade got it right.

Name: Anonymous 2012-10-17 18:41

>>13

Are you an animal? No.

The word "animal" describes "any of a kingdom (Animalia) of living things including many-celled organisms and often many of the single-celled ones (as protozoans) that typically differ from plants in having cells without cellulose walls, in lacking chlorophyll and the capacity for photosynthesis, in requiring more complex food materials (as proteins), in being organized to a greater degree of complexity, and in having the capacity for spontaneous movement and rapid motor responses to stimulation"

The human is

1. Of the kingdom Animalia
2. Having cells without cellulose walls
3. Lacking chlorophyll
4. Requiring complex food materials such as proteins
5. Organized to a greater degree of complexity than plants
6. Having the capacity for spontaneous movement and rapid motor responses to stimulation

Well holy shit >>13, I think you may be wrong. I think the human being may actually fucking be A FUCKING ANIMAL by dictionary definition.

Name: Anonymous 2012-10-17 18:54

>>67
I think we already pointed that out. But yeah, he's fucking retarded.

Name: Anonymous 2012-10-17 19:18

>>67,29,10,8
Humans are the only animals capable of making intellectual decisions based on values. If you want to be a savage, no one is going to ``stop you''--which was never the issue in the first place. Don't pretend you're in the right.

Name: Anonymous 2012-10-17 21:36

>>69
Values? That shit depends on culture.

Name: Anonymous 2012-10-18 6:04

Lithp is gay.

Name: Anonymous 2012-10-18 9:51

>>69
If the western culture had ``bravery over everything'' as one of its ``values'', we would be bitching about how people who don't work out and haven't been trained to fight are everything what's wrong with our world. After all, it's one of our values, so fuck the rest of the world and the one who doesn't follow my culture is a retarded useless fuck with no morals.

Morals have nothing to do with this, as they depend on the culture.

Also,
http://news.yahoo.com/eating-meat-made-us-human-suggests-skull-fossil-211048849.html
http://www.sciencedaily.com/releases/2012/10/121003195122.htm
http://blogs.scientificamerican.com/observations/2012/08/08/early-meat-eating-human-ancestors-thrived-while-vegetarian-hominin-died-out/
If you think eating meat is wrong, then you should question other human behaviors like having sex (brings more people to the world and fucks up the environment), buying electronics (manufacturing electronics fucks up the environment) or eating vegetables (affects plants so it fucks up the environment even more).

Name: Anonymous 2012-10-18 9:52

EIN VOLK
EIN TOPF

Name: Anonymous 2012-10-18 9:53

>>72
Buy Haruhi DVDs.

Name: Anonymous 2012-10-18 10:01

>>8
if you motherfuckers try to touch my meat
Nobody's stopping you from eating your own meat. It's the fact that the meat you're eating belongs to unwilling third parties that makes you morally repugnant.

Name: Anonymous 2012-10-18 10:03

>>74
I miss Aya Hirano's voice.

Name: Anonymous 2012-10-18 10:04

>>75
I live in a country where using bold text is immoral.

fuck off pig.

Name: Anonymous 2012-10-18 10:06

>>77
The bolding was in the original, genius.

Name: Anonymous 2012-10-18 10:06

>>77
Moral relativism is edgy as fuck.

Name: Anonymous 2012-10-18 10:09

I use a 16k water stone to get my knives edgy as fuck.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List