It's definitely more difficult with modern cars that have "keyless entry" and remotes that lock/unlock.
Back in the day, all you had to do was push down the button...and the door would lock. EASY to lock your keys in the car. Nowadays, you need your key in hand to lock the car...not so easy to do.
When I said I'd done this twice, but once wasn't my fault...I forgot one. Last year, I unlocked the car, opened the passenger door to put some stuff inside, set my keys on the seat, and closed the door. That's when I found out that the Jetta's system automatically re-locks the doors unless it's the driver's door that's opened...open any of the other three, and the doors re-lock in one minute...I had to call my wife to bring the spare key. 😳