Most active commenters
  • baq(3)

←back to thread

421 points briankelly | 21 comments | | HN request time: 1.62s | source | bottom
Show context
necovek ◴[] No.43575664[source]
The premise might possibly be true, but as an actually seasoned Python developer, I've taken a look at one file: https://github.com/dx-tooling/platform-problem-monitoring-co...

All of it smells of a (lousy) junior software engineer: from configuring root logger at the top, module level (which relies on module import caching not to be reapplied), over not using a stdlib config file parser and building one themselves, to a raciness in load_json where it's checked for file existence with an if and then carrying on as if the file is certainly there...

In a nutshell, if the rest of it is like this, it simply sucks.

replies(23): >>43575714 #>>43575764 #>>43575953 #>>43576545 #>>43576732 #>>43576977 #>>43577008 #>>43577017 #>>43577193 #>>43577214 #>>43577226 #>>43577314 #>>43577850 #>>43578934 #>>43578952 #>>43578973 #>>43579760 #>>43581498 #>>43582065 #>>43583922 #>>43585046 #>>43585094 #>>43587376 #
milicat ◴[] No.43575953[source]
The more I browse through this, the more I agree. I feel like one could delete almost all comments from that project without losing any information – which means, at least the variable naming is (probably?) sensible. Then again, I don't know the application domain.

Also…

  def _save_current_date_time(current_date_time_file: str, current_date_time: str) -> None:
    with Path(current_date_time_file).open("w") as f:
      f.write(current_date_time)
there is a lot of obviously useful abstraction being missed, wasting lines of code that will all need to be maintained.

The scary thing is: I have seen professional human developers write worse code.

replies(5): >>43576009 #>>43576011 #>>43576425 #>>43579037 #>>43579215 #
ramesh31 ◴[] No.43576009[source]
>The scary thing is: I have seen professional human developers write worse code.

This is kind of the rub of it all. If the code works, passes all relevant tests, is reasonably maintainable, and can be fitted into the system correctly with a well defined interface, does it really matter? I mean at that point its kind of like looking at the output of a bytecode compiler and being like "wow what a mess". And it's not like they can't write code up to your stylistic standards, it's just literally a matter of prompting for that.

replies(5): >>43576193 #>>43576693 #>>43577895 #>>43578279 #>>43579014 #
1. mjr00 ◴[] No.43576193[source]
> If the code works, passes all relevant tests, is reasonably maintainable, and can be fitted into the system correctly with a well defined interface, does it really matter?

You're not wrong here, but there's a big difference in programming one-off tooling or prototype MVPs and programming things that need to be maintained for years and years.

We did this song and dance pretty recently with dynamic typing. Developers thought it was so much more productive to use dynamically typed languages, because it is in the initial phases. Then years went by, those small, quick-to-make dynamic codebases ended up becoming unmaintainable monstrosities, and those developers who hyped up dynamic typing invented Python/PHP type hinting and Flow for JavaScript, later moving to TypeScript entirely. Nowadays nobody seriously recommends building long-lived systems in untyped languages, but they are still very useful for one-off scripting and more interactive/exploratory work where correctness is less important, i.e. Jupyter notebooks.

I wouldn't be surprised to see the same pattern happen with low-supervision AI code; it's great for popping out the first MVP, but because it generates poor code, the gung-ho junior devs who think they're getting 10x productivity gains will wisen up and realize the value of spending an hour thinking about proper levels of abstraction instead of YOLO'ing the first thing the AI spits out when they want to build a system that's going to be worked on by multiple developers for multiple years.

replies(5): >>43576618 #>>43578091 #>>43578491 #>>43578913 #>>43579028 #
2. nottorp ◴[] No.43576618[source]
> those small, quick-to-make dynamic codebases ended up becoming unmaintainable monstrosities

In my experience, type checking / type hinting already starts to pay off when more than one person is working on an even small-ish code base. Just because it helps you keep in mind what comes/goes to the other guy's code.

replies(2): >>43577142 #>>43577194 #
3. lolinder ◴[] No.43577142[source]
And in my experience "me 3 months later" counts as a whole second developer that needs accommodating. The only time I appreciate not having to think about types is on code that I know I will never, ever come back to—stuff like a one off bash script.
replies(1): >>43579236 #
4. guskel ◴[] No.43577194[source]
Yep, I've seen type hinting even be helpful without a type checker in python. Just as a way for devs to tell each other what they intend on passing. Even when a small percent of the hints are incorrect, having those hints there can still pay off.
5. bcoates ◴[] No.43578091[source]
I think the productivity gains of dynamic typed languages were real, and based on two things: dynamic typing (can) provide certain safety properties trivially, and dynamic typing neatly kills off the utterly inadequate type systems found in mainstream languages when they were launched (the 90s, mostly).

You'll notice the type systems being bolted onto dynamic languages or found in serious attempts at new languages are radically different than the type systems being rejected by the likes of javascript, python, ruby and perl.

6. triyambakam ◴[] No.43578491[source]
The ML world being nearly entirely in Python, much of it untyped (and that the Python type system is pretty weak) is really scary.
replies(1): >>43578601 #
7. ramesh31 ◴[] No.43578601[source]
>The ML world being nearly entirely in Python, much of it untyped (and that the Python type system is pretty weak) is really scary

I think this has a ton to do with the mixed results from "vibe coding" we've seen as the codebase grows in scope and complexity. Agents seem to break down without a good type system. Same goes for JS.

I've just recently started on an Objective-C project using Cline, and it's like nirvana. I can code out an entire interface and have it implemented for me as I'm going. I see no reason it couldn't scale infinitely to massive LOC with good coding practices. The real killer feature is header files. Being able to have your entire projects headers in context at all time, along with a proper compiler for debugging, changes the game for how agents can reason on the whole codebase.

8. dheera ◴[] No.43578913[source]
> You're not wrong here, but there's a big difference in programming one-off tooling or prototype MVPs and programming things that need to be maintained for years and years.

Humans also worry about their jobs, especially in PIP-happy companies; they are very well known for writing intentionally over-complicated code that only they understand so that they are irreplaceable

replies(2): >>43579292 #>>43589014 #
9. ManuelKiessling ◴[] No.43579028[source]
I'm certainly extremely happy for having an extensive type system in my daily driver languages especially when working with AI coding assistance — it's yet another very crucial guard rail that ensures that keeps the AI on track and makes a lot of fuckups downright impossible.
10. wesselbindt ◴[] No.43579236{3}[source]
> "me 3 months later" counts as a whole second developer

A fairly incompetent one, in my experience. And don't even get me started on "me 3 months ago", that guy's even worse.

replies(1): >>43579302 #
11. XorNot ◴[] No.43579292[source]
I'm not convinced this actually happens. Seems more like somthing people assume happens because they don't like whatever codebase is at the new job.
replies(3): >>43579323 #>>43579631 #>>43582088 #
12. nottorp ◴[] No.43579302{4}[source]
"How has that shit ever worked?"

Me, looking at code 100% written by me last year.

replies(1): >>43579597 #
13. dheera ◴[] No.43579323{3}[source]
Oh, I'm convinced, I've seen it first hand.
14. baq ◴[] No.43579597{5}[source]
It gets worse with age and size of the project. I’m getting the same vibes, but for code written by me last month.
15. baq ◴[] No.43579631{3}[source]
If your TC is 500k-1M and you don’t feel like job hopping anymore, you’d certainly not want to get hit by a random layoff due to insufficient organizational masculinity or whatever. Maintaining a complex blob of mission critical code is one way of increasing your survival chances, though of course nothing is guaranteed.
replies(1): >>43579765 #
16. LtWorf ◴[] No.43579765{4}[source]
People doing layoffs have no idea of who works and who's warming the chair.
replies(1): >>43579819 #
17. baq ◴[] No.43579819{5}[source]
Depending on the layoff they may look into yearly reviews... or not.
replies(1): >>43580472 #
18. LtWorf ◴[] No.43580472{6}[source]
Ah yes, those work /s
19. SkyBelow ◴[] No.43582088{3}[source]
The challenge is that sufficiently bad code could be intentional or it could be from a lack of skill.

For example, I've seen a C# application where every function takes in and outputs an array of objects, supposedly built that way so the internal code can be modified without ever having to worry about the contract breaking. It was just as bad as you are imagining, probably worse. Was that incompetence or building things to be so complicated that others would struggle to work on it?

replies(1): >>43589023 #
20. mistrial9 ◴[] No.43589014[source]
hmm I have seen conda env with far too many packages and maybe a lot of current version bumping, and the dev says "who cares" and it naturally gets a bit more.. Intentionally complicated is more like an accusation of wrongdoing.
21. mistrial9 ◴[] No.43589023{4}[source]
but that is literally how the browser window DOM works, no? It depends on how diligent the maintenance is IMHO