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

The reason I would advocate using hyphens is you should do what the language (standard libraries) do. For example:

    css:
    margin-left, border-bottom (hyphenate)

    javascript:
    getElementById, documentNode (lower camel case)

    ruby:
    each_index, has_key? (underscore)


This would be an interesting discussion. I prefer to use the same coding style for the whole project without caring how the original authors of each language did it. I do however understand that the language API follows the original convention so one would eventually break it by following by reasoning. Ex in js: make_element_slide(getElementById('box')).




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: