ansible47
Highest Rated Comments
ansible47778 karma
For laypeople curious what this means:
There are a few different kinds of equality in programming. Sometimes you're assigning a value to a variable (see edit*), which is almost always done with a single (rather than several) '='.
Other times, you want to check a value that you (hopefully) already assigned against another value. Since using the same symbol would be confusing, this is generally done with '=='. The result of a test like this is generally a Boolean flag (yes or no, 1 or 0).
To understand the '===', you need to realize that variables (generally) have a value and a type. A triple equals tests BOTH. Remember in basic math when they were talking about Whole Numbers and Natural Numbers and Decimal Numbers and all that bullshit? Those are examples of types of values. A type just lets the computer know what form your data takes, and how to interpret it. The computer doesn't bother storing a '.' for a decimal number, it just knows to stick a the last two values after a decimal place.
So let's say you have two different types of values. An integer and a decimal (or floating point number, if you want compy box terms). The integer equals 2. The decimal equals 2.00. The value of these two numbers is the same, so a '==' test will return TRUE.
But their type is different. It would fail a triple equal test, because both the value AND type need to match.
This applies to a lot of popular languages, but definitely not all. Vbscript might as well tell you to go fuck yourself.
The brackets and parenthesis refer to elements in an array, which is a fancy term for a list that lets you do stuff to it in particular ways. Programmers like efficiency, and there are 10 digits, so we're gunna use all of 'em, god dammit, so our lists start at 0. [0] means "the first element in this array"
*EDIT: Some people wanted an explanation of variables... I'll try to give an oversimplified analogy and general explanations. A variable is like a house. It has form and structure, even though the stuff in the houses might be different. To build a house, you first need permission from a central authority. It's called declaration, but in the analogy it would be like asking your town hall (the computer) to build a house. The town will say "Alright, do we have space for a new house? Hmm... seems like we do. Okay, here's your plot of land."
Once you have permission (and your program wont run if you don't. You'll know), you can build your house. You can leave it as an empty house for a while, or you can put stuff in it immediately. This is assigning, or giving value to your variable. Depending on how your house is built, you can only put so much in it. In many cases, if your try to fill your house with too much shit, it will actually spill over into your neighbor's house and cause all sorts of nonsense. So you want to make sure that you know what kind of stuff to put in your house.
A type is like a standardized foundation that town hall can use to plan out the most efficient way to distribute land and resources. The town generally has a limited variety types you can chose from, and chosing is important. A 4 person family doesn't need to register for a mansion, so they'll ask for a mid-sized house. The family could fit in anything bigger than a 4 person house, but it's just not a good use of space.
A program is just a plan for what to do with inputs and outputs from a processing unit. You don't actually do anything when you program, you just giving the computer a plan for how to handle its shit.
Since it's late and I'm mildly intoxicated, think of arrays like a street block of houses. It's more complicated than this, but imagine that you wanted to keep families (the shit you fill variables with) that were related to each other in adjacent houses. It would make organizing parties easier, and you could easily reference a bunch of families at once ("Those Garcia's are dynamite at horse shoe!" gestures at entire block). It's generally very important that all the houses on the block be of the same type. Otherwise your mansion would stick out into the street and it would look silly.
It's just a convenient way to reference a bunch of similar things at once. House(0) would be the first house on the block, house(1) the second, etc. Sometimes you can declare a block without knowing how many families will be in it, sometimes you can't. This analogy is actually a lot of fun, since it follows a real aspect of arrays: it's a lot of fucking work to add a new house in the middle of a block. Much less work to add something on either end.
As far as what he's talking about directly, eh, it's web dev stuff. I don't really know specifics. Window refers to your browser window (and contains a shit-ton of information), and think of frames as windows within a window. I'm going to start saying "object" instead of "house" now, and please don't correct my interchanging use of list/array/queue/block.
So window === window.frames means that:
- window is an object that contains a block of frames
- frames are the same type of object as windows. So effectively, every window contains a list windows.
window.frames.item(0) === window.frames[0] means that:
- windows has multiple ways to access different frames. These are just two different syntax ways to reference the same thing. It's like saying "You can use my last name, or the name that comes after my middle name"
item(0) === window.frames[0]
- Fuck it. Who needs to type out "windows.frames." every time I want to do "window.frames.item(0)"? Let's just make it so I can go item(1) any time and get the reference the second frame within the window.
I think that's everything. Phew. I definitely got details of this wrong. Smarter people will correct me.
ansible47118 karma
I'm not gonna be able to do this interview. This is really causing some flashbacks and triggers.
...cue every idiot on reddit making fun of trigger warnings.
ansible47109 karma
He's disappointed in Nacho and even worse, himself. Shame might be the best word.
ansible471017 karma
He's not even looking.
Snoop can feel the whiteness.
View HistoryShare Link