younguna
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 강남_R_Day06 리뷰 레포트 ### 참석자 - 김도현, 나영균, 임문수, 한수인 ## 1. 코드 동작 이해 ### 나영균님 코드 피드백 - readline 을 사용할때 한번만 받고 메소드를 다시 실행하는 것보단 on 메소드를 사용하여 한줄씩 입력받고 특정입력시에 close를 통해 분기처리해주는 게 더 좋다. - <p style="font-size:0.5em">콜스택에 무한히 쌓일 수 있는 상황으로 보일 수 있지만 <b>rl.question은 콜백함수를 레지스터하고 바로 종료됩니다</b>. rl.question을 감싸는 함수는 콜백함수에서만 불려지며 자기 자신이 부르는 형태가 아니기 때문에 콜스택에 쌓이지 않습니다. New Error().stack을 로그찍어보시면 알 수 있습니다.</p> - 이 코드에서는 딥카피를 하고 변경 후에 다시 할당해주는 데 모든 동작이 하나의 프로그램 안에서 되기 때문에 오히려 딥카피가 불필요하다. 외부에서 데이터를 건드리는 것이 아니기 때문이다....? - <p style="font-size:0.5em">단순히 스스로확인할사항을 명시적으로 구현해 보았습니다.</p> - <p style="font-size:0.5em">객체안의 객체는 참조를 유지하기 때문에 deepcopy까지 욕심을 내보았습니다. 물론 성능적인 이슈는 있다고 합니다.</p> - if문보다는 switch문을 통해 가독성을 높이자. case 표기를 통해서 boolean 문을 분기마다 안써줘도 되기 때문이다. - 동기처리를 어떤 방식으로 하였는가? promise를 사용하여 update를 명령한 경우에 promise 객체를 리턴하여 리드라인 함수에서 분기를 두어 재귀를 바로 실행하거나 resolve를 then으로 잡아 실행. - 데이터를 배열을 나눠서 저장한 이유는? - <p style="font-size:0.5em">설계시 status를 따로 배열로 관리하면 조금더 효율적이라고 생각했습니다. 하지만 실제로는 확신할 수 없습니다.</p> ### 김도현님 코드 피드백 - reduce는 함수형 프로그래밍의 immutability를 추구할때 사용하는 것을 권장합니다. 단순히 forloop을 대체할 수 도 있지만 reduce는 Array의 메소드로서 Array를 돌면서 reducer를 실행하고 새로운 array를 리턴하여 기존의 데이터가 immutable을 유지할 수 있게 합니다. - 스스로확인할 사항에 나온 immutable을 고려했을때 기존의 데이터를 함수안에서 밖으로 엑세스 할 것 보다는 인자로 받아 새로운 array를 리턴하는 순수함수의 방향으로 설계를 추천합니다. ## 2. 코드 동작 개선 - 나영균 - switch문을 사용할 수 있는 경우에 적극 사용합니다. - 디자인을 충분히 하였다고 생각했지만 비동기를 처리하면서 또 스스로확인할사항등을 적용하면서 디자인을 수정하였습니다. 큰틀은 유지할 수 있었습니다. - 디자인과 스켈레톤을 통해 코딩을 하니 코드에 픽스되지 않을 수 있어던 경험이었습니다. - 함수안의 인자또한 참조를 변형하지 않는 방향으로 설계해야겠습니다. - ...operator를 더 이용하여 불변성을 추구해야겠습니다. - 한수인 - async, await 을 안쓰고 Promise를 써서 비동기 처리를 했다. 이유는 너무 최신문법이여서 였는데 실제로 확인해보니 두 문법의 호환율이 비등했다. async, await을 쓰면 코드가 좀더 간결해졌을 것이다. - 디자인이후에 큰틀은 변하지 않았다. 세부적인 동작과정 구현에서 함수의 추가만 있었다. 프로그램이 커질수록 디자인 과정이 중요해질 것이다. - 임문수 - update의 지연 실행을 위해 promise를 쓰지않고 리턴으로 값이 있을 경우에 분기로 setTimeout을 이용하여 2초 대기후 출력 및 재귀를 하도록 구현하였다. - 디자인에서는 while문을 돌려고 했으나 재귀로 구현하게 되었고 함수들의 이름이 겹치는 경우가 있어 t를 붙였다. 그리고 중복을 피하기 위한 함수들이 추가되었다. - 김도현 - 동기적인 코드로만 구현해 비교적 쉬운 난이도로 코드를 구현했다. 동기적으로 개선을 하면, 입출력 구간을 함수로 바꾸고, promise 를 사용해 동기적으로 구현할 수 있다. - 너무 억지로 for문을 제거 하려고 했더니, reduce를 깔끔하게 사용하지 못했다. 객체에 대해 더 이해하고 method들을 사용하는게 올바르다. ## 3. Consideration ### 다같이 확인할 사항 - 상태관리를 mutable 과 immutable 방식 중 어떤 것을 선택했는가? 이중 무엇이 왜 더 좋을까? - immutable하면 비동기적으로 프로그래밍이 동작할때 데이터의 안정성을 보장할수 있다. - mutable하면 데이터의 복사가 위의 방식에 비해 덜 필요하기 때문에 성능적인 부분에서 우위가 있을 수는 있다. - 함수만으로 구현하는데 어떤 장점과 단점이 존재하는가? - 고차함수를 이용하여 코드의 간결성을 향상시킬 수 있다. - 명확한 입출력이 보여서 간결해진다. (순수함수) - side-effect가 최소화된다. - 순수 함수는 예측이 가능하다 - 테스트하는 것이 더욱 쉬워진다. - 참조 투명성덕분에, 함수 결과를 캐싱하여 반복적으로 사용할 수 있다.(memorization) - 핵심을 간단히 유지할 수 있다. - 단점 - 모든 함수가 순수할 수는 없다. - I/O작업, 난수 처리, 네트워킹, 데이터베이스 등을 처리 할 때는 본질적으로 순수 할 수 없다. - Immutable Data Structure는 Thread-Safe(비동기에 있어서)를 쉽게 보장하는 대신 오래된 데이터를 사용하게 될 수도 있다.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully