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

"Couple of important remarks" (part2) - Exchange rate app #3549

Open
saidam90 opened this issue Mar 31, 2024 · 2 comments
Open

"Couple of important remarks" (part2) - Exchange rate app #3549

saidam90 opened this issue Mar 31, 2024 · 2 comments

Comments

@saidam90
Copy link
Contributor

Could you please explain in the content of the "Couple of important remarks" (part2), in the code of the Exchange rate app why we cannot initialise state to an empty array [], instead of null? Both seem to produce the same result, but having an explanation in the content would be helpful.

@mluukkai
Copy link
Contributor

mluukkai commented Sep 2, 2024

currency is just "one thing" so representing missing currency with an empty array does not feel semantically correct, a much better missing "thing" is null

if the state contains many things, such as notes, an empty collection is quite naturally represented with empty array []. null could also be used but [] feels better

I should and would write a better explanation in the text

@saidam90
Copy link
Contributor Author

saidam90 commented Sep 2, 2024

Makes sense, thank you for the response!

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

No branches or pull requests

2 participants