4 ms·
Some of the worst code I've seen in my life lives in Jupyter notebooks. But that's fine, it's meant to be throwaway code. The problem is a lot of places/people
by packetlost 2y ago
Some of the worst code I've seen in my life lives in Jupyter notebooks. But that's fine, it's meant to be throwaway code. The problem is a lot of places/people do not use it as such.
- hot_gril 2y agoIdk how you'd use one for non-throwaway code. Not like a webserver can run a routine in a notebook.
- WalterSear 2y agohttps://nbdev.fast.ai/ https://nbdev.fast.ai/
- hot_gril 2y agoOh, that looks like a disaster. Edit: I can't judge without trying, but that's my initial thought.
- WalterSear 2y agoI have masses of admiration and respect for Jeremy Howard and tried using this to build a bunch of fastapi endpoints. I still have masses of admiration and respect for him, but no longer so much when it comes to software engineering - due to this, among other things. It seems like a great idea, but is clunky, hard to refactor and to integrate with other things, in my practice. Wrapping production code in jupyter cruft doesn't work for me. Or, any code, really, that doesn't stay very small and stand alone.
- packetlost 2y agoI've seen "production workflows" be wrapped up in jupyter notebooks. Manually triggered of course.
- giraffe_lady 2y agoIn general anything written by nonprofessional programmers in pursuit of some other goal is terrible code by professional programmer standards. On the other hand, it accomplishes a goal other than getting a programmer paid. So in one important sense is objectively better than probably 80% of the code I've seen people paid to write, no matter how nicely it was constructed.
- cqqxo4zV46cp 2y agoAmen to that. The confluence of an insulator nature of organisational developer cliques, the culture of self-importance in the field, and the ability for many teams to expend material effort on things that are…at best, tangentially related to business goals (due to cheap money, and frankly, often pulling the wool over management’a eyes), has bred at least a couple of generations of developer where large contingents have a completely out of whack perspective on what’s actually important.
- williamcotton 2y agoPreach!
- hot_gril 2y agoIn one project, I had a new teammate ask me why almost our entire web backend is a single .js file mostly filled with SQL queries. He wanted to make it his personal project to refactor this into probably 20 different files, adding more layers between the handlers and the DB stuff, using a query builder, and also migrating to TS. When I asked him what's wrong with the current thing, he couldn't answer and gave up on this idea. That backend had decent integration tests, and it took less than 5 minutes to add a small new feature. Most prod code doing comparable things where I work is worse-tested, less reliable, and at least 10X more expensive in terms of SWE-time, so I think modern programming standards are actually nonsense even though I can play along with them.
- giraffe_lady 2y agoYeah I think I got this from Sandi Metz a long time ago but it's been so valuable to me: "bad code that you never have to modify is good code." Now when business requirements change and you're constantly sending people into that 1600 line backend function or whatever, it's likely worth it to start doing some refactors. But otherwise if I don't have a good reason to be in there I pretend I don't see it.
- m463 2y agoThey should put it in an excel spreadsheet. Then it would be carefully documented and be immediately retired, no possible way to outlive its usefulness. https://xkcd.com/2730/ https://xkcd.com/2730/
- squarepizza 2y agoThe insidiousness of notebooks is in their uncanny resemblance to proper code. To take writing for example, a handwritten draft scrawled on coffee-stained yellow paper is more obviously a work-in-progress than a typed manuscript. But the maturity of code is not so immediately apparent.