136 karma · joined Aug 20, 2017 (9y ago) · 103 submissions
comment 4y ago · link · parent
comment 4y ago · link · parent
I guess, if your goal is to write optimizations, focus on details. If your goal is to find solutions or think creatively, focus on abstractions. Obviously, there’s a lot of overlap, but I’m not sure how else to describe it.
comment 4y ago · link · parent
I have two suggestions.
The first is, if you haven't realized this already, don't struggle with the problems. Think about them for a few minutes, and if you can't solve them, look up the answer and try to understand it. A few days later, try it again. After a few times, you'll automatically be able to solve the problem, and wonder why you thought it was so hard. After enough problems, your knowledge will sort of magically generalize.
The second is, while I love the book, a lot of its explanations of concepts are very flawed, and can make anyone feel like an idiot not because the concepts are hard, but just because of the language used. That's because a lot of the ideas in the book are self-referential, so they're hard to explain in a linear book. And rather than give ambiguous explanations the authors try to be very precise, but that means using specific words you may not have the background yet to understand. Once you work through more of the book, you'll have the context to go back and actually understand what the hell they were talking about in the first few chapters. So on your first read-through, I wouldn't sweat understanding everything, just try to get some of the high level ideas. Then read it again with more context and it will feel much easier to actually understand the details. I'm glad I didn't take the course at MIT, because I wouldn't have been able to do this, but I think it is really the key to understanding the content.
comment 4y ago · link · parent
We understood functions as "mappings" between objects for hundreds of years, and when programming came along it gave us new ways to think about functions, but being able to "make" a function in hardware/software doesn't actually change what a function is at its core.
There's a reason why computer science professors explain concepts at a high or abstract level and don't jump into implementation to help students understand them. It's because the concepts ARE the high-level meanings, and if you need to see an implementation then you're not really understanding the idea for what it is.
If an idea stays abstract in your mind, it gives you more flexibility with how you apply it and more ways to find use out of it. But it does take a mindset shift, and is an actual learned skill, to be able to see something as purely abstract and accept that how it's made doesn't matter.
-- Edit - just realized who I was replying to. So take this comment as not meant to be lecturing, but just a 2c to offer :).
comment 4y ago · link · parent
comment 4y ago · link · parent
I feel like there's essentially no useful type inference, writing custom types is a nightmare because everything has its own special keyword rather than a simple core set of composable types, error messages feel intentionally vague, and having to write constructors and custom "isType" checks for every type you define is a massive chore.
In Haskell I could write:
data Tree a = Leaf | Branch (Tree a) a (Tree a)
tree = Branch (Branch Leaf 1 Leaf) 3 (Branch Leaf 2 Leaf)
whereas in typescript it would be something like: type Leaf = {
type: 'leaf'
}
type Branch<a> = {
type: 'branch'
v: a
l: Tree<a>
r: Tree<a>
}
type Tree<a> = Leaf | Branch<a>
const isLeaf = (l: any): l is Leaf => l?.type === 'leaf'
const isBranch = <a,>(b: any): b is Branch<a> => b?.type === 'branch'
const isTree = <a,>(t: any): t is Tree<a> => isLeaf(t) || isBranch<a>(t)
const Leaf = (): Leaf => ({ type: 'leaf' })
const Branch = <a,>(v: a, l: Tree<a> = Leaf(), r: Tree<a> = Leaf()): Branch<a> => ({ type: 'branch', v, l, r })
const tree = Branch(2, Branch(1), Branch(3))
How does this not feel like a major pain in the ass? Is there a simpler way to get typescript to do all the boilerplate for you?comment 4y ago · link · parent
The first is that when you're asking emotionally charged questions (as anything involving kids' happiness is), it can be a good idea to find ways to make it feel "okay" for someone to give a socially unacceptable answer. One common way is to apply some pressure for not telling the truth. For example, you could start by asking "does your child have any close friends," and then follow it up with, "if your answer was yes, how many close friends do they have?" It's sort of like being caught in a lie in real life - once people start asking follow-up questions, the pressure of keeping up the lie builds. In a survey, no one is watching you, so if you can find a way to make the sub-conscious pressure of not being totally truthful higher than the pressure of admitting something difficult, people are more inclined to revert their choices and give the truth. But this doesn't always work.
The second part is to look at some popular survey makers' websites where they take common questions and re-word them in better ways. For example, https://www.medallia.com/wp-content/uploads/pdf/resources/Me...
comment 4y ago · link · parent
Others have mentioned the problem of grouping children together into the same sentiment, so I won't comment on that. But I feel this survey suffers from some priming and conformity bias issues.
The survey is very "soft" in the sense of asking opinion questions, which can vary wildly with the respondent's mood, time of day, time of year (just had Christmas together as a family and everything's good), etc etc. A single survey at a point in time has basically no value, which is why I generally disregard surveys I see in the media. Surveys really get most of their value through asking the same questions repeatedly at different points in time so you can "average out" a lot of that bias. But in order to have results with any legitimacy, you almost need to split each question that you actually want to ask out into several different questions, some of which have numbers attached to them.
For example, the question "Does your child/children have friends (not including members of their immediate household)?":
A parent is more inclined to affirm their biases and assuage any guilt they might have over their child's loneliness than to help you get accurate survey data. It also depends on what a parent considers a friend versus what the child might consider a friend (someone to hang out with vs someone they feel a real connection with and are comfortable sharing things with, for example). I'm guessing you'd get very different answers if you asked the child the same question.
I can't imagine a parent is very willing to say their child has no friends at all, but you might split the "core" question out into multiple different questions - "how many close friends does your child have," "how many acquaintances," etc, with answers in different brackets (1 or fewer, etc). And then ask the general sentiment question after. The advantage of this is that you actually have something to compare across time. If you only have sentiment questions, it's almost impossible to know what the respondent has in mind for a "friend" when they answer the question.
I have the same feedback for the "How often does your child or children complain of feeling lonely or not having enough friends?" question. Different personalities will complain more or less, but that doesn't indicate how lonely a child actually feels.
A minor point, but without randomizing the question order or randomly flipping the answer options (ordering from negative sentiment to positive sentiment instead of positive to negative), you're very prone to influencing answers by "leading" the respondent to certain answers. You'd be surprised how much of a difference this makes.
Writing good surveys is very difficult, but you might pull up a list of common survey biases and run each question through the list. My 2c.