In the statement/expression-oriented axis of languages, Go is a statement oriented language (like C, Pascal, Ada, lots of others). This is in contrast to expression oriented languages like the Lisp family, most, if not all, functional languages, Ruby, Smalltalk and some others.
Expressions produce a value, statements do not. That's the key distinction. In C, if statements do not produce a value. In Lisp, if expressions do. This changes where the expression/statement is able to be used and, consequently, how you might construct programs.
A simple example for anyone who might not appreciate why this can be so nice.
In languages where if is a statement (aka returns no value), you'd write code like
int value;
if(condition)
{ value = 5; }
else
{ value = 10; }
Instead of just
int value = if(condition) {5} else {10}
Some languages leave ifs as statements but add trinary as a way to get the same effect which is an acceptable workaround, but at least for me there are times I appreciate an if statement because it stands out more making it obvious what I'm doing.
Not necessarily. In many Lisps you can bind the result of a condition like so.
(let [thing (cond
pred-1 form-1
...
pred-n form-n)]
(do something with thing))
This makes laying out React components in ClojureScript feel "natural" compared to JSX/TSX, where instead one nests ternaries or performs a handful of early returns. Both of these options negatively impact readability of code.
cond is neither an operator nor a statement, it's an expression. This is a demonstration of a conditional expression handling multiple conditions, which GP wanted.
More importantly, pattern matching is not necessary here.
You misunderstood. They were talking specifically about languages that only have ternary operators as a way to do if-as-expression, and why they prefer languages with either real if-else if-else expressions or full switch/pattern matching as expression.
As someone who writes a fair bit of c# making switch and if's into expressions and adding Discriminated Unions (which they are actually working on) are my biggest "please give me this."
Plus side I dabble in f# which is so much more expressive.
Same for me in the Scala vs. Java world, it's hard once you get used to how awesome expressions over statements and algebraic data types/case enums/"discriminated unions" are. But I haven't done much C# (yet) myself, could you clarify for me: does C# have discriminated unions? I didn't think the language supported that (only F# has them)?
The c# team is working on a version of them they are calling Typed Unions, not guaranteed yet but there is an official proposal that I believe is 2 weeks old.
There's a crisis in local news. It's an essential service that the free market has largely stopped providing -- the number of journalists following local politics has been decimated, and sometimes in a literal sense. Without someone with the time to follow that stuff corruption flourishes, and getting rid of local government is not an option. We need some sort of fix so it's nice to see someone trying.
> It's an essential service that the free market has largely stopped providing ...
I think you're misinterpreting the situation.
What we're actually seeing in this industry (and most others) is that the various levels of government in Canada have collectively imposed so much artificial overhead and interference on businesses that it has become nearly impossible for the free market to function.
Some of this is directly imposed, in the form of high taxation, unnecessary regulation, pointless bureaucracy, and so forth.
A lot of it, though, is indirect. For example, the high price of real estate (solely caused by the governments' flawed immigration and property development policies) imposes significant, but less-obvious, overhead on businesses. Buying or leasing office/retail/workshop/warehouse/etc. space has become prohibitive in many cases. Entrepreneurs and business owners are forced to direct more resources toward their own personal housing, instead of their businesses. Prospective employees can't move as easily. Entrepreneurs can't take as much risk as they otherwise could.
Even well-established businesses have been finding it more and more difficult to feasibly operate in Canada.
There are many private entrepreneurs and private businesses in Canada who are more than willing to providing local news coverage. Thanks solely to government, however, it's just not feasible for them to do so, so they don't.
If there is broad agreement that there is a crisis then wouldn’t you see more Canadians paying for access to local journalism? It seems the government is taxing what people want to pay for (streaming services) to give them what they don’t want to pay for (québécois and indigenous content). This is just funding special interests that can’t stand on their own because the market doesn’t want it.
It's a collective action problem. One person's subscription will not make the difference needed to improve journalism enough for them to get a direct benefit. Further, the main benefit would be that it exposes corruption, which doesn't generally impact individuals. Corruption's effects are spread amongst all the tax payers. Each individual is better off not subscribing and reaping the benefits of others' subscriptions, but everyone suffers if local journalism isn't funded.
It's similar to the climate crisis: there's broad agreement that things are bad and getting worse, but individuals acting in their own self-interest can't be counted on to solve it.
Further, commercial interests are generally anti-aligned with exposing corruption. They'd rather their bribes/lobbying be unquestioned, driving down the cost of it at the expense of the tax payer. We can't count on business to provide this service.
Finally, this isn't just about québécois and indigenous content. The last I saw, the $ was available as long as you had full-time journalists on staff, regardless of their focus.
> It's a collective action problem. One person's subscription will not make the difference needed to improve journalism enough for them to get a direct benefit. Further, the main benefit would be that it exposes corruption, which doesn't generally impact individuals. Corruption's effects are spread amongst all the tax payers. Each individual is better off not subscribing and reaping the benefits of others' subscriptions, but everyone suffers if local journalism isn't funded.
The broader the benefit, the broader the appropriate tax base is. If this is for local journalism and is as important as you say (I have major doubts), then it should be funded by a broader tax base than streaming subscribers. I.e. The future of corruption free democracy shouldn’t be on the shoulders of streaming subscribers. If it is so important it should be funded by income taxes.
Everyone loves the commons. People refuse to pay for basically any digital good, even if they really want it, and journalism isnt even what people really want. Its the good governance it creates that people want
They love to paint this as funds for the little guys but take a look at who owns ALL of the regional broadcasters - tv, radio and print - it is not mom & pop shops covering townhall, it's an oligopoly of a few giant conglomerates. Do you like Canadian telecoms? This is essentially propping up their media brethren - or in some cases the same company.
I haven't seen anyone put any other alternatives up for debate.
I know Poilievre has talked about defunding the CBC, but I don't know of anything he has proposed that would result in more local journalists.
Do you have an alternative in mind? We need some way to get $ into journalists' pockets while also having some accountability.
Increased CBC funding? It's probably better to have a diverse set (i.e. not just one being subsidized) of news outlets, so the Liberal plan here makes more sense to me, though there's also an argument for not spreading things too thin across lots of tiny outlets.
Instead of taxing the streamers, require they provide local content directly? I think that this proposal is doing that indirectly. The streamers get taxed, but could pick up some $ from the CRTC if they start producing more local content.
Instead of taxing the streamers, tax people directly? That'd probably be less popular than taxing the streamers, so good luck with that.
There's a danger in "We need to do something, this is something, therefore we should do it".
Government subsidies flow to those who know the system. If what you want is journalists being paid by those people who know the system (probably postmedia, rogers, and bell), then this may be the solution you're looking for. However, it'll likely make it even harder for different viewpoints to compete, not only against big companies alone, but ones that get subsidies.
In the UK there's some ground-up work being done with some local newspapers becoming charities ( https://www.theguardian.com/media/2024/mar/15/glimmer-of-hop... ). This, plus some very specific tax advantages, could provide news viewpoints of all stripes and not be beholden to funding conditions that may or may not make sense for the news source. It's just one example, but it's not tied to funding that can be easily manipulated by governments of the day. Subsidized organizations also often tend to get lazy.
> The panel said the intrusion, discovered in June by the State Department and dating to May “was preventable and should never have occurred,” blaming its success on “a cascade of avoidable errors.” What’s more, the board said, Microsoft still doesn’t know how the hackers got in.
...
> It said Microsoft’s CEO and board should institute “rapid cultural change” including publicly sharing “a plan with specific timelines to make fundamental, security-focused reforms across the company and its full suite of products.”
You might be able to argue that Postgres' foreign data is a different form of pluggable storage engine. E.g. you can even use a CSV file as a backing store for a table with file_fdw.
iMessage is the monopoly part. They could make an App or even just an API available on other platforms but don't because they want the lock-in.
> “The #1 most difficult [reason] to leave the Apple universe app is iMessage ... iMessage amounts to serious lock-in,” was how one unnamed former Apple employee put it in an email in 2016
> “iMessage on Android would simply serve to remove [an] obstacle to iPhone families giving their kids Android phones,”
https://www.theverge.com/2021/4/9/22375128/apple-imessage-an...
Not getting on board with RCS or any other way to improve SMS/MMS until they were (implicitly) forced was motivated by that desire to lock their users in to a messaging platform that only works on Apple devices.
It seems like they're worried that interning of objects/records would be too expensive to do generally. It's hard to predict though: that overhead would only apply to new code using R&T and has to be weighed against the elimination of recursion for deep comparisons and freezing, fewer re-renderings when value-equal but not reference-equal objects are encountered, the greater possibility of memory reuse across deep clones, and other performance optimizations that would be unlocked by true immutability.
Aside from performance, true native immutability would bring huge improvements to how JS programmers can reason about their code. Not having to worry about mutation makes a whole class of possible bugs disappear. Having to rely on third party libraries (or deep freezing manually) for immutability is really holding back the language.