Programming

Um this is why people hate java

I think I had this discussion ITT with suzzer a little while back, but Java does the absolute worst possible thing here, which is that it will accept a Boolean for possibleNullThing there (a Boolean being a primitive boolean wrapped up in an object). However, if at runtime this turns out to be null, it will throw a NullPointerException.

It’s fine to either have falsiness in your language or to (as C# does) refuse to compile something that might possibly be null there, it’s not fine to have some bullshit halfway-house arrangement which fails at runtime.

The point is that the existence of the variable is confined to the block where it is known to be non-null. The first version allows use outside of the null-check block which might cause a NullPointerException. Makes editing code easier when you know what is in scope and what isn’t.

Update: I am officially quitting my day job at the end of this month and will be an unemployed person/stay-at-home dad/tech company CEO come July! Thanks all for advice/discussion/guidance ITT, which has been a very helpful resource.

6 Likes

zomg! good luck, that’s awesome!

2 Likes

Wow good luck!

I got this comment pretty strongly from my parents (in a somewhat less valorizing tone) and from a lot of friends, which is superficially surprising, because the risk I’m taking is so very trivial. Apart from my beloved, sometimes regretted Tesla, I don’t really have any major expenses other than childcare, and on my wife’s salary alone, we’re still going to have a top 5% income. And when I told my boss that I was leaving, the first thing he told me was that they’d be happy to hire me back if I ever wanted to come back. So in terms of actual risk, there’s really none. There was an editorial in the Harvard Crimson a few years back, which I don’t even remember how I came across it, but I think about it often:

For new graduates, working at a consulting firm creates optionality because of the broad exposures (to industries and companies) and skills these firms purportedly develop. Going to graduate school creates optionality by enabling more opportunities than a narrow professional trajectory can provide. Working at prestigious firms and developing social networks are similarly viewed as enabling more choices and more optionality. And of course, the more optionality, the better.

In contrast, the closing of doors and possibilities signals the loss of optionality. This language doesn’t only apply to career planning: Don’t be surprised to hear someone in finance talk about marriage as the death of optionality.

This emphasis on creating optionality can backfire in surprising ways. Instead of enabling young people to take on risks and make choices, acquiring options becomes habitual. You can never create enough option value—and the longer you spend acquiring options, the harder it is to stop.

The Yale undergraduate goes to work at McKinsey for two years, then comes to Harvard Business School, then graduates and goes to work Goldman Sachs and leaves after several years to work at Blackstone. Optionality abounds!

This individual has merely acquired stamps of approval and has acquired safety net upon safety net. These safety nets don’t end up enabling big risk-taking—individuals just become habitual acquirers of safety nets. The comfort of a high-paying job at a prestigious firm surrounded by smart people is simply too much to give up. When that happens, the dreams that those options were meant to enable slowly recede into the background. For a few, those destinations are in fact their dreams come true—but for every one of those, there are ten entrepreneurs, artists, and restaurateurs that get trapped in those institutions.

Of course, this is not a pitiable outcome. And in fact, maybe those serial options acquirers are simply masking a deep risk aversion that underlay their affinity for optionality. Even if not explicitly stated, optionality was always the end rather than a means to an end.

(emphasis mine)

I’m not sure the financial gloss is exactly right, because lawyers do the same thing. I think a lot of it is the strength of social scripts or models. It’s easy (psychologically) to go to a fancy college, then go to a fancy law school, then work at a fancy law firm and so on. And all of those institutions define their own values of both success and “normal” behavior, which conveniently enough give a lot of prominence to continuing to serve those organizations’ ends. More than any actual risk, I think the impediment is just doing something strange without knowing anyone who’s done the same. Tech seems to provide stronger social scripts for entrepreneurship, which perhaps explains you see so much more of it.

At a social level, you can imagine all kinds of stories about how segregation and geographic sorting can perpetuate inequality. Even if there weren’t structural barriers to individuals achieving upward mobility, if the price of entry to the upper stratum is that you have to leave your home community and move to NY/SF/DC and/or start hanging out with people of a different class or race (socialize at more expensive restaurants, live in a more expensive neighborhood, etc.), then the knowledge you’ve gained about how to succeed from your starting point gets quarantined away from the group that would benefit from it, and a culture that orients people towards that pathway can’t be built. And of course structural oppression does exist and reinforces that quarantine effect.

Is it wrong to prefer Python to R just because I don’t like → as the assignment operator?

R is a hot fucking mess, I’ll allow any reason to prefer Python.

1 Like

Very sorry to hear about your girlfriend. This must be a dreadful time to be looking.

Reminds me a bit of this bit from my all-time favorite essay:

To start with the can-money-buy-happiness question is to assume you have a valid framework within which to make sense of what people might mean by a loaded-and-focused word like happiness .

To measure the ability to pursue quality of life in terms of income is to assume the validity of prevailing scripts that classify quality of life as a consumption commodity. Something to be acquired through some mix of direct provisioning by others, and cash outlays within restricted categories.

The problem goes deeper than this artificial separation. How is it meaningful to ask how income correlates with happiness without asking precisely how much control we have in spending it? Could the $75,000 threshold discovered merely be an artifact of enforced consumption rigidity in middle and upper-class scripts, where marginal income dollars above that amount are already earmarked for socially expected and institutionally incentivized expenses (think home-buying and saving for college)? A sort of “cost of doing business” in a particular social class? Do people who flout those norms manage to move the threshold higher? Or are they penalized so harshly that they regret flouting those norms? Do mavericks see increasing happiness levels up to $200,000 instead of $75,000? Or does the threshold drop because of the increased financial burdens that come with breakaway scripts?

Why isn’t the most important financial threshold in the inner lives of many, rich or poor, the subjective notion of fuck-you money, the first thing to study? Why isn’t there a major UN study tracking what people consider fuck-you money? Why aren’t Nobel-winning behavioral economists designing clever experiments to tease out how we think about this quantity? It is, after all, our main subjective measure of how not-free we perceive ourselves to be.

Nobody, other than bureaucrats who fund research and economists, asks the question “how much income is needed to be happy?” We already know that talking about happiness without talking about what trade-offs we are making to pursue it is meaningless. The rest of us real people ask the question “how much wealth is required to be free of scripts that dictate what trade-offs you are allowed to make?”

It does not really matter if you generalize beyond income to various in-kind quality-of-life elements like a clean environment or access to healthcare. If you are not measuring prevailing levels of freedom you are measuring nothing relevant. Until people start answering $0 to the fuck-you-money question across the planet, you can be sure that they do not perceive themselves to be free enough to properly pursue quality of life.

The interesting question is not what money doesn’t buy us that economists assume we do, but what it does buy us that we seek it so obsessively.

1 Like
1 Like

I can’t believe he didn’t rhyme “bucket” with “fuck it.” Worst case of poetic blue balls since “To His Coy Mistress”

1 Like

Anyone ever hired or promoted into a principal level role and want to talk about how you got there?

Does big mega corp matter or are we talking tech company?

IDK either? I’m well beyond the point of thinking I’ll do anything interesting in my career so mostly like yeah ship me those shrutebucks. Being a lead is fine and they pay me tons but afaik the principal step is the same shit different title and 25% more $ so yeah put me there plz.

Well I think my title at hyper-global-mega corp was principal developer.

But I was still a II at the old mega corp they absorbed. Several of my buddies were IIIs but mostly that was just because they were expensive contractors and making them IIIs was the only way they could get them to convert to FT. So there’s one route.

Funny thing was when hyper-global-mega-corp absorbed mega-corp - they invited all the IIIs to corporate headquarters. I felt left out. Turns out it’s because III is supposed to be either management material or like you built the entire gigantic system and give talks and whatever - and they wanted to evaluate what they had. They forced two of the IIIs to take a demotion. One quit, one accepted. The other eventually quit anyway.

Once nice thing that is I got a $63k retention bonus when the merger happened. Which is probably just dumb luck. I think the IIIs got $75k or more.

FWIW - my jobs at corporations have been infinitely more interesting and more fun than startups/small consultancies. I enjoy the chaos and pressure. Startups seem to have a massive inferiority complex about everything. Corporate people are just normal workers who don’t have huge egos, and very often extremely diverse - which makes for a much more interesting workforce imo.

Anyway I think the biggest thing you can do is start giving talks, get involved in local meetups and stuff like that, open source. Don’t just be a 9-5 worker. Write a book or something. Or get lucky and build the right thing at the right time and become indispensable.

The other thing is just keep working and building stuff and money seems to fall out of trees eventually. Might help to live in CA or another tech center where houses cost $1M so they know everyone needs the money.

/drunk ramblings

Just found this thread… didn’t realise half this board were developers lol. I do data warehousing & cubes (T-SQL & MDX mostly) and a bit of C# for funsies/dev tools. Not much to contribute to the thread, but thought I’d throw it out there!

Say you have a method whose return value depends on a large number of conditions.

One way to design the method is with a bunch of explicit conditions:

def some_method(self):
    x = f(self)
    y = g(self)
    if condition_1(x, y):
        return output_1
    elif condition_2(x, y):
        return output_2
    ...
    else:
        return output_n

Another way is to define a dictionary linking the conditions to the return values:

outputs = {(x1, y1): output_1,
           (x1, y2): output_2,
           ...
           (xn, yn): output_n}

def some_method(self):
    x = f(self)
    y = g(self)
    return outputs[(x, y)]

Is one way necessarily better than the other? If not, when would you use one option instead of the other?

This is obvious, but the first approach allows for more flexible conditions than you could build into a table (i.e., if x > y or if x % 2 == 0). It also lets you wrap up non-trivial logic into a well-named function to self-document the code. Finally, thinking about error-handling, if you get invalid data in the second approach, you’ll get an IndexError (although you can instead have outputs.get((x, y), default_value=None) to return a default/sentinel value instead). In the first approach, you can do something more complicated or raise a more helpful error (e.g., ValueError(f"x ({x}) must be less than y({y}) in some_method")).

On the other hand, if you don’t need to do any of that, and you’re just looking up the values of x and y, then the dict approach seems clearer and simpler.

Also note that you can drop the else's in the first approach, since the if condition2(x, y) block is unreachable if condition1(x, y) is true. Might save you an indentation level here or there.

1 Like

3 months nearly down as an individual contributor and I’ve learned the following:

There is very little incentive to getting your work done quickly. You either get a lot more work than your teammates (who may end up resenting you), or you have nothing to do and need to spend your time trying to look busy, which is like 1000x worse.

uhh you’re doing it wrong, if you happen to get it done quickly, spend the rest of the time jerking off and then commit at the end of the day. 10x easier in pandemic of course.

1 Like