[phpMyAdmin Developers] JavaScript function names

Isaac Bennetch bennetch at gmail.com
Sat Aug 12 17:03:17 CEST 2017


On Fri, Aug 11, 2017 at 9:43 AM, Michal Čihař <michal at cihar.com> wrote:
>
> I'm not really sure what are best practices in the JS world, but we
> should rather try to hold to that instead of using PHP style things in
> JS. We can then configure Codacy (or other tool) to do such checks.

Indeed, I agree. I quickly was able to find the jQuery style guide[1] or the
Google one[2]. I immediately preferred the Google one because it looks
more comprehensive. On closer inspection, jQuery uses tabs for indentation
and Google uses spaces. I didn't notice any other differences in the areas
that matter to me; they seem pretty similar with style of braces and naming
conventions. So I prefer the Google one. That also happens (by coincidence)
to be the same guide referenced by Manish in his reply.

1 - https://contribute.jquery.org/style-guide/js/
2 - https://google.github.io/styleguide/jsguide.html


On Fri, Aug 11, 2017 at 10:29 AM, Himanshu Agrawal
<himanshuagrawal1998 at gmail.com> wrote:
>
> The comments are also not formatted in a similar way throughout. We can
> also set some guidelines to use /*...*/ or // and whether to give spacing after //. The
> /* should be followed by line break, etc. Is it required or comments would work fine?

I think we should pick a style to follow, then fix up the existing
files based on
the guide presented there, but realistically the code works and any fix ups
are going to result in code that still works, so it's not a very glamorous task.
Even more so with comments that just aren't in a modern format. The whole
section of code may need a refactoring more than it needs to be adjusted
to match the style guide. It's an interesting project management puzzle to
think about whether it should be refactored outright, made to match the
style guide, or just left how it is.



More information about the Developers mailing list