3 ms·
I've never seen this idiom before: try: AVOUCH_VERSION = importlib.metadata.version("avouch") except importlib.metadata.PackageNotFoundError: A
by StableAlkyne 2mo ago
I've never seen this idiom before:
try:
AVOUCH_VERSION = importlib.metadata.version("avouch")
except importlib.metadata.PackageNotFoundError:
AVOUCH_VERSION = "0.3.2"
What's the intended purpose? It seems to be protecting against a scenario where the package is not installed but the CLI is somehow running...
...But that seems like a very odd thing to be concerned about. Plus, unless I'm missing something, the program will crash with an an ImportError before that block can ever run.
- gchamonlive 2mo agoCould be for unit testing, maybe it's something that makes sense for the developer, or it's AI slop. In all cases it's a minor nitpick in my opinion.
- StableAlkyne 2mo agoI'm assuming it's vibe coded, but it's a code smell I've noticed is specific to vibe coded projects. AIs tend to have a debilitating phobia of any kind of exception. Claude especially will throw try/except and weird coersion everywhere in the code. This bites you because it hides legitimate errors, even when the program is in such an unrecoverable state that it doesn't make logical sense to continue. It becomes impossible to debug, and requires the test suite to be absolutely perfect because you end up throwing away the only way for the language to warn you that something went wrong. So while yes, it's relatively minor, like many code smells it is indicative that other things may be wrong.
- gchamonlive 2mo agoAre other things wrong? I'd be wary to shame people's work without doing legwork to getting evidence to support your claim, otherwise you risk passing as someone just seeking attention and upvotes, riding on the tides of HN anti-AI sentiment. Which is valid for vote farming just to be clear, I'd just respect you less if this was the case.
- StableAlkyne 2mo agoI mean, my original post is just asking why it's in there. Maybe I'm missing something, so I asked. That isn't "shaming" their work. > otherwise you risk passing as someone just seeking attention and upvotes This isn't Reddit.
- gchamonlive 2mo agoAnd yet people exploit upvote-baits, so give me a break
- mukundzha6 2mo agoBro. I didn't had money fo claude code to review my codebase so i build this. And you are saying that i use claude code or anyother tools fot this. NOT GONNA LIE. I FORMATTED THE CODE FROM AI TO BE BREAKPROOF SO IN SOME CASES IT MAY LOOK AI GENERATED BUT ITS MOSTLY MY CODE WITH SOME AI TWEAKS.NOTHING MORE.
- gchamonlive 2mo agoWhy are you yelling? Makes me think the flagged and dead post is deserving and I'm wasting my time defending your project here.
- mukundzha6 2mo agosorry bro. but i wasn't yelling at you. just saying to criticizers. sorry.
- gchamonlive 2mo agoThat's alright. But if I could give you a piece of unsolicited advice, treat your pals nice and the criticizers better, they are the hearts you need to change :)
- mukundzha6 2mo agoOk i understood