2,427 karma · joined Jun 15, 2023 (3y ago) · 1,641 submissions
comment 1y ago · link · parent
I think that when someone tells you they fantasize about starting a small local retail business, that we shouldn't just shit on their naivite; we should listen to what they're really trying to say and help them find something that checks the boxes for them:
1. Something in the real world, preferably with physical products/services on physical products
2. Something with a larger degree of independence
3. Something whose value to the customer is obvious
4. Something which improves the world or their community in some way, and is not just extracting value from others.
Personally, I love writing software, but I hate Software companies
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
How much equity or salary you get in a company is a function of supply/demand and the marginal product of your labor. I would say there are probably fewer CEOs who can take a company from startup to unicorn status than there are really good founding engineers out there, so CEOs tend to get more equity in a company. Sometimes the founding engineer knows something that nobody else in the world does, so their equity reflects that. It's also a reflection of how much risk the engineer is willing to take on (they'll probably take a salary cut to be a founding engineer, and they also risk the company randomly running out of runway and finding themself suddenly unemployed).
But it has nothing to do with what you deserve. Maybe if the CEO/President is a sentimental type, he'll award you equity based on how much he feels you deserve but ultimately it's about supply and demand.
If a CEO puts in 90 hours a week at a tobacco company while his engineers put in 20 hours a week, does he deserve lots of money (and therefore a more comfortable life) because he puts more effort into killing people? Or does he deserve every bad thing that happens to him because he decided to spend his limited time on this earth making it a worse place?
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
If someone were to submit this code for review:
getUser(id: number): UserDTO {
return this.mapToDTO(this.userModel.getById(id));
}
and I knew that `userModel` throws an exception when it doesn't find a user (and this is typescript, not java, where exceptions are not declared in the method prototype) then I would tell them to wrap it in a try-catch. I would also probably tell them to change the return type to `UserDTO | null` or `Result<UserDTO>` depending on the pattern that we chose for the API. I don't need to know anything about the original ticket in order to point these things out, and linters most likely won't catch them. Another use for code review is catching potential security issues like SQL injection that the linter or framework can't figure out (i.e, using raw SQL queries in your ORM without prepared statements)comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
class MyComponent extends HTMLElement
{
private width: number | undefined; // must be | undefined or
// you'll get a typescript error
constructor()
{
// useless, unpredictable
}
connectedCallback()
{
this.initAttributes();
// using this.width will still require an undefined check at some point
}
initAttributes()
{
this.width = Number(this.getAttribute('width'));
}
}
If you could reliably load attributes in the constructor instead of being forced to do everything in connectedCallback (or even better, load them automatically with decorators), it would make typescript implementations much cleaner. Just some way to validate attributes before connectedCallback, or work with typescript guarantees would make this much more attractivecomment 1y ago · link · parent