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

I must be really out of touch, because I cannot imagine how this is a billion dollar business.


The bastards finally did it. They rewrote Rust in Rust.


I think maybe you're overextrapolating here. Classes are meant to hold state. If you have a bunch of related state, wrapping it up in a class has been a common use of classes even before `dataclass` existed.

What the talk is discussing is the creation of classes for wrapping related _functionality_, sans state. The class isn't really necessary at that point, so you should just create a module with functions instead of a class.

Even if you do need your related functionality to reference some common state, you still might not need a class, because modules themselves are objects and can hold state.

The point of the talk is not to dissuade you from _ever_ using classes, it's to make you think more judiciouly about adding new classes you probably don't need. Python isn't Java, and you dont need everything to be a class.


I've used https://pentest-tools.com in the past. It's not exhaustive, but can be a good starting point.


Thanks, it seems promising, I'll try to give it a test soon


Honestly, I think the generic and model views are way more impressive than the ORM or the admin. They take away all of the boilerplate usually associated with CRUD apps.


I've used them for quite a while but came back to the old function views. The Generic Views are a mess to understand, the hierarchy tree gets so complicated. See for example : https://ccbv.co.uk/projects/Django/4.1/django.views.generic.... there are 9 classes in the inheritance tree. For every slight change from the default behavior you need to research the documentation, find which method to override…

In the end I have to write a bit more of boilerplate each time (and with tools like copilot it's a non-issue) but it's 10x faster to understand what a view does and how when reading code.


> For every slight change from the default behavior you need to research the documentation, find which method to override…

I just use an IDE which allows me to Ctrl+Click into any symbol and see its implementation and underlying classes (and do so recursively if needed). That saves me from having to lookup the documentation all the time.


I remember encountering number 4 in the wild, so I think it deserves to be a genuine "wat". That said, I'm not sure why I (or anyone else) thought I would need to use the identity operator on numbers, but it's certainly a head-scratcher until you dig into the underlying reason.


Maybe such code is written by people scarred by JavaScript and trying to avoid ==. But not sure: I saw this in the wild as well — actually, the victim brought the broken function to chat scratching his head — and he was a quite experienced backend guy (and the experience wasn't in nodejs, AFAIK).

A pretty funny kind of bug, actually: it was some relatively simple function, passing the unit tests but doing some nonsense on real data. Thing is, it was comparing some sequential ids and working perfectly as long as there were no more than 256 objects.


> So every company should cease all AI development for an indefinite period of time

The letter quite clearly asks for six months.


I have been really impressed with PopOS so far.


You should lead by example.


The 8 votes I appear to have on my comment demonstrate that I'm not alone in this. Pointing out pointless comments is not itself a pointless comment, but who am I to argue with an expert in drivel comments?

Feel free to refer to the HN rules on comment quality.


Fan fiction is getting weird.


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

Search: