[Phpmyadmin-devel] about the "\n"

Marc Delisle marc at infomarc.info
Sat Apr 28 13:57:47 CEST 2012


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.

-- 
Marc Delisle
http://infomarc.info




More information about the Developers mailing list