question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consistent interface

See original GitHub issue

Just wanted to get your feedback on API consistency. I think we could do a lot more to make the API consistent and intuitive to use. Some examples:

  • to_past, to_present, to_past functions return a mutated wrapped instance but americanize and britishize return just the changed text. Is that by design?
  • Sentence.to_past returns the mutated Sentence instance but same doesn’t apply for Text.to_past. (I don’t know if there’s any way to fix that other than extending Array.prototype)
  • Unlike other wrappers, (new NLP.term(...)).text is a string property rather than a function.

Also, I think it might make things a lot less error-prone if we can make the entire library immutable (that’d break backwards compatibility, maybe offer an immutability helper?)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
spencermountaincommented, Jul 19, 2017

hey Matthew, yeah you know, we’ve got the api articulated over here, we should really just add a boolean for which methods are mutable right now. I’m re-doing the docs and will add that information in

1reaction
nateabelecommented, Jul 19, 2017

@zenflow Or you could check out Ramda.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Consistency Is So Incredibly Important In UI Design
Consistent user interfaces facilitate communication. Use visual consistency to prioritize content, make it navigable, or highlight important ...
Read more >
Consistent Interface
The consistency of an interface is important for the user while building an understanding of the system, developing a mental model of the...
Read more >
Principle of Consistency and Standards in User Interface Design
Consistency limits the number of ways actions and operations are represented, ensuring that users do not have to learn new representations for ...
Read more >
5 tips to build a consistent UI and improve your user experience
5 tips to build a consistent UI and improve your user experience · 1. Make it match your branding · 2. Find your...
Read more >
Consistent User Interface - an overview | ScienceDirect Topics
Websites are designed with UI standards that make the layout, navigation, and functionality consistent across all pages. This consistency makes us more ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found