This is misinformation. The Guardian article explains that very little corporate taxes go to Finland.
Jussi Kangasharju, head of computer science at the University of Helsinki, said that while datacentres brought a limited number of jobs, potentially boosting the local economy, the benefits on a national level were minimal. “Really, for Finland, there are no benefits,” he said. “They are international companies serving international customers. Very little corporate taxes go to Finland. Datacentres ultimately have very little benefit for others except the datacentre operator.”
That depends on the quality of the degree. I was well served on my Software Engineering degree, coupled with the trader school in computing I went during high school.
Then naturally seniority teaches office politics, and what to actually invest time on.
Written exactly like that, yours is obviously cleaner.
But, if that original code had comments and traceability of each condition and return to a specific domain scenario, you would be doing a disservice by collapsing it to the one flat boolean expression. In that case, it may be better in its expanded form, and you should let an optimizing compiler do the collapsing.
If there were comments for each conditional, it should still be refactored as
return a || b // comment 1
|| c // comment 2
// long comment 3
// on multiple lines
|| d;
Many years ago, "lines of code" was the classic example of nonsense management metrics. Today, there are somehow HN users who argue that lines of code is indeed a good metric and ask "But what if the code had comments?" as if they have never seen comments interleaved with code.
> In that case, it may be better in its expanded form, and you should let an optimizing compiler do the collapsing.
This is nonsense. This optimization is not about compiler optimization for efficiency. It's an optimization for human readability and maintainability.
FWIW, I'm no advocate of "lines of code", or really any KPIs at all. All I'm saying is context matters.
Such branches could make sense if the conditions have to do with underlying domain concepts, but you expect the outcomes to be revised. It could just be a moment-in-time accident that they are all returning True right now.
This kind of tension is also where you often see indirection via configuration files or other auxiliary data structures. Or in the old days, things like bit fields instead of booleans, so that merging the conditions would encode different small integers to use as lookup table indices.
That's still going to make it hard to read. I'd have one big comment above talking about the different cases and then one line of code. Even with the slightly higher risk of getting code and comment out of sync. But that context switch between code and comments you need when you read this one return are pretty awful.
Right, and do you spend so much of your time doing that your net LoC is negative? If that's the case it implies people are writing code only for other programmers to clean it up. Programmers solving a problem created by programmers. That's dysfunctional. Effective engineering as I see it would be putting the processes in place to prevent having to constantly rewrite code.
The decline of the US government is the faster than "Europe", because it's been declining rapidly in a few months. The US government currently has a monthly quota for ICE arrests. ICE agents racially profile people and ignore non-white people telling them they are US citizens because they assume they are lying. Non-white US citizens need to have papers on them that prove their status (US citizen), or else might be disappeared. The US government now bans immigrants from a list of dark skin countries but fast-tracks White South Africans for immigration. It politically persecutes their political opponents and ignores the rule of law. It is preparing for war with Venezuela, which would conveniently tie up US resources as Russia positions itself for entering Europe.
The UK is rapidly declining as a close second, but calling it "European" (especially when UK citizens see themselves as non-European) is just a lazy generalization.
Why would the Chinese government want to regularly launch cyber attacks against US infrastructure, except it's been happening for years? US security companies and governments have been defending against it for years and have even cataloged the state-sponsored attack groups.
Jussi Kangasharju, head of computer science at the University of Helsinki, said that while datacentres brought a limited number of jobs, potentially boosting the local economy, the benefits on a national level were minimal. “Really, for Finland, there are no benefits,” he said. “They are international companies serving international customers. Very little corporate taxes go to Finland. Datacentres ultimately have very little benefit for others except the datacentre operator.”