[Phpmyadmin-devel] about the "\n"

Dieter Adriaenssens dieter.adriaenssens at gmail.com
Sat Apr 28 21:37:53 CEST 2012


2012/4/28 Marc Delisle <marc at infomarc.info>:
> Le 2012-04-28 07:52, Rouslan Placella a écrit :
>> On 28/04/12 12:36, Marc Delisle wrote:
>>> Le 2012-04-28 04:56, Rouslan Placella a écrit :
>>>> On 28/04/12 08:52, Marc Delisle wrote:
>>>>> Le 2012-04-27 16:39, Dieter Adriaenssens a écrit :
>>>>>> Op 27 april 2012 21:11 heeft Marc Delisle <marc at infomarc.info> het
>>>>>> volgende geschreven:
>>>>>>> Le 2012-04-27 14:55, Rouslan Placella a écrit :
>>>>>>>> On 27/04/12 14:26, Marc Delisle wrote:
>>>>>>>>> Hi,
>>>>>>>>> When touching a piece of code, if you see a "\n" generated for HTML,
>>>>>>>>> it's pretty much safe to remove it (if proven otherwise, we'll build a
>>>>>>>>> wiki page documenting those cases).
>>>>>>>>>
>>>>>>>>> The reason was to generate more readable HTML code; now that we
>>>>>>>>> (hopefully) use Firebug to look at the generated HTML, these "\n" are no
>>>>>>>>> longer needed.
>>>>>>>>>
>>>>>>>>
>>>>>>>> I'm not sure how good of an idea this is. What about the casual user
>>>>>>>> that might want to have a stab at figuring out where something is going
>>>>>>>> wrong, for example? Such a user may not have firebug.
>>>>>>>>
>>>>>>>> Bye,
>>>>>>>> Rouslan
>>>>>>>
>>>>>>> It's mostly older parts of the codebase that are using "\n", so this
>>>>>>> casual user already has this problem.
>>>>>>
>>>>>> For esthetic reasons I prefer to use the "\n", the produced html looks
>>>>>> cleaner and better structured. It's a bit like using a coding style
>>>>>> (indentation, ...) to have readable code.
>>>>>
>>>>> Dieter,
>>>>> aren't you using Firebug to look at the HTML?
>>>>
>>>> I wouldn't call Dieter a casual user, but this kind of proves my point.
>>>> Also, I don't think that removing all the newlines will give us any
>>>> noticeable decrease in page load times.
>>>
>>> This is not the reason I was thinking of. The main reason is that,
>>> because some parts of the code are adding newlines to the generated HTML
>>> and some (most?) are not, it's unclear what future development should do.
>>
>> I'd say that devs should make a judgement call on a per case basis. We
>> already have a huge amount of guidelines and rules. If we add another
>> guideline, people will have to remember and/or enforce it. And doing so
>> for something that at the end of the day IMO is pretty irrelevant, is
>> not necessary.
>
> IMO it's not irrelevant. The main goal of version 4 is to improve code
> readability and it's confusing to see newlines generated in some parts
> and not in another.

True, it's not very consistent to have it in some parts and not in others.

If we would choose to use newlines, after which tags should we put one?
While adding newlines is still OK, applying indentation in html, would
take a lot of time to get right.

Anyway, Having newlines in html makes it look good, and gives a good
impression to users who take a peek at the html. A messy html/code
looks less attractive and will give the impression that phpmyadmin
development is messy as well.
I'm not saying that it is, but it's like marketing. If your product
looks good, even in the details, it's more likely to attract customers
(in our case prospective developers/contributers), the actual quality
of the product defines if a customer will continue using the product.
But a poor looking product (I'm not talking about our UI), will
attract less customers even if the quality of the product is good.

I'm a fan of well structured code and well structured html, but I'm
also aware that reaching this goal takes a lot of effort, effort that
doesn't go into anything else. The question is of course how important
it is for phpmyadmin to have well structured html (I think having well
structured code is more important).

-- 
Kind regards,

Dieter Adriaenssens




More information about the Developers mailing list