Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add map example, and couple of TODOs #154

Closed
wants to merge 4 commits into from

Conversation

jigargosar
Copy link

@jigargosar jigargosar commented Nov 1, 2016

Looking for feedback. To avoid continuing on the wrong path.

@jigargosar
Copy link
Author

#153

@@ -3,3 +3,4 @@ tmp/
/npm-debug.log
.directory
.kateproject
.idea/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should live in your global .gitignore.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • thanks :D but I like to commit project files in my other projects.
  • I was wondering if .kateproject can live here, what's the harm in keeping .idea/ ?

Copy link
Member

@MattMS MattMS Nov 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the same, (either remove kateproject or add idea) as long as we standardise the / usage.
Unless a core member is using Kate, then that would bump it's priority.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove .directory and .kateproject as well, unless they're actually generated by this project.

console.log(html)

```
Above code is too verbose and we are prone to making mistakes. Ramda provides a `map` function to achieve
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my mind, the problem with a for loop is it mixes together the iteration and the transformation. The map version abstracts away the iteration, so all you have to do is write the function that transforms each element.

This leaves aside the fact that map is for more than just lists, of course ...

R.map((lib)=>"<li>"+lib+"</li>", libs)
```

Much more concise. We could refactor this code further by writing a reusable wrapTag function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concision is not a goal in itself; clarity should be. This is clearer because we don't need to know which element we are transforming (e.g. libs[i])

@CrossEye
Copy link
Member

CrossEye commented Nov 2, 2016

I think this is a great start! I agree with the comments from @buzzdecafe and I have a few more to add myself (tomorrow; it's bedtime for me.) But I like where this is going!

@MattMS
Copy link
Member

MattMS commented Nov 2, 2016

It may be pedantic, but would it be worthwhile changing the bold items to headings?

This may require rewording the opening sentence and the headings.

@CrossEye
Copy link
Member

CrossEye commented Nov 2, 2016

I'd really like to see the manual retain a consistent style throughout. One thing this section does very different from the few others written so far is to make the headers integral to the narrative, and deeply interconnected. So I would prefer to see a little introductory matter with this in plain text:

Many times we loop over lists for

  • Transforming
  • Filtering
  • ...

where the iteration of the list is simply boilerplate...

followed by sections simply headed "Transforming", "Filtering", etc.

console.log(html)

```
Above code is too verbose and we are prone to making mistakes. Ramda provides a `map` function to achieve
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should link to the functions on first usage:

... Ramda provides a [`map`][ma] function to...

[ma]: http://ramdajs.com/docs/#map

@CrossEye
Copy link
Member

CrossEye commented Nov 2, 2016

One other stylistic point. The two fairly completed sections, Small Functions and Immutability try to intersperse explanatory text and code, but every bit of code has some introduction. Rather than an explanation after you see it, you have a description of what's coming before you do. I think it would be useful to stick to that throughout.

@jigargosar
Copy link
Author

  • I am over-excited after this amazing feedback from everyone. :D
  • I haven't vanished, will continue work on it.
  • But, there might be some delay, although I am pushing to take a week off.
  • To enjoy my, "The Week of Want"

Jigar Gosar
The Functional Programmer https://medium.com/the-functional-programmer
twitter http://twitter.com/JigarGosar, linkedin
https://www.linkedin.com/in/jigar-gosar-1310818
+91 9892 006911

On 2 November 2016 at 17:51, Scott Sauyet [email protected] wrote:

One other stylistic point. The two fairly completed sections, Small
Functions
https://github.com/ramda/ramda.github.io/blob/master/manual/01-intro/SmallFunctions.md
and Immutability
https://github.com/ramda/ramda.github.io/blob/master/manual/01-intro/Immutability.md
try to intersperse explanatory text and code, but every bit of code has
some introduction. Rather than an explanation after you see it, you
have a description of what's coming before you do. I think it would be
useful to stick to that throughout.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#154 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABOcmuNsOxwGfb4PakRYGKe-cQlrmRpks5q6IBkgaJpZM4Kl758
.

@buzzdecafe
Copy link
Member

  • But, there might be some delay, although I am pushing to take a week off.
  • To enjoy my, "The Week of Want"

enjoy -- no need to rush

@CrossEye
Copy link
Member

CrossEye commented Nov 7, 2016

@jigargosar: I've also gotten back to working on this. I'll submit a PR for another section today or tomorrow. But this has already been very slow. A few days or a week is nothing at all! 😄

@jigargosar
Copy link
Author

@CrossEye Thanks Scott, looking forward to your next article.

  • Agreed that it has been slow, but that's the exact reason I want to push hard.
  • I want to make sure to contribute before I run out of steam ;)
  • Hopefully, that will excite and motivate others to do the same.
  • But I am getting ahead of myself, I really need to start making "at least one commit everyday"
  • Waiting for "the big bang week of want" (or a large block of free time), is probably the reason it has been so slow ;)

* Using examples from https://github.com/CrossEye/FuncProgTalk
* Added introductory text.
* Code examples are preceded by explanatory text.
* Changed emphasis from 'Conciseness' to  'Clarity'
* Added link to methods on first usage.
@jigargosar
Copy link
Author

Hopefully I have addressed all the comments in the last commit.

@jigargosar
Copy link
Author

jigargosar commented Nov 8, 2016

@davidchambers I would like to understand the reasoning behind removing
them.

  • What's the harm in keeping them? I am eager to learn.

@MattMS
Copy link
Member

MattMS commented Nov 8, 2016

@jigargosar how many and which configuration files should we ignore?

Ideally each person would be ignoring files/folders created by their editor, unless they are dependencies of this project.

@davidchambers
Copy link
Member

What's the harm in keeping them? I am eager to learn.

What @MattMS said. :)

Let's assume I contribute to 100 projects, and use a text editor which creates a "hidden" file in a directory whenever I edit a file in that directory. I could either:

  • ignore these crufty files for all my projects; or
  • update .gitignore in each of the 100 projects.

@jigargosar
Copy link
Author

@davidchambers Thanks for the explanation. Now I understand the motivation.

  • From our past conversations, you might be aware of my dislike towards unnecessary duplication.
  • So we have complete agreement there.
  • In this case though, these are non-crufty files, not ignored in my other projects.
  • Some opensource projects even allow committing IDE files.
  • Using same logic, it follows that I explicitly ignore IDE files in projects that don't allow committing them :D
  • Regardless, I shall remove this from .gitignore

@davidchambers
Copy link
Member

This pull request is quite old, @jigargosar. Shall we close it, or are you interested in completing it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants