Skip to content

maex0/nerddeck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NerdDeck

Build Status Build Status Build Status

Welcome to NerdDeck, a project initiated during the first semester of my Master's program at TH Rosenheim in the course Concepts of Programming Languages. In this project, I will be comparing two programming languages, Go and F#, within the context of functional programming.

Project Overview

This repository is dedicated to exploring the paradigms of functional programming in the context of two distinct programming languages: Go and F#.

ScreenshotNerdDeck

Table of Contents

Paper

I wrote a paper for this project, it contains an introduction for functional programming, for Go and F# and also for the coding project NerdDeck. This paper was written in LaTeX and can be found here here.

Getting Started

This section is about how you can execute the code by yourself. Note that NerdDeck is only a command line program!

Go

  • Verify that you have installed everything which is necessary for Go on your system (info can be found here)
  • I used go version go1.21.2 darwin/arm64 on my system
  • If you have Go installed successfully clone the repository: git clone https://github.com/maex0/nerddeck.git
  • Navigate to the project directory: cd nerddeck
  • Navigate to the go project directory: cd go
  • Build the project with go build
  • Execute with ./nerddeck and enjoy NerdDeck

F#

  • Verify that you have installed everything which is necessary F# on your system. I used .NET 7 on my system
  • Clone the repository: git clone https://github.com/maex0/nerddeck.git
  • Navigate to the go project directory: cd fsharp
  • Execute dotnet build and verify there are no build errors
  • Execute dotnet publish -c Release -r osx-x64 --output ./Release ./src/App/App.fsproj and enjoy NerdDeck (I used osx-x64 because I use a mac. For Windows or Linux users look for dotnet publish documentation and different runtimes)
  • Go into the folder with ./Release, execute with ./NerdDeck and enjoy NerdDeck

Database

Disclaimer: For the purpose of this project, a single json file is used as a simple and lightweight database to store flashcards. While this approach is suitable for educational and illustrative purposes, it may not be suitable for production usage due to limitations in scalability and concurrent access.

In a production environment, a more robust database solution should be considered, such as a relational database (e.g., PostgreSQL, MySQL) or a NoSQL database (e.g., MongoDB). The choice of the database will depend on the specific requirements of the application.

Database Schema

The flashcard data is stored in a JSON file with the following structure:

[
  {
    "ID": "37268335dd6931045bdcdf926",
    "Question": "What algebraic data types does F# use?",
    "Answer": "Record types and discriminated unions",
    "Repetitions": 1,
    "EasinessFactor": 1.3,
    "NextReview": "2023-12-18T18:17:22.438077+01:00"
  }
]

Model

In order to meet the requirements, a flashcard model is necessary. It is crucial that users are able to create multiple flashcards and validate that there are no duplicates of the question-answer combination. The ID is generated from the question and answer of the flashcard, serving as a primary key for the model. This model should be used in both languages.

Nerddeck model

Contributing

Contributions are welcome! If you have insights, suggestions, or additional examples to contribute, feel free to contact me.

License

This project is open-source and available under the MIT License. See the License file for more details.

About

Semester work in the module Concepts of Programming Languages @ Technical University of Applied Sciences in Rosenheim

Resources

License

Stars

Watchers

Forks

Packages

No packages published