8,634 karma · joined Jun 23, 2011 (15y ago) · 7,679 submissions
comment 2y ago · link · parent
That may be true, but houses aren't that expensive. If you're, say, Austin Matthews making $13MM per year in Toronto, you can still buy a lot of houses. That capacity is not diminished by some tech mogul in SF making $130MM per year.
The question is, as always, will something better come along? Indeed, housing is the purchase of last resort. Give people something better to buy and they will! People in Canada especially are happy to buy real estate like mad at this juncture because, frankly, what else is there to buy? Canada doesn't offer much else. You're not going to work to make $13MM just to hold an IOU forevermore. People making $13MM want to collect on what they've created and have something to show for it.
The US housing market crashed back in 2006 because tech started showing promise ("Web 2.0", mobile shortly thereafter) and the money left housing to buy into the newfangled tech. It's not clear what Canada's equivalent will be. Granted, it's banking heavily on skilled immigrants to come up with something, so there is possibility of yield. Time will tell.
comment 2y ago · link · parent
The problem is just like you said, though: Wealth inequality weakens collective bargaining.
A union only holds power by being able to force a stoppage of work, but workers can only afford to stop work if they are rich. Without the arrow of wealth inequality reversing, unions will continue to falter anywhere the workers are poor.
That's just basic economics. However, figuring out how to reverse said arrow is extremely complex economics. If we knew how, we'd have done it already.
comment 2y ago · link · parent
Of course it has enumerations. It has had them from the get-go. After all, enums are a workaround to help deal with the shortcomings of a basic type system. You're bound to find them anywhere you find a basic type system, which certainly describes Go.
In fairness, there does seem to be some confusion floating around about the difference between enums and sum types, with some mistakenly calling sum types enums. Indeed, Go does not have sum types. This is what languages with more advanced type systems are bound to provide instead. Enums are pointless when you have a more expressive type system.
> Error handling requires lots of boilerplate.
What patterns are you seeing in other languages when it comes to error handling without the boilerplate?
Certainly there are other languages that provide shortcuts when not handling errors, but that's something else entirely.
comment 2y ago · link · parent
> This facilitated more people living outside the city
Most people lived rurally prior to WWII. And of those who lived in urban areas, most were in urban areas of the small town sort. If we accept the lack of excitement suggestion, what was so exciting about said rural and small town areas? Why can't people today engage in the same excitement?
comment 2y ago · link · parent
What about, for example, the loss (or stagnation, as it is sometime thought of) of culture we've seen since the smartphone? I think it is fair to say that the smartphone – or a closely related technology – is why that has happened. Take music as a prime example: When I was young, you pretty much had to listen to the same music as everyone else as it was very hard to discover anything beyond. The music everyone was listening to defined a culture. These days, with the change in technology, we could very easily never hear the same song. But someone who has never touched a smartphone in their life is not excluded here.
There is quite a bit of evidence to suggest that suicide rates are higher amongst those who don't find a shared identity. Interestingly, youth suicide rates also dropped precipitously during the COVID period. I expect screen time shot through the roof during that phase! But, perhaps, knowing that everyone was dealing with the same COVID experience provided something to identify with.
comment 2y ago · link · parent
The program is correct – it complies and runs just fine – but the original ask was faulty. Without any kind of real enum support in Pascal the language, there is no way to perform the same operations as is possible in languages that do have natural enum support. This program is the best you are going to do in the absence of that support. This was all detailed earlier.
Again, you are trying to compare apples and oranges. Rust[1] may try as it might to call sum types enums, but enums and sum types – along with Pascal's pseudo 'sum types' – are different models. I understand where your confusion stems from as there are a lot of similarities, but there is also a difference.
[1] And Swift originally, but its documentation is updated to make clear that, contrary to what the name implies, the language's enum construct is actually sum types and not enums.
comment 2y ago · link · parent
While sum types first appeared in Algol 68, there were some unsolved issues at the time. So Pascal came along with its half-assed 'sum types' as a tradeoff between the benefits of true sum types and what was tenable given the constraints of the time. But there is no reason for any language created in the last 50 years to follow in that path. We've long solved the problems they had.
Go benefits from enums because it has a very basic type system.
Trying to improve on enums by extending the type system, along the lines of what Pascal did or otherwise, is hilariously nonsensical. If you are going to build a better type system, just get rid of enums completely. You don't need them.
Sure, it was a reasonable compromise in 1970, but it is not 1970 anymore.
comment 2y ago · link · parent
That is, with the caveat that Pascal does allow the union to be converted to its underlying enum representation. If we provide such conversion to get at the enum, then sure:
Program Lander(output);
type
planet = (unknown, mercury);
var
landingOn: Integer;
begin
landingOn := Ord(mercury);
writeln('Landing on ', landingOn);
landingOn := 42;
writeln('Landing on ', landingOn);
end.
But you're ultimately comparing apples and oranges.comment 2y ago · link · parent
What is different is that Pascal added an additional layer over enumerations – what is basically a poor man's sum types – to hide that there are enums under the hood. In fact, one has to perform an explicit conversion if they want to access the enum. Sum types predate enums, and no doubt they were trying to stay close to sum type semantics without the overhead. Something later languages, like C and Go, chose to forego in favour of exposing the enums naturally.
But if you're going to go to all the trouble of implementing a poor man's sum types, why not just do it properly? It's not 1970 anymore. We've solved the overhead problems. Sum types are perfectly viable these days.
comment 2y ago · link · parent
Of course. Same as C:
#include <stdio.h>
enum planet {
unknown,
mercury
/* ... */
};
int main() {
planet landingOn = mercury;
printf("Landing on %d\n", landingOn);
landingOn = planet(42); // What a hack!
printf("Landing on %d\n", landingOn);
}
Value constraints have nothing to do with enums. Enums are exclusively about numbering – and as your code shows, the numbering works just fine. Value constraints are an independent feature. One that Go (and C) lack completely, not just in the case of enum values. You can compile with broken values throughout. Consider: type EmailAddress string
var email EmailAddress = "Not an email address" // A-OK!
Compare that with a language with a more advanced type system like, say, Typescript: type EmailAddress = `${string}@${string}`
let email: EmailAddress = 'Not an email address' // Compiler error
You can probably make a good case that Go would benefit from value constraints, among other features, but if you're going to start adding such features, why have enums at all? Again, they're a hack to work around a limited type system. If your type system isn't limited...comment 2y ago · link · parent
Funnily enough, Algol 68 had sum types, although controversially so due to overhead concerns. If only Go had copied the state of programming before 1970, then we wouldn't have to listen to all the nonsense about enums sucking. Of course they suck – they are, and always will be, a hack to work around a limited type system.
comment 2y ago · link · parent
comment 2y ago · link · parent
It's clearly not. Either<T, Err> creates a dependence between T and Err that should not exist. They are logically independent variables. The state of Err has no reason to imply anything about the state of T.
I'd be inclined to agree that, for all practical purposes, it is the best we've got, but that doesn't mean it is right. An ideal language can do better.
comment 2y ago · link · parent
There's not much more you can do with them. A enumeration is literally assigning a number to something. That is all. Enums suck, fundamentally.
Other language features, like value constraints, can help improve the experience of using enums, but, really, if we are inventing a language, why have enums at all? If you think you have a use case for enums, a more advanced type system will offer a better model for your problem.
Sure, enums were a clever hack in the days of yore when we didn't have a good grasp of type theory, but are pointless in a modern language. Of course, Go is purposefully trying to be a language of yore, so it stands to reason that it would have them and all the suckiness that goes along with it, but, again, if we want it to be a modern language then you don't need to hack on top of enums with new features to make them nicer. You can get rid of them entirely.
comment 2y ago · link · parent
A fair assumption. It is extremely likely that the economy is slower than it would have been if interest rates remained low. Things were starting to get extremely hot – which is why we saw higher interest rates arrive in reaction.
There was a lot of concern floating around that rates would overcorrect (which, to be fair, may still prove to be the case – it is still early days), leading to an economy slowing more than needed, but the so-called "soft landing" was always the goal. Explicitly so. The status quo is in quite in line with what we were hoping to see come out of the higher rates, slowing the economy just enough, but not too much.
comment 2y ago · link · parent
Enums suck, period. That's why many modern languages don't offer enums at all, providing sum types instead, which more accurately model what most people are trying to use enumerations for. It is an antiquated pattern that may have served a useful purpose in the early days of computing, but we've learned a thing or two about programming since then.
Well, at least you've come around to recognizing that Go does have enums, even if you needed someone else's words to say it. After all, Go enums can't suck if it doesn't have them. But, of course, Go purposefully tries to be antiquated. That's kind of its whole deal. Naturally it is going to have enums to really drive home the antiquatedness.
comment 2y ago · link · parent
From the GNU C manual: "An enumeration type represents a limited set of integer values, each with a name."
Which is exactly what Go provides. Which isn't surprising as it is identical to C in that regard.
comment 2y ago · link · parent
Everything you spoke to is around people doing relational algebra badly. That has little to do with SQL. The same mistakes would lead to the same problems if the database used, say, QUEL instead.
Perhaps it's not SQL that you love at all?
comment 2y ago · link · parent
If housing were constant then people would not be any poorer with respect to housing. They would be in the exact same position. But housing is not a constant. The average US house has have more than doubled in size over the past 50 years. The average US home also has one less person living in it as compared to 50 years ago. People today are way richer in housing.
comment 2y ago · link · parent
It seems you've got your tech coloured glasses on again. Yeah, sure, you'll have 100 programmers lined up down the street. Comes with the high salary territory. But not so much in other industries. Try hiring for something like a cook. You are taking the first person that comes along, no questions asked. If you don't, you'll have nobody. And, indeed, cooking in particular attracts a lot of immigrants, not to mention many people looking to escape construction.
And who can blame them? Who wants to suffer the brutally cold Canadian winter hammering nails when you can thrill people with your culinary treats from a warm kitchen? I'm sure at some price point people would be compelled to switch over to construction – everyone has a price – but home buyers by and large aren't willing to pay that much. In fact, they endlessly complain they are already paying too much.
> I have no experience or education in the field
If you can build a house you can gain said education and experience. Still, kind of an obtuse example given the legal encumberments. It's not lack of education or experience that keeps you from becoming a lawyer – it is the supply management system. Not unlike why you aren't becoming a dairy farmer in Canada, even though I'm quite sure you could manage milking a cow just fine, you just legally can't do it without jumping through tremendous hurdles intended to keep you out so that those on the inside can maintain an artificially high income.