Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why would you add the unnecessary level of indirection with the _add_item() method? And if your application uses standard IDs throughout then yes you can guess it :)


This happens all the time. Usually at api intersection boundaries. I do this a lot interfacing camera drivers in some flavor of C with C++ run times, so most gets passed through, but char* goes to string, pointers go to shared_ptr, etc.

I also use it a lot at boundaries where the modality changes, eg going from local data structures to RPC, where the data shape is the same, but there is io and fault tolerance to deal with.




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

Search: