GithubHelp home page GithubHelp logo

Comments (4)

Pustur avatar Pustur commented on May 26, 2024 1

I just realized that some of the changes I was going to make were already taken care by you during a previous release, so there's not a lot to fix anymore.
At this point I think you can change it yourself next time you touch the code.

Have a good night.

from pretty-print-json.

dpilafian avatar dpilafian commented on May 26, 2024

The concept of prettier is great, but the style choices result in code that is uglier than mud. Prettier is really geared towards procedural programing and makes a mess of functional code. Alignment is destroyed. Clean, simple ternary assignments are expanded into bulky multiline blocks. It assumes if statements will have multiline blocks.

Of course, some people like the style decisions of prettier, and the library is very upfront that it's opinionated.

The whitespace in pretty-print-json follows a very specific pattern. Think of blocks of code indented like a hanging paragraph or like the JS equivalent of Python. The advantage is that you can see where the block ends without analyzing the content of the code. In the typical indentation used in most JS code you see, you cannot always tell if a line of code starts a new block without first interpreting the code.

from pretty-print-json.

Pustur avatar Pustur commented on May 26, 2024

Ok fair enough, I understand if you want to keep it this way.

The problem now however, is that the style you describe is not consistent throughout the codebase (my contributions have followed a different style for example). I would have gladly changed this if you mentioned it before merging my PRs.

If you still want me to fix the inconsistencies let me know, otherwise you can close this issue if you'd like to leave it like it is now 👍

from pretty-print-json.

dpilafian avatar dpilafian commented on May 26, 2024

If you want to put up another PR, go for it.

Sometimes the back-and-forth on PRs is too much effort compared to just updating the style next time I'm editing the code. I submit a number of issues to give people an opportunity to contribute and learn about open source. I don't get too fussy about PRs since I just do it for fun.

from pretty-print-json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.