Bjørn Jakobsen
    • 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
    # SPO - Lecture 1 ## 1 - Review your individual list of programming languages and make a new list of all the computer languages that group members know. * C * C# * C++ * Java * JS * Typescript * VBA * Processing 3 * Python * Markdown * LaTeX * HTML * CSS * Node.js * p5.js * R * MatLab * SQL ## 2 - Categorize the above languages according to generations (1st to 5th (or 6th)) ### 1st - None of the above ### 2nd - None of the above ### 3rd - C, C++, C#, Java, JS, Python, Processing 3, VBA, Typescript, Node.js, LaTeX, P5.js ### 4th - SQL ### 5th - MatLab, R, ## 3 - Categorize the above languages according to paradigm (imperative, object oriented, declarative, special) ### Imperative: C ### Object oriented: C#, Java, C++, Typescript, Processing 3, Python, p5.js, Node.js, JS, VBA ### Declarative: SQL, MatLab, R ### Special: None of our languages are special ## 4 - Create a new list of language features group members would like in a new language. Are any of these features in conflict with each other? How would you prioritize the features? * if-else * for * while * for each * functions/methods * classes/objects * not typed * startup + main loop ## 5 - Do Sebesta exercise 1, 2 and 3 page 55. **1. Do you believe our capacity for abstract thought is influenced by our language skills? Support your opinion.** - Yes, features of a programming language can be limiting. - There is a difference between thinking in abstraction in imperative languages and object oriented languages. E.g. in C there are not classes or generics, but in C# there are classes. **2. What are some features of specific programming languages you know whose rationales are a mystery to you?** - brainfuck, nobody can read it, it makes no sense what...so..ever. **3. What arguments can you make for the idea of a single language for all programming domains?** - That switching project type would not have the learning curve of understanding a new languages syntax. It would be able to run on all architectures. - Languages would not have to be compatible (e.g. backwards compatible), since there is only one (to rule them all) - One IDE could be used for everything (a bit like VS Code is trying to be) ## 6 - Do Sebesta exercise 4, 7, 10 and 17 page 56. **4. What arguments can you make against the idea of a single language for all programming domains?** - A language that can do everything is rarely very efficient at any of them. - It would most likely not be simple, and have way too much orthogonality. This causes readability and writability to decrease **7. Java uses a right brace to mark the end of all compound statements. What are the arguments for and against this design?** - It is easy to see when a body ends but takes a long time to write and it can be hard to find where an end bracket is missing if there is a lot of nesting. **10. What are the arguments for writing efficient programs even though hardware is relatively inexpensive?** - Energy consumption and computation is still not free, and it also makes it possible to run on a larger range of hardware. **17. Some programming languages — for example, Pascal - have used the semicolon to separate statements, while Java uses it to terminate statements. Which of these, in your opinion, is most natural and least likely to result in syntax errors? Support your answer.** - I like when it is used for terminating statements, because it defines when I am done with this statement, and now I can start on another. It is more likely to have syntax errors if you forget the semicolons when terminating statements, but on the other hand for some people it makes sense to have the semicolons at the end, as if it was a punctuation mark. - Pascal is worse since it seems more inconsistent. ## 7 - Do Sebesta exercise 18 page 56. **18. Many contemporary languages allow two kinds of comments: one in which delimiters are used on both ends (multiple-line comments), and one in which a delimiter marks only the beginning of the comment (one-line comments). Discuss the advantages and disadvantages of each of these with respect to our criteria.** - One line: quick for one line of code, but a lot of work for multiple lines. - Multiple-line: Increases writability - it allows to comment out sections of code fast. If you only want to comment out one line of code, it is slower since you have to write in front of and behind the code. ## 8 - Do Fisher et al. Exercise 5 and 6 on page 27-28 (exercise 7 and 14 on page 56 resp. 58 in GE) **5. To allow the creation of camera-ready documents, languages like TeX and LaTeX have been created. These languages can be thought of as varieties of programming languages whose output controls a printer or display. Source language commands control details like spacing, font choice, point size, and special symbols. Using the syntax-directed compiler structure of Figure 1.4, suggest the kind of processing that might occur in each compiler phase if TeX or LaTeX input was being translated. An alternative to “programming” documents is to use a sophisticated editor such as that provided in Microsoft Word or Adobe FrameMaker to interactively enter and edit the document. (Editing operations allow the choice of fonts, selection of point size, inclusion of special symbols, and so on.) This approach to document preparation is called WYSIWYG — what you see is what you get — because the exact form of the document is always visible. What are the relative advantages and disadvantages of the two approaches? Do analogues exist for ordinary programming languages?** - TeX and LaTeX: Templates - easier to automate creation of documents, and easier to make several uniform looking documents. - WYSIWYG: Easy to use for beginners, because WYSIWYG editors provide easy interfaces to use. **6. Although compilers are designed to translate a particular language, they often allow calls to subprograms that are coded in some other language (typically, Fortran, C, or assembler). Why are such “foreign calls” allowed? In what ways do they complicate compilation?** - compilation is more complicated due to more languages being involved, and sub-program calls are potentially very bad for excecution costs and hard to optimize. - Compilation is complicated, because in order to create the result the compiler has to interleave the output of two languages. ## 9 - Do Fisher et al. Exercise 8 on page 28 (exercise 11 on page 57 in GE) **8. C is sometimes called the universal assembly language in light of its ability to be very efficiently implemented on a wide variety of computer architectures. In light of this characterization, some compiler writers have chosen to generate C code as their output instead of a particular machine language. What are the advantages to this approach to compilation? Are there any disadvantages?** - Disadvantages: Difficult to translate some high-level languages to C. Loss of low level control. The performance of the new features might not be able to be fully optimized. - Advantages: Easy portability. C can be compiled to fast assembly code with existing C compilers. Now the compiler writes do not have to replicate all of the optimizations already built into the C compiler.

    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