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

> - Keep function names short. Less than 30 characters.

Recently I asked GPT to port a browser game to Rust. It voluntered this gem:

draw_image_with_html_image_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh(...)

I thought it was smoking some good stuff, but it turned out, that is actually the name of the function!

https://docs.rs/web-sys/latest/web_sys/struct.CanvasRenderin...



They laughed at objective-c back then, now the shoe's on the other foot


So much this. DoThisWithThatAndThatAndThis is a objective c convention and I love it so much that I use it everywhere.

Although a bit of taste is required to keep code legible and pleasant.


I like long function names as long as they're still explanatory and not distracting.


This is an unfortunate side effect of bridging an API from a language that supports function overloading, into a language that does not




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

Search: