GithubHelp home page GithubHelp logo

Comments (33)

sabareeshkk avatar sabareeshkk commented on April 28, 2024 5

@Chalarangelo i am excited to try any one of these.

from 30-seconds-of-code.

feiwen8772 avatar feiwen8772 commented on April 28, 2024 5

@kingdavidmartins @Chalarangelo I really like this project! This project should be more popular than Lodash. This project is a collection of code snippets, not a library. More simple and easy to learn.

from 30-seconds-of-code.

kingdavidmartins avatar kingdavidmartins commented on April 28, 2024 3

@skatcat31 It's now Titled: Elect Lodash Methods To Demystify ~ Log

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 3

After 1.5 months of work, all the worthwhile methods from Lodash have been added as snippets in the repository. Huge thanks to everyone who contributed to this enormous project!

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 2

@kingdavidmartins I love you, man. I will start working through a few of these over time. This list is awesome. Hope we see it to completion eventually!

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 2

I believe lodash's slice and reverse are pretty much polyfills for older browsers. We should not implement those.

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 2

@kingdavidmartins I tried to clean up the log by marking the natively implemented functions, as well as the ones I remember that we have implemented already. We seem to be about 30% through it, which is very impressive for just one week!

from 30-seconds-of-code.

kingdavidmartins avatar kingdavidmartins commented on April 28, 2024 2

Hey @skatcat31 👋 Yea no problem.

That's a fair question. Hopefully my response helps.

The key word here is demystifying. By demystifying I mean exposing all their methods/function in a way that is easy & simple for the everyday/beginner programmer to understand. As amazing as lodash is, it isn't a simple feat to read through and understand all of lodash methods for your everyday/beginner. Especially when a lot of their method re-uses a lot of their other methods and/or other libraries. The goal here is to have users just find a snippet similar to lodash's snippet and say "ahhhh ok I kind of get it" or "hmmmm I wonder what Array.from() is why not use Array.apply()" or even "What if I just tweak x or y".

This is very important because it's simple and the barrier to entry is low. Someone just getting started can understand our snippets fairly easily. So why not expose them to one of the most used methods in our industry?

Think of demystifying lodash as a way to creating a beginners guide to lodash methods or understanding lodash guide in 30 seconds or less. I definitely think it not only adds value for Non Traditional who don't have a CS degree or are switching from a dying industry and trying to learn/understand new methods they have or haven't used. But also adds value for the kids in elementary/middle/high school who have just finished or started a codeacademy JavaScript course. None the less I don't think continuously working on the demystifying lodash backlog negatively impacts the projects.

@Chalarangelo Thoughts?

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 2

@kingdavidmartins Great explanation on why we are doing this. @skatcat31 my two cents on the matter are as follows:

  • Tools like jQuery and Lodash are industry standards and people use them without knowing their inner workings. Many developers on SO for example feel like jQuery is some kind of voodoo magic that cannot be done with regular JS. We need to show them otherwise!
  • Lodash has a ton of useful functions that I would want to use in a project, but I avoid adding huge libraries when I can help it and I like learning how their guts work, so I can modify them. Therefore, it provides us with a great opportunity to implement useful and commonly used methods for people who want to understand how it works and want to hack them a little bit, see what they can make of them.
  • As far as it has been discussed, we are not going to be building a library out of this, unless demand is extremely high. In that case, we might make a secondary project that releases every month with stable and well-tested snippets. Definitely do not bet on that, though.

TL;DR: Lodash is a great starting point and new contributors know what to build and what the expected functionality is, plus we know that the methods we are implementing are useful and we do not have to figure out if they are a good fit in term of usability or not.

About voting: I believe in community moderation and decisions, so I'm very glad that we can now decide which methods we do not want. For me the rule of thumb has always been that if something is natively implemented, we do not rewrite it (unless we extend functionality). That being said, we have a bunch of isX() methods that contradict my statement. Kindly suggest what we should be doing with them in the comments below.

from 30-seconds-of-code.

mycaule avatar mycaule commented on April 28, 2024 2

Other libs to consider among many others:

With ES6 you can import only some of the functions, which allows developer to pull a banana
from the tree without pulling the whole jungle. If I want to use these functions in production I would rather use a popular library than reinventing the wheel.

All these libs are working on more ES6-ish implementation.

You might need to make a difference between a collection of utility functions and just pure exercises. Like a teacher you need to select just the interesting ones so that the student doesn't have to go through all the textbooks. The goal is also to teach the student of JavaScript features.

Some good references of teaching with examples:

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 2

I think that the set, unset, setWith, update and updateWith methods in Object are nearly impossible to implement without making assumptions or writing really bad code or code that is hard to explain. I vote to skip those entirely!

from 30-seconds-of-code.

kingdavidmartins avatar kingdavidmartins commented on April 28, 2024 1

@sabareeshkk Yea give some of them a shot. Hope you submit a PR 😄

from 30-seconds-of-code.

skatcat31 avatar skatcat31 commented on April 28, 2024 1

So something that's been bothering me: why are we demystifying lodash?
We aren't, nor should we try to be, a replacement. We are more a place for people to learn cool tricks in small snippets aren't we?
IFF we wanted to be a library we would need to be MUCH more structured about our approach to development, and pull requests, and implimentation( ala Ramda, Lodash, and other libraries that allow community support )
If we want to do such a series, why would we do it here? It'll add a lot of previous arts to questionable gain IMHO.

from 30-seconds-of-code.

kingdavidmartins avatar kingdavidmartins commented on April 28, 2024 1

Hey @feiwen8772 👋

Aww Thanks 💯 ❤️ This means soooo much. This project is made possible by @Chalarangelo & all the other contributor's that worked so hard making it all possible. You included 😉

Thanks again 😄

from 30-seconds-of-code.

fejes713 avatar fejes713 commented on April 28, 2024 1

@Chalarangelo Agree, plus we don't have to copy the whole Lodash 👍

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 1

I think we are reaching a point where we need to decide what we want from the leftover stuff from lodash. There's definitely plenty of stuff we could really do without.

On the subject of the ones I mentioned, I am marking them off in the log so that we can work on others.

from 30-seconds-of-code.

meetzaveri avatar meetzaveri commented on April 28, 2024

So should we start picking one by one from these resource to contribute new snippets? Is that you saying @Chalarangelo

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

@meetzaveri yep, let's ge started. Follow the guidelines in CONTRIBUTING.md to make merging PRs easier, work on individual files and state here which ones you intend to write (even though you might not), so we don't end up with duplicates if possible. I am clearing up PRs right now, will try to chip through some of the methods listed here later today.

from 30-seconds-of-code.

sabareeshkk avatar sabareeshkk commented on April 28, 2024

@kingdavidmartins sure will do 👍

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

@kingdavidmartins I think we have https://lodash.com/docs/4.17.4#difference implemented under array-difference.md.

from 30-seconds-of-code.

kingdavidmartins avatar kingdavidmartins commented on April 28, 2024

@Chalarangelo if there is any snippets I am missing please let me know. I kinda was up all night so not as sharp as I should be. Later on after some rest I should have all the current snippets that have been implemented updated and extend the list to include the Collection, Lang, Date, and Function section/category

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

Alright, I'll see if we have any of them and I will also get coding now that the PR list is almost empty.

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

I updated some the list with some of the changes made and implementations added, also moved all completed functions to the very bottom to be easier to find new things to implement at first glance.

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

By the way I am sticking to the same PR procedure as everybody else for at least some of these snippets, so that I can get feedback before merging them in. Otherwise, we can easily lose track of what's going on.

from 30-seconds-of-code.

fejes713 avatar fejes713 commented on April 28, 2024

@kingdavidmartins & @Chalarangelo are we going to create a library out of this? 😄

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

@feiwen8772 In all honesty, I don't know. When we're done with Lodash's implementations and the PRs stop coming in so fast, we should look into packaging everything, seeing if people want that. For now, it's a bit out of the scope of the project and there's so much else that needs to be done that we can put that idea on hold for the next month or so. But it keeps coming up all the time, so we will eventually have to discuss that.

from 30-seconds-of-code.

skatcat31 avatar skatcat31 commented on April 28, 2024

While it present a great learning opportunity, if they're at that level of beginner that they can't understand lodashes documentation and some of it's source code I fail to see how we could make it clearer. For some lodash or other library methods that could use an easier to understand version I totally agree.

from 30-seconds-of-code.

kingdavidmartins avatar kingdavidmartins commented on April 28, 2024

Maybe instead of demystifying all of lodash, elect which ones to demystify

I def agree with that statement. To date there have been quite a few methods/functions we haven't really touched and have elected to not implement For example _.map because it's natively supported

@skatcat31 You can also proactively look for snippets/methods on the log you think we shouldn't implement. Which the collaborators/community can vote on in agreement or not

from 30-seconds-of-code.

skatcat31 avatar skatcat31 commented on April 28, 2024

@kingdavidmartins That makes my complaint null if we can vote on what to not do. The question then becomes "How do we vote?"

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

@mycaule Truth be told we are working on Lodash, as it was the easiest/closest to our scope. Ramda is something that has been mentioned before and we might dissect a few of its methods, while jQuery's demistification is something I personally wanted to work on these past few days.

Overall, we are trying to find as much worthwhile material and convert it to our structure, so that people can learn as much as possible and understand their tools

from 30-seconds-of-code.

mycaule avatar mycaule commented on April 28, 2024

Lodash isn't mystifying anything, original library underscore.js even has annotated source, and developers could always look directly at source code if any doubt.
http://underscorejs.org/docs/underscore.html

Paul Irish on JQuery is good resource too: https://www.youtube.com/watch?v=i_qE1iAmjFg

Need to find purpose to that repo. It is great as a teaching material or for interview questions for example. Comprehensiveness might not be necessary, you will not be able to achieve it anyway.

from 30-seconds-of-code.

skatcat31 avatar skatcat31 commented on April 28, 2024

@mycaule yes they can read through it, but it's often easier to see a simple short example than traversing their 1K+ lines of code in those libraries. I constantly implement features of Ramda in vanilla ES6 because I don't want to have to import the many helper functions they use. While not a hit on performance, I don't want a front end to have to load their entire packages for a single function only to discard most of it. If I can use a packager or a smaller version, I often elect to do that.

As for the lessons features we do have the Adapter category right at the top which shows some useful functions. We do need to clean up their descriptions though and put compose into that category as well with a description that states why they would use compose over pipe( algebriac transformation order versus lexical reading order are easier for people to understand based on the context ).

Truth be told once we're done cleaning this up, a longer "lectures"/"examples" namespace might be and interesting extra page of learning materials for people to use.

from 30-seconds-of-code.

lock avatar lock commented on April 28, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.

from 30-seconds-of-code.

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.