Hacker Newsnew | past | comments | ask | show | jobs | submit | anticodon's commentslogin

You know how many bugs I've met working on large Python codebases over 20 years, caused by unsorted imports or `except Exception`? Yeah, you've guessed it: exactly 0 bugs.

It's really annoying how many people think that if you enforce stupidly strict rules about formatting, more strict that those of Fortran in 70s, you'll automatically get good code.

I've seen companies that enable 100% of ruff rules, use several other linters, and enforce other rules (like every variable name should be at least 20 characters long to fully describe its purpose). And they have awful buggy unmaintainable code. But it is nicely formatted (although reading code where half of the screen estate is consumed by the variable name is a bit difficult) and has no "dreadful" `except Exception`. Or every mutable class attribute variable is annotated with `typing.ClassVar` (RUF012 - the most idiotic rule I've ever seen). Nevermind that it doesn't really stop anyone from changing value of that attribute. You must annotate it with `ClassVar`!

It's an idiotic cargo-cult.


I think it should depend on if it's `except Exception` (don't use) or `except Exception as e` (probably fine, as long as you log `e` or do something else with it).


I don't think people expect import sorting to fix bugs. It's just good (and free!) practice.

Anyway I have definitely had linters like Ruff catch bugs. Probably the most common is the mutable default argument gotcha.


I'm not saying that it's not catching bugs. Sometimes it does. But most of the rules are nonsense and the number of rules that makes no sense is growing.

Also, mutable default argument is not a bug. It is a bug only if mutable default argument is mutated inside the body of a function/method. Which is almost never the case.


> Which is almost never the case.

It's quite common in my experience.

And sure it's not always a bug, otherwise Python itself would flag it. The point of linters is to improve code quality to avoid things that are error-prone. This is one of the most error-prone things in Python in my experience.

First would probably be implicit bool coersion (e.g. `if a_string:`) but that can only be caught by a static type checker.


What? In other words, you're saying: "Russia is losing war with Ukraine, so it wants to start a second front with bigger enemy".

Also, how's Ukraine war is sustainable for Ukraine? It's economy is non-existent (almost 100% dependent on western donations), it has less than 50% of population of 2022 (they don't publish any population stats directly, but if you combine available statistics, there are about 10-15 millions left most of them old retired people or young people that are too young to send them to the front lines), they are losing territory every day.

This is some weird "Ukraine is winning but front is moving in the wrong direction" logic.


A war doesn’t need to be sustainable for Ukraine, it’s existential. For the aggressor that backstop doesn’t exist. They could literally stop the war anytime they wanted so they need to continue to prove it’s sustainable to keep doing it.


Not all wars have a simple way to say who is winning, who is loosing. See the Vietnam war, different Afgan wars.


Ukraine is gaining some ground, but very slowly. It's basically a stalemate. Except that Ukraine is making the war extremely costly for Russia with the recent attacks on refineries and other targets deep into Russia.

As long as the EU keeps supporting them, I think Ukraine will be better able to maintain the current situation than Russia. But Ukraine is nearly as exhausted as Russia, and I think a European coalition sending real practical ground and air support would help a lot. I suspect sufficient support could force a breakthrough in southern Ukraine an liberate a very large chunk of land very quickly.

The reason that's not happening is either that NATO thinks this would give Putin the excuse he needs for large scale mobilisation, or simply because Europe is afraid to get its hands dirty. I don't think the former is nearly as big an issue as some believe; Putin has never needed any action from NATO or EU members to justify escalation, and has never responded to imagined red lines getting crossed.

The latter is more likely. I think Europe needs to remember the sacrifice that Canada and the US brought to liberate Europe in WW2, and recognise the moral obligation that creates to liberate others in a similar position. Like Ukraine today.


> Ukraine is gaining some ground, but very slowly. It's basically a stalemate.

Ukraine has been gaining some open fields, while losing major urban areas. Kostyantynivka just fell and Russian troops are securing the high ground overlooking the Slovyansk-Kramatorsk urban conglomerate. Pokrovsk also fell faster than expected, suggesting that Ukraine increasingly lacks the infantry manpower density to defend urban terrain.

> As long as the EU keeps supporting them, I think Ukraine will be better able to maintain the current situation than Russia.

European support doesn't rectify Ukraine's critical vulnerability: manpower...or a lack thereof. Although Euro governments seem like they might start deporting military-age Ukrainian males back to Ukraine so they can be forcibly conscripted....because sending men to their deaths against their will screams "Western liberal values", or something.

> I think a European coalition sending real practical ground and air support would help a lot

Russian analysts have been coming on Western alt-media outlets warning that Russian hardliners are increasingly advocating for striking logistics and military production sites in Europe. HistoryLegends has a good video about how France, one of the more experienced and expeditionary European countries, absolutely struggled to even get a brigade into Romania for an exercise. Europe could definitely send air support.....but do you think European citizens are ready for their cities to eat Oreshniks (at a minimum) as a response?

> I suspect sufficient support could force a breakthrough in southern Ukraine an liberate a very large chunk of land very quickly.

There isn't enough combat engineering vehicles in all of Europe to clear lanes through the Surovikin Line. The Ukrainians already learned this the hard way in summer 2023.


> Kostyantynivka just fell

Has it finally fallen? Because Russia has been trying to take it for ages now, against staggering losses, and keeps claiming they control it when it turns out they don't. They do that a lot. Mostly because they desperately want to have good news to report to Putin. They are advancing, but incredibly slowly, and at enormous cost, and Ukraine regularly does take land back.

But you're absolutely right that Ukraine is short on manpower, unlike Russia which seems to have endless reserves of people to send to very rapid deaths. Ukraine is doing a lot to fill their manpower gap with drones, but their lack of manpower is exactly why I think Europe should come to their aid.


> They are advancing, but incredibly slowly

Their tactics have settled to extremely-small infantry infiltrations across almost the entire frontline. Warfare has evolved and concentrated mechanized assaults have been abject failures for both sides; it's far too easy to mass fires than it is to mass maneuver forces (see additional commentary (1) at the bottom). Russia's ground strategy is probably the least-risky way for them to keep pressure on the defenders and husband their own resources.

> their lack of manpower is exactly why I think Europe should come to their aid.

Be the change you want to see in the world: https://ildu.mil.gov.ua/news/how-join-armed-forces-ukraine

(1) Normally I would blame both air forces for lacking the capacity to systemically disrupt the defender at all depths.....but if we look at the Israeli aggression against Lebanon, the Israeli air force has total air dominance and their heavy mechanized forces are still struggling to advance. FPV drones basically quadruple the range of every ATGM team at 10% of the price.


It has turned out to be luck in disguise when Trump stopped weapon deliveries to Ukraine. Because Biden, Trump, and the Germans set all kinds of limitations so as not to strike Russia. For the first three years, Ukrainians were defending with one arm tied behind their back.

Now, when they finally can damage the Russian economy enough to make the war unsustainable for them, there is a chance we can get an end to this confict.


Ukr is attacking Retailers (Wildberries) in Russia because Russia helps Iran attack Amazon (US retailer) Data centers in the Gulf.


Nothing to do with Amazon. They sell military and dual use goods, that's why.

https://www.pravda.com.ua/eng/news/2026/07/26/8045972/


I think you’re misreading the comment and conflating Putin’s survival with the current war. I believe the OP is saying the administration can’t keep selling the war with Ukraine as a good idea indefinitely and will need to pivot to something more marketable. In our Internet-shaped world, everything is entertainment. This particular show has run its course and needs a pivot, add new actors, make a Very Special Episode or kill off one of the main characters.


West is living in its own bubble of misinformation. Including the government.

On many occasions I've read self-soothing wishful thinking messages about my country. In 2022 it was that Russian army is fleeing, all Russian tanks were burned down, and Russian soldiers are deserting from a front lines with a speed of 100,000 persons a day. Here on HN. Written by the people who had no clue how to distinguish Russian tank from Ukrainian tank.

Or in 2022-2023 EU leaders said that Russian soldiers are fighting with shovels and stealing microwaves and washing machines to extract microchips from them.

Or just recently someone wrote to me that we are living in the stone age, whatever that means.

On the other hand, I'm happy that West prefers to live in a bubble with no access to real information. And if you try to convey real information, they'll call you "Kremlin bot" or "North Korean bot" or "Chinese bot". It means that less countries will fall prey to neocolonial practices and wars because you cannot wage wars and govern colonies based entirely on misinformation from propaganda your own media creates out of thin air.


> Or in 2022-2023 EU leaders said that Russian soldiers are fighting with shovels and stealing microwaves and washing machines to extract microchips from them.

And this WAS true. At one point, Ukraine broke through Russian lines and was pushing Russia back as fast as they could get logistics organized.

In response, Russia mobilized about 300000 people and forced them to fight or die. Usually both. Then started offering jailed inmates a chance of freedom by fighting on the front lines for 6 months. It invited freaking North Koreans to fight on the Ukrainian front!

> Written by the people who had no clue how to distinguish Russian tank from Ukrainian tank.

The thing is, in a large war such as the Ukrainian war (or the Iranian war now) you can have multiple total routs of the opposing military. And still not gain anything. The opposing military can be armed with shovels and they might be formed out of the dregs of society, but as long as they hold the line, they can still stop your advance.


Russia _recruited_, not mobilized as usually in popular conception that would equate with conscripted.

Conscription is enforced with martial law only in ukranian territories, by both the official ukrianian government, and by the russia's occuption forces in donbas.


> Russia _recruited_, not mobilized as usually in popular conception that would equate with conscripted.

No. Russia _mobilized_ 300000 people. As in "sent mobilization notices and then grabbed whoever came". It almost resulted in uprisings, so it was quickly abandoned in favor of using prison inmates and later offering $50000 signup bonuses.

It was then memory-holed by the Russian propaganda as if it had never happened.


How can you convince me that your real information is more real than my real information?


Just observe the consequences and use brains (try to ignore ideological blinders).

The Russian economy has not collapsed.

The Russian military has not collapsed.

The Iranian regime has not collapsed.

The Ukrainian regime/state/military has not collapsed. Nor has it reconquered the territory it has lost.

Wait a bit and see if Trump's regime/presidency collapses or not. The same for Iran/Russia/Ukraine/Israel.

The strains (societal/economical/geopolitical) are great and rising, something will give out... (no sanity in sight)


Actually Ukraine just invaded Moscow with drones, causing Putin to cut the whole country off the internet for fear of looking weak.


> Would we still get web browsers?

There was Lynx text browser that was ported even to MS-DOS. I was using it until about 2010. It was a great browser until websites become unusable.


Crypto was and is inconvenient to use. So many years passed and almost nobody uses crypto daily. It's too inconvenient.

And it's not secure or anonymous at all. At some point you need to buy crypto or sell crypto, or buy some goods with crypto, and at that point you can be easily identified. Happened so many times.

Even here in Russia, under all US sanctions, only a few use crypto. It's so inconvenient that even under pressure of US sanctions it hadn't become more popular.


I would agree that no one uses it - but not out of convenience. It is an adoption problem, no one accepts lightning payments because no one has lightning balance. If you download a modern, non-custodial wallet such as Phoenix or Wallet of Satoshi, it is easier than paypal or my online banking website. It sure as hell is easier than opening any online bank account (Wise, Revolut etc.) as there is no kyc.

Regarding anonimity when exchanging, yes. But you can make the same point about cash. You are identified when withdrawing, and identified when depositing. You cannot be identified when cash changes owners, and the same holds true for lightning payments. So if anonimity is the same, lightning is still to be considered superior as it works also for online payments while cash is bound to physical means of payments.


> Of course, right now nothing can dethrone Visa/MC for international payments

UnionPay can. They are accepted in many parts of the world, and they are free from US restrictions.


Russia had roughly ten years to prepare. First talks about building national payment system started around 2010-2012. And it was meeting notable opposition: "why should we care? MC/Visa are good enough, why spend money on national infrastructure".

But yeah, it is amazing that in 2022 nobody here even noticed that MC/Visa left. Even MC/Visa cards haven't stopped working and are working to this day (banks made a rule that cards that expire after 2022 continue to work for several more years so that everybody has time to switch to MIR).


What really do Americans know about Ukraine or Taiwan? E.g. can even 1% of US population show Ukraine on the world map (without using Google Maps)? Could they do it before 2022? Before 2014? Do they know anything about Ukraine or Taiwan history? How many Americans know a single foreign language?

If tomorrow there would be a war or protests in, say, Burundi. Will Americans stay with Burundi or against it? Or with the country the media will tell them is "good" because their interests align with US interests?

I think answers to all these questions are obvious.


To be fair, lack of knowledge of other countries is hardly uniquely American. As an Irish person travelling around the non western world, there's a lot of people who don't know that Ireland is a country separate to the UK, or even that it exists.


In 2023 there was record harvest of potatoes in Russia. Prices dropped, so farmers stopped planting potatoes in 2024 and 2025. Wouldn't be surprised if they plant more this year due to high price.


shell_plus is still superior because it also imports other useful stuff and allows adding custom list of additional imports.

Also, shell_plus has --print-sql option for easy construction and debugging of ORM queries.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: