3 ms·
> - 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_imag
by andai 2mo ago
> - 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.CanvasRenderingContext2d.html#method.draw_image_with_html_image_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh https://docs.rs/web-sys/latest/web_sys/struct.CanvasRenderin...
- krackers 2mo agoThey laughed at objective-c back then, now the shoe's on the other foot
- egorfine 2mo agoSo 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.
- BrunoBernardino 2mo agoI like long function names as long as they're still explanatory and not distracting.
- swiftcoder 2mo agoThis is an unfortunate side effect of bridging an API from a language that supports function overloading, into a language that does not