🇨🇦 tunetardis

  • 1 Post
  • 99 Comments
Joined 2 years ago
cake
Cake day: June 11th, 2023

help-circle




  • About a year ago, there was a boycott on the Loblaws supermarket chain in protest of their boasting record profits at a time when grocery inflation was out of control. It lasted about a month before kind of fizzling out.

    But I think by comparison, this buy Canadian movement has legs. It’s a major nationwide shift in people’s spending habits. And the key word here may be habits. Let’s say for argument’s sake that after 4 years of Trump, a new administration comes in and repeals all the tariffs. By that time, people will have settled into alternate brands across a wide range of consumer goods, and it may be difficult to convince them to switch back again. There’s a certain inertia in human behaviour. So the effects of this could potentially go on quite a bit longer than the tariff war.




  • Digital services tend to be an area where the US enjoys huge trade surpluses. If that pandora’s box is opened, it’s going to be really bad for the tech giants when retaliatory steps are inevitably taken. I thought this was why Trump was trying to keep the tariff war focused on material goods?

    I know in Canada, FB stopped serving news when they refused to contribute to a government fund to help the struggling domestic journalism industry which they were scraping content from with reckless abandon. Personally, I’m happy to see one less stifling algorithm-fed echo chamber. It’s like a breath of fresh air.





  • Yeah I agree. I came across the article as I like to read up on what’s going on with BRICS countries as that seems like something worth keeping an eye on. But the lack of confirmation is troublesome. Even something like a giant trade deal with China that would give them some standing to call Trump’s bluff would lend some credibility. It could be that this was threatened during negotiations and someone jumped the gun to say it’s now policy? If I see any more about it one way or another, I will update the post.



  • That’s the point, when programming with immutable structures you always pass the mutability onto the enclosing structure.

    I guess the point I was trying to make here was if the data type is already mutable, there is no point in sticking it in a list just so you can replace a reference with an identifier. You’re just adding an extra level of indirection. But sure yeah, if the type is inherently immutable, you have to do something.

    A list is an antipattern here IMO. Just wrap it in some dedicated object (see e.g. Java’s StringBuilder).

    Interesting. I’m not aware of anything like StringBuilder in the standard library for either Python or JavaScript. Looks like it wraps a list of characters and tries to behave as string-like as possible? You could presumably write your own class like that or download an implementation from someplace.

    I guess in most cases in my own code, where I need a mutable string is usually as part of a larger data structure which is the thing that gets passed around by reference, so it’s easy enough to replace a field within that.

    For building up a string, I would tend to use an io.StringIO in Python with file-writing calls, but those aren’t meant for sharing. What you don’t want to do is use the += operator a lot on strings. That gets expensive unless strings are mutable (like they are in say C++'s std::string).