Beyond execution

WEEK 01

Game Development / Software Engineering / 2024-2025
Beyond execution

In this lecture

Understanding how programming languages differ beyond just syntax

Exploring the (c++) build process from source code to executable

Comparing platforms and their (default) compilers

Game Development / Software Engineering / 2024-2025
Beyond execution

Programming languages

There are many programming/scripting languages beyond C++, each with their specific syntax, strengths and common use cases

A Programming/Scripting Language is defined by a Syntax

  • Set of valid instructions
  • Set of keywords
  • Set of valid identifiers: variable names, class names, namespace names
  • Punctuations: braces, brackets, semi columns, ...
    Code written in a programming language is readable by humans

A Programming Language is typically compiled (C++, C#, Java, ...)
A Scripting Language can be directly executed typically by an interpreter (Python, Lua, Basic, ...)

Game Development / Software Engineering / 2024-2025
Beyond execution

Programming languages

There are many programming/scripting languages beyond C++,
each with their specific syntax, strengths and common use cases

Language Managed/Unmanaged Compiled/Interpreted Typing Common Use Cases
C++ Unmanaged Compiled Strong Game development, systems programming, embedded systems, high-performance application
Python Managed Interpreted Dynamic Scripting, Data science, web development, automation, machine learning
C# Managed Compiled to MSIL, JIT (Just-In-Time) Strong Windows applications, game development (Unity), web applications (ASP.NET)
Java Managed Compiled to Bytecode, JIT Strong Enterprise applications, Android development, large-scale web services
Rust Unmanaged Compiled Strong Systems programming, embedded systems, performance-critical applications
Lua Managed Interpreted Dynamic Game scripting, embedded applications, lightweight scripting
Go Hybrid Compiled Strong Cloud infrastructure, web servers, concurrency-heavy application
... ... ... ... ...
Game Development / Software Engineering / 2024-2025
Beyond execution

Managed or Unmanaged?

Managed Languages:

  • Memory management is handled automatically by a runtime environment (e.g., garbage collection)
    Examples: C#, Java, Python
  • Advantages
    • Easier development since memory is managed for you
    • Lower risk of memory leaks and pointer-related bugs
  • Disadvantages
    • Slower in some cases due to garbage collection overhead
    • Less control over memory usage and performance optimization

Unmanaged Languages:

  • Developers manually manage memory (e.g., using malloc/free in C/C++)
    Examples: C++, Rust
  • Advantages
    • Greater control over memory, which can lead to more optimized and high-performance code
    • No garbage collection overhead, making it ideal for performance-critical applications
  • Disadvantages
    • Higher risk of memory leaks and bugs (e.g., dangling pointers, buffer overflows)
    • More complex and error-prone due to manual memory management

Hybrid

  • Combines automatic memory management with low-level control, allowing for some flexibility between the two approaches
    Examples: Go
Game Development / Software Engineering / 2024-2025
Beyond execution

A title

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • bullet
  • bullet

A centered image :

center

https://baptiste-wicht.com/posts/2017/09/cpp11-performance-tip-when-to-use-std-pow.html

Game Development / Software Engineering / 2024-2025
Beyond execution

Slide with an image

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Game Development / Software Engineering / 2024-2025
Beyond execution

Two column layout and a title that is so long it exceeds the width of the slide

Some code blocks

int main()
{
    int total = 0;
    for(int i = 0; i < 10; ++i)
    {
        total += i;
    }
    return 0;
}
main:
  push rbp
  mov rbp, rsp
  mov DWORD PTR [rbp-4], 0
  mov DWORD PTR [rbp-8], 0
  jmp .L2
.L3:
  mov eax, DWORD PTR [rbp-8]
  add DWORD PTR [rbp-4], eax
  add DWORD PTR [rbp-8], 1
.L2:
  cmp DWORD PTR [rbp-8], 9
  jle .L3
  mov eax, 0
  pop rbp
  ret
Game Development / Software Engineering / 2024-2025
Beyond execution

SVG Test

center

Game Development / Software Engineering / 2024-2025
Beyond execution

Class test

On what objects do we call this Update method?

namespace dae
{
  class Texture2D;
  class GameObject 
  {
    Transform m_transform{};
    std::string m_name{};
    std::shared_ptr<Texture2D> m_texture{};
  public:
    virtual void Update();
    virtual void Render() const;

    void SetTexture(const std::string& filename);
    void SetPosition(float x, float y);

    GameObject() = default;
    virtual ~GameObject();
    GameObject(const GameObject& other) = delete;
    GameObject(GameObject&& other) = delete;
    GameObject& operator=(const GameObject& other) = delete;
    GameObject& operator=(GameObject&& other) = delete;
  };
}
Game Development / Software Engineering / 2024-2025

Some comments, these will be present in the pptx too if you export this.

rpb = framepointer eax = register