[phpMyAdmin Developers] JavaScript function names

Isaac Bennetch bennetch at gmail.com
Sun Aug 13 03:47:45 CEST 2017


On Sat, Aug 12, 2017 at 4:30 PM, Maurício Meneghini Fauth
<mauriciofauth at gmail.com> wrote:
> Hello
>
> Already in my plans to review the JavaScript files, especially in the coding
> style part.
>
> I already had a good idea of the code when I was preparing the webpack pull
> request, it just didn't work because I bit off more than I could chew. My
> intention is to work on JavaScript as well, however this time in baby steps
> and setting a style guide is one of those steps.

I thought you might have this in mind :)

> I recommend using the javascript style guide from Airbnb.
> https://github.com/airbnb/javascript
>
> This guide is very popular and very well done. We can use it as a base in
> ESlint and go overwriting the rules as needed. And since it is very popular,
> it would help new contributors who already develop in JavaScript.

I hadn't seen that one yet. You're right that it's very well done.
I have no preference for any particular guide; if you prefer the Airbnb
one then I have no objection. That's fine by me.

> What do you think about using this style guide?
>
>
> Maurício Meneghini Fauth
>
> On Sat, Aug 12, 2017 at 12:03 PM, Isaac Bennetch <bennetch at gmail.com> wrote:
>>
>> 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.
>>
>> _______________________________________________
>> Developers mailing list
>> Developers at phpmyadmin.net
>> https://lists.phpmyadmin.net/mailman/listinfo/developers
>
>
>
> _______________________________________________
> Developers mailing list
> Developers at phpmyadmin.net
> https://lists.phpmyadmin.net/mailman/listinfo/developers
>



More information about the Developers mailing list