pillar-markup / pillar

Markup syntax and associated tools to write and generate documentation, books and slides
MIT License
50 stars 37 forks source link

start and stop in DocumentItem look like unused #285

Closed Ducasse closed 6 years ago

Ducasse commented 6 years ago

Apparently start and stop are only set for PRHeader in the parser. header "I create a PRHeader"

^ super header ==> [ :array | 
    (PRHeader 
        withAll: (array second ifNil: [ {} ]) 
        level: array first size)
        start: array first start;
        stop: array first start + array first size + (array second ifNil: [ 0 ] ifNotNil: [ array second size ]) ]

Now noboby really use start, and stop (accessors or instance variables).

Ducasse commented 6 years ago

So I do not really know. May be we can remove it and if one day we need it we add it.

jecisc commented 6 years ago

Maybe just let a comment with the last commit SHA where we can find the code?

When I want to clean code but know it might be useful later I tend to do that.

Ducasse commented 6 years ago

Good idea.

guillep commented 6 years ago

Why can't we just use git blame or so for that? I have leaving messages in the code for what the versionning system should provide us...

On Sun, May 20, 2018 at 8:46 PM, StéphaneDucasse notifications@github.com wrote:

Good idea.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pillar-markup/pillar/issues/285#issuecomment-390502569, or mute the thread https://github.com/notifications/unsubscribe-auth/AArO4rttBv4GY_NVqkyiZD3a38Dx1J9zks5t0boPgaJpZM4UGLJv .

--

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr http://www.cnrs.fr

Web: http://guillep.github.io http://guillep.github.io

Phone: +33 06 52 70 66 13

jecisc commented 6 years ago

Because when you don't know the project and have to implement a feature you don't know that the feature was originally here and deleted.

People use git blame when they know there was something there before most of the time.

guillep commented 6 years ago

But with that reasoning we should put plenty of comments everywhere. That does not make sense! What about all the cleanings we did with Stef in the past few months? Should we add comments for them too?

guillep commented 6 years ago

Also, that for a setter and getter that are removed and never had users?

jecisc commented 6 years ago

In general, I do that only when the code I remove has no other equivalent, was not easy to guess and has a chance to be needed later. In the end, there is not a lot of such cases.

Ducasse commented 6 years ago

apparently doru would like the inverse: that all the tokens get identified. So we will see.