pacifio / byte_flow

Byte flow is a pure dart , dependency less library that provides common utility functions for lists and strings .

Home Page:https://pub.dev/documentation/byte_flow/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't get stuck in the JS world, harness the power of extensions

miyoyo opened this issue · comments

Hello there!

Now, you might wonder why your post on Reddit did not garner much support, and there are a few reasons I can think of:

  • Don't reinvent the wheel!
    • Dart already has many built in functions, and some of your code is nothing but reimplementing functions with a new name, layers of abstraction for the sake of layers of abstractions are disliked by many here.
  • Use extensions!
    • Dart supports extensions, which lets you append methods to a type you do not own, this library is a perfect example of code you can fold into an extension.
  • Check your terminology!
    • Dart has Lists, not Arrays, the difference is often minute, but terms matter, using the wrong terms may put people off.

Overall, there are things here which are worthy to be in a library, but remember that libraries exist to solve problems, problems that might not exist, or be already solved, or present themselves in completely different ways in other languages.

Lodash is built to work against JS' (effectively) complete lack of stdlib, whereas Dart's stdlib allows you to cover some usecases better than methods in a library ever could, or provides short idioms that are used in actual code to cover most other usecases. Extensions let you put yourself as an stdlib patch to extend what's not there yet.

Yes I have noticed , I am planning to implement the functions written for lists to iterables and use extensions , Better the document and bring utility functions for Maps , Strings and Int objects as well .

The reason behind the creation of this library is the lack of high level functions . I used dartx , more and quiver dart but all of them were either complex to uses ( I mean lacks simplicity ) or I just can't find the functions I needed .

Stay tuned for future updates , I will definitely try my best to make this library more usable and stable , PRs are welcome .