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

feat: Add reactive/INTRODUCTION_EN.md #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AZ-0
Copy link
Contributor

@AZ-0 AZ-0 commented Aug 25, 2020

Translate reactive/INTRODUCTION_FR.md to english

@LukaMrt LukaMrt added the translation Translation of existing feature label Aug 26, 2020
Copy link
Member

@fusetim fusetim left a comment

Choose a reason for hiding this comment

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

Some typos to fix. Good translation otherwise.

I like exploding things, so we'll talk about a cannon.
Don't worry about the `(x)` right now, you will understand them later on…

Let's suppose you happily go to Wallmart to buy a cannon. It's a high-tech cannon that can automagically recharge.
Copy link
Member

Choose a reason for hiding this comment

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

The Walmart company has only one "L" in its name

Suggested change
Let's suppose you happily go to Wallmart to buy a cannon. It's a high-tech cannon that can automagically recharge.
Let's suppose you happily go to Walmart to buy a cannon. It's a high-tech cannon that can automagically recharge.


## An explanation to rekindle lost hopes

Looks like you have a bad karma, because I am gonna be mean~. So mean that I'll use complicated words right away: `Publisher`! (Are you fearing me now?)
Copy link
Member

Choose a reason for hiding this comment

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

I suppose it's a typo

Suggested change
Looks like you have a bad karma, because I am gonna be mean~. So mean that I'll use complicated words right away: `Publisher`! (Are you fearing me now?)
Looks like you have a bad karma, because I am gonna be mean. So mean that I'll use complicated words right away: `Publisher`! (Are you fearing me now?)

Don't worry about the `(x)` right now, you will understand them later on…

Let's suppose you happily go to Wallmart to buy a cannon. It's a high-tech cannon that can automagically recharge.
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuses batch, and `(3)` fire as many fuses as you want to throw cannonballs on your boss.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuses batch, and `(3)` fire as many fuses as you want to throw cannonballs on your boss.
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuse batches, and `(3)` fire as many fuses as you want to throw cannonballs on your boss.

or

Suggested change
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuses batch, and `(3)` fire as many fuses as you want to throw cannonballs on your boss.
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuse batch, and `(3)` fire as many fuses as you want to throw cannonballs on your boss.

- You don't even know whether the cannon will throw enough cannonballs to match your explosion desires (Has it enough ammunition? Will it explode halfway?)
- You hate your boss enough that you decided to dance whenever the cannon throws a cannonball.
- You somehow decided to run if the cannon explodes. Thanks, Captain Obvious.
- You have decided to go on strike if your boss is still dead and you are running out of cannonballs. And if the cannon hasn't exploded, otherwise you would have fled too far~
Copy link
Member

Choose a reason for hiding this comment

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

A typo supposedly + no-sense

Suggested change
- You have decided to go on strike if your boss is still dead and you are running out of cannonballs. And if the cannon hasn't exploded, otherwise you would have fled too far~
- You have decided to go on strike if your boss is still alive and you are running out of cannonballs. And if the cannon hasn't exploded, otherwise you would have fled too far.

Comment on lines +54 to +86
// I didn't declare a lot of things, we are doing pseudocode here
interface Me {
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses.
// Just because it's the future.
void onPrepare(FuseBatch fuses);

// This is called whenever the cannon launches a cannonball toward your patron.
default void onNext(CannonBall ball) {
dance();
}

// This is called when the cannon of the future throws an uncaught runtime exception and explodes.
// Yes, the futuuuuuuuure still has runtime exceptions :'c
default void onError(Throwable t) {
runForYourLife();
}

// This is called when the cannon has no cannonball left to fire.
default void onComplete() {
if (boss.isAliveAndKicking())
timeToGoOnStrike();
}
}

interface FuseBatch {
// We kindly ask the cannon to launch `fuseAmount` cannonballs by firing as many fuses.
void fire(long fuseAmount);

// If you suddendly remember the inherent kindness of your boss, stow your cannon and try to cancel the cannonballs' throwing.
// You might miss some fuses though, trampling on them isn't exactly a precise method.
void cancel();
}
```
Copy link
Member

Choose a reason for hiding this comment

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

Weird alternance tab/space

Suggested change
// I didn't declare a lot of things, we are doing pseudocode here
interface Me {
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses.
// Just because it's the future.
void onPrepare(FuseBatch fuses);
// This is called whenever the cannon launches a cannonball toward your patron.
default void onNext(CannonBall ball) {
dance();
}
// This is called when the cannon of the future throws an uncaught runtime exception and explodes.
// Yes, the futuuuuuuuure still has runtime exceptions :'c
default void onError(Throwable t) {
runForYourLife();
}
// This is called when the cannon has no cannonball left to fire.
default void onComplete() {
if (boss.isAliveAndKicking())
timeToGoOnStrike();
}
}
interface FuseBatch {
// We kindly ask the cannon to launch `fuseAmount` cannonballs by firing as many fuses.
void fire(long fuseAmount);
// If you suddendly remember the inherent kindness of your boss, stow your cannon and try to cancel the cannonballs' throwing.
// You might miss some fuses though, trampling on them isn't exactly a precise method.
void cancel();
}
```
// I didn't declare a lot of things, we are doing pseudocode here
interface Me {
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses.
// Just because it's the future.
void onPrepare(FuseBatch fuses);
// This is called whenever the cannon launches a cannonball toward your patron.
default void onNext(CannonBall ball) {
dance();
}
// This is called when the cannon of the future throws an uncaught runtime exception and explodes.
// Yes, the futuuuuuuuure still has runtime exceptions :'c
default void onError(Throwable t) {
runForYourLife();
}
// This is called when the cannon has no cannonball left to fire.
default void onComplete() {
if (boss.isAliveAndKicking())
timeToGoOnStrike();
}
}
interface FuseBatch {
// We kindly ask the cannon to launch `fuseAmount` cannonballs by firing as many fuses.
void fire(long fuseAmount);
// If you suddendly remember the inherent kindness of your boss, stow your cannon and try to cancel the cannonballs' throwing.
// You might miss some fuses though, trampling on them isn't exactly a precise method.
void cancel();
}


```java
interface Publisher<T> {
// We prepare the subscription, this might take some time
Copy link
Member

Choose a reason for hiding this comment

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

Replaced space by tab

Suggested change
// We prepare the subscription, this might take some time
// We prepare the subscription, this might take some time

Comment on lines +117 to +124
// • If the cumulated demand overflow the long max number, it can treat it as unbound, effectively turning into a hot source.
// (We'll see what this means in later sheets)
// • If the Publisher completes (cannot generate anymore element) or errors (sad life), it will call the related method then stop ANY further emission.
void request(long elementAmount);

// Asks the Publisher to cancel the subscription, that is to stop emitting elements.
// Previous pending requests might still be met.
void cancel();
Copy link
Member

Choose a reason for hiding this comment

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

Weird alternance space/tab

Suggested change
// • If the cumulated demand overflow the long max number, it can treat it as unbound, effectively turning into a hot source.
// (We'll see what this means in later sheets)
// • If the Publisher completes (cannot generate anymore element) or errors (sad life), it will call the related method then stop ANY further emission.
void request(long elementAmount);
// Asks the Publisher to cancel the subscription, that is to stop emitting elements.
// Previous pending requests might still be met.
void cancel();
// • If the cumulated demand overflow the long max number, it can treat it as unbound, effectively turning into a hot source.
// (We'll see what this means in later sheets)
// • If the Publisher completes (cannot generate anymore element) or errors (sad life), it will call the related method then stop ANY further emission.
void request(long elementAmount);
// Asks the Publisher to cancel the subscription, that is to stop emitting elements.
// Previous pending requests might still be met.
void cancel();


With this awesome list written by the great and humble me, you ought to understand the lil `(x)` scattered up there! (a retroactive sheet, progress cannot be halted)

Let's stop there for a very small peek into reactive programming, I pray that your imagination run wild on its capabilities~
Copy link
Member

@fusetim fusetim Aug 26, 2020

Choose a reason for hiding this comment

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

Typo I think

Suggested change
Let's stop there for a very small peek into reactive programming, I pray that your imagination run wild on its capabilities~
Let's stop there for a very small peek into reactive programming, I pray that your imagination run wild on its capabilities


## Definition

The original article has the [french](https://fr.wikipedia.org/wiki/Programmation_r%C3%A9active) definition as well, but seeing as it is quite useless I just removed it.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The original article has the [french](https://fr.wikipedia.org/wiki/Programmation_r%C3%A9active) definition as well, but seeing as it is quite useless I just removed it.
The original article has the [french](https://fr.wikipedia.org/wiki/Programmation_r%C3%A9active) definition as well, but after judging that it was quite irrelevant, I just removed it.

Couldn't quite understand the but seeing as it is quite useless, I suggested an alternative

> With this paradigm it is possible to express static (e.g., arrays) or dynamic (e.g., event emitters) data streams with ease, and also communicate that an inferred dependency
> within the associated execution model exists, which facilitates the automatic propagation of the changed data flow.

Wow, that's a lot of cool and complicated words! Don't worry, at this point not feeling overwhelmed would be concerning.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Wow, that's a lot of cool and complicated words! Don't worry, at this point not feeling overwhelmed would be concerning.
Wow, that's a lot of cool and complicated words! Don't worry, at this point no overwhelming feeling would be concerning.


> Haha, I do not fear *anything*! A Publisher is something that publish other things, no?

**EXACT!** Or rather, a Publisher emits things. A Publisher emits values, but specially so.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
**EXACT!** Or rather, a Publisher emits things. A Publisher emits values, but specially so.
**EXACTLY!** Or rather, a Publisher emits things. A Publisher emits values but in a particular way.

> within the associated execution model exists, which facilitates the automatic propagation of the changed data flow.

Wow, that's a lot of cool and complicated words! Don't worry, at this point not feeling overwhelmed would be concerning.
(Or it just means you actually don't need this introduction at all so stop reading it and do something useful with your life)
Copy link
Member

Choose a reason for hiding this comment

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

I'm a big fan of light tone and jokes in articles, but I think this "and do something useful with your life" is kind of too much, unnecessary.


Looks like you have a bad karma, because I am gonna be mean~. So mean that I'll use complicated words right away: `Publisher`! (Are you fearing me now?)

> Haha, I do not fear *anything*! A Publisher is something that publish other things, no?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> Haha, I do not fear *anything*! A Publisher is something that publish other things, no?
> Haha, I do not fear *anything*! A Publisher is something that publishes other things, no?


// I didn't declare a lot of things, we are doing pseudocode here
interface Me {
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses.
// When the cannon finished its installation, it will notify us and we get an infinite batch of fuses.

```

Well now that's done, we don't have anything else to do with our cannon.
So let's haphazardly pick some code from [reactive-streams](http://www.reactive-streams.org/) since it should be related to the official topic of this sheet.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
So let's haphazardly pick some code from [reactive-streams](http://www.reactive-streams.org/) since it should be related to the official topic of this sheet.
So let's haphazardly pick some code from [reactive-streams](http://www.reactive-streams.org/) since it should be related to the official topic of this article.

1. We order a subscription on Amazon Prime.
1. We get the tailored subscription; note that it makes no sense for a person to have multiple subscriptions.
1. We use the subscription to request objects to Amazon.
1. These values will get there, eventually. And later. And might not arrive at all but usually they do (or I at least hope so). Amazon might even find itself out of stock!
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
1. These values will get there, eventually. And later. And might not arrive at all but usually they do (or I at least hope so). Amazon might even find itself out of stock!
1. These values will get there, eventually. And later. And might not arrive at all but usually, they do (or I at least hope so). Amazon might even find itself to be out of stock!

1. We use the subscription to request objects to Amazon.
1. These values will get there, eventually. And later. And might not arrive at all but usually they do (or I at least hope so). Amazon might even find itself out of stock!

With this awesome list written by the great and humble me, you ought to understand the lil `(x)` scattered up there! (a retroactive sheet, progress cannot be halted)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
With this awesome list written by the great and humble me, you ought to understand the lil `(x)` scattered up there! (a retroactive sheet, progress cannot be halted)
With this awesome list written by the great and humble me, you ought to understand the lil `(x)` scattered up there! (a retroactive article, progress cannot be halted)


# Reactive Programming 🇪🇳

This course is concerned about the reactive paradigm and its uses.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This course is concerned about the reactive paradigm and its uses.
This course focuses on the reactive paradigm and its uses.

the former formulation sounded pretty deprecated to me

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

Successfully merging this pull request may close these issues.

4 participants