Coder Social home page Coder Social logo

aloneking789 / fork-commit-merge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fork-commit-merge/fork-commit-merge

0.0 0.0 0.0 14.45 MB

Fork, Commit, Merge. A project designed to help you familiarize yourself with the open source contribution workflow on GitHub!

Home Page: https://forkcommitmerge.io

License: MIT License

Shell 0.75% JavaScript 51.31% Ruby 1.11% C++ 0.82% Python 0.65% Perl 1.12% C 1.13% PHP 0.96% Java 1.23% Common Lisp 0.67% Lua 1.88% Haskell 1.01% Scala 2.33% Clojure 4.96% Go 0.65% Rust 1.14% Elixir 8.61% Kotlin 0.79% Dart 1.11% TypeScript 17.77%

fork-commit-merge's Introduction

Fork, Commit, Merge Version 1.1.3 LICENSE Issues PR:s Welcome Contributors Welcome First Contributors GitHub repo size


Welcome to "Fork, Commit, Merge"!
A project designed to help you familiarize yourself with the open source contribution workflow on GitHub, as well as to help you learn the basics of programming in different languages.

More info about this project, contributing and open source resources, are available on our website at
forkcommitmerge.io

HTML5 CSS3 Tailwind CSS Bootstrap JavaScript TypeScript React Next JS Vite Vue NodeJS NPM Yarn Jest C C++ Java Kotlin Scala Python Ruby Elixir PHP Go Dart Swift Rust Haskell Lua Clojure Lisp SQL TLA+ Bash Perl JSON YAML XML Markdown

Find awesome badges for your project in this repository: markdown-badges

Table of Contents

Prerequisites

Before you start, you'll need to install Git.

Also:

  • For JavaScript, TypeScript, React, NextJS, Vue or TailwindCSS related issues, you need to install Node.js and npm.
  • For C related issues, you need to install C.
  • For C++ related issues, you need to install C++.
  • For Java related issues, you need to install Java.
  • For Kotlin related issues, you need to install Kotlin and Java.
  • For Scala related issues, you need to install Scala.
  • For Python related issues, you need to install Python.
  • For Ruby related issues, you need to install Ruby.
  • For Elixir related issues, you need to install Elixir.
  • For PHP related issues, you need to install PHP.
  • For Go related issues, you need to install Golang.
  • For Dart related issues, you need to install Dart.
  • For Swift related issues, you need to install Swift.
  • For Rust related issues, you need to install Rust.
  • For Haskell related issues, you need to install Haskell.
  • For Lua related issues, you need to install Lua.
  • For Clojure related issues, you need to install Clojure.
  • For Lisp related issues, you need to install Lisp.
  • For SQL related issues, you need to install sqlite3.
  • For TLA+ related issues, you need to install TLA+ Toolbox.
  • For Bash related issues, you need to install Bash.
  • For Perl related issues, you need to install Perl.
  • For HTML, CSS, Bootstrap, JSON, YAML, XML or Markdown related issues, you don't need to install anything else.

Installing Git

Git is a version control system that lets you manage and keep track of your source code history.

  • For Linux users, you can install Git via your distribution's package manager. For example, on Arch you would use the command: sudo pacman -S git and in Ubuntu/Debian: sudo apt-get install git
  • For macOS users, you can install Git via Homebrew with the command: brew install git
  • For Windows users, download Git from Git for Windows and follow the installation instructions.

Installing Node.js and npm

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine, and npm is a package manager for Node.js.

  • You can download Node.js and npm from the official Node.js website. This will install both Node.js and npm on your machine. Follow the instructions on the website to install them.

Installing C

Setup the C environment in VS Code:

  • Install the C/C++ extension for VS Code.

Set up a compiler:

  • Windows: Install MinGW.
  • macOS: Ensure you have the Xcode Command Line Tools installed (xcode-select --install).
  • Linux: Most distributions come with gcc installed, but if not, you can typically install it using your package manager (e.g., sudo apt install gcc for Debian-based distributions).

Installing C++

If you are using VS Code, you can install the C++ extension: Launch VS Code, head to Extensions (or press Ctrl+Shift+X), and search for C++. Install the one by Microsoft called C/C++.

Install a C++ Compiler:

  • Windows: Install Mingw-w64 or TDM-GCC. After installation, make sure the compiler's bin directory is in your system's PATH.
  • Linux: You can usually install the GCC compiler with your distribution's package manager. For example, on Ubuntu/Debian, you'd run sudo apt-get install g++.
  • Mac: Install Xcode from the App Store. Once Xcode is installed, you'll also have the compiler.

Installing Java

Install Java Development Kit (JDK):

Before working with Java in VS Code, you must have the Java Development Kit (JDK) installed on your machine.

Install Java Extensions for VS Code:

  • Open VS Code, go to the Extensions view by clicking on the square icon on the sidebar or pressing Ctrl+Shift+X. Search for "Java Extension Pack" by Microsoft and install it. This pack includes essential Java extensions like Language Support, Debugging, Testing, and more.

Configure Java in VS Code:

  • VS Code should automatically detect the JDK you installed. If not, you can set the java.home setting in VS Code to point to your JDK location.

Installing Kotlin

  • macOS: brew install kotlin
  • Linux:
    • Arch: sudo pacman -S kotlin
    • Ubuntu/Debian: sudo snap install --classic kotlin
  • Windows: Download Kotlin Compiler and add it to the PATH.

Install Kotlin Language Extension:

For VS Code you can install the Kotlin Language Extension like this:

  • Go to Extensions (you can use the shortcut Ctrl+Shift+X).
  • Search for "Kotlin" and install the "Kotlin Language" extension by FWCD.

Install Java Development Kit (JDK):


Installing Scala

macOS:

brew install scala sbt

Linux:

Ubuntu/Debian:

sudo apt-get install scala sbt

Windows:

You can download and install from the official websites: Scala & SBT.

Install the Scala Language Extension for VS Code:

  • Open VS Code.
  • Navigate to Extensions (shortcut: Ctrl+Shift+X).
  • Search for "Scala" and install the "Scala (Metals)" extension, which is the official Scala language server.

Installing Python

Windows:

  • Visit the official Python website's download page.
  • Click on the latest Python release.
  • Scroll down to the Files section and download the Windows x86-64 executable installer for 64-bit version of Windows.
  • Run the installer file and follow the instructions, making sure to tick the box that says "Add Python to PATH" before clicking Install Now.

Mac OS:

Mac OS X should come pre-installed with Python, but in case it's not installed, here's how to install it:

  • Visit the official Python website's download page.
  • Click on the latest Python release.
  • Download the macOS 64-bit installer.
  • Open the downloaded .pkg file and follow the instructions to install Python.

Linux:

Most Linux distributions come with Python pre-installed. To check if you have Python installed, open a terminal and type python3 --version.

If you need to install or upgrade Python, you can do so with the package manager for your Linux distribution. For Ubuntu, you can use the following commands:

sudo apt update
sudo apt install python3

Installing Ruby

Windows:

Download the RubyInstaller for Windows from the official website. Run the installer package and follow the on-screen instructions.

Mac OS:

Ruby comes pre-installed on Mac OS X, but if you need to upgrade or install a different version, you can use Homebrew or RVM (Ruby Version Manager).

With Homebrew:

Open terminal and type brew install ruby

With RVM:

Open Terminal and type \curl -sSL https://get.rvm.io | bash -s stable Then install Ruby with rvm install ruby

Linux:

Ubuntu/Debian:

Open Terminal and type sudo apt-get install ruby-full

Arch Linux:

Open Terminal and type sudo pacman -S ruby

For other Linux distributions, the command may be different. Refer to the documentation specific to your package manager.


Installing Elixir

Install the ElixirLS extension for VS Code: Launch VS Code, head to Extensions (or press Ctrl+Shift+X), and search for ElixirLS. This extension provides Elixir language support and debugger.

Install Elixir:

  • Windows: The easiest way to install Elixir on Windows is by using Windows Subsystem for Linux (WSL).
  • Linux: You can typically install Elixir through your distribution's package manager. For example, on Ubuntu/Debian:
sudo apt-get install elixir
  • Mac: You can use Homebrew:
brew install elixir

Installing PHP

Windows:

  • Download the PHP ZIP package from https://windows.php.net/download.
  • Extract the ZIP file and rename the extracted directory to php.
  • Move the php directory to C:.
  • Add C:\php to your system's PATH environment variable.

Mac OS:

PHP comes pre-installed on Mac OS X. To upgrade or install a different version, consider using Homebrew:

  • Open Terminal and type brew install php.

Linux (Ubuntu/Debian):

  • Open Terminal and type sudo apt install php.

Installing Golang

For macOS and Linux, you can use the terminal to install Go:

  • On macOS, if you have Homebrew installed, type: brew install go.
  • On Linux, the command will depend on your distro's package manager. For example, on Ubuntu or Debian, you would type: sudo apt-get install golang.
  • On Windows, go to the official Go downloads page, and download the binary release suitable. Use the MSI installer and follow the prompts to install the Go tools. It is recommended to leave the default settings for when asked about installation directory or PATH variables.

To check your installation, open a terminal and type: go version. This should return the installed version of Go.


Installing Dart

For macOS and Linux, you can use the terminal to install Dart:

  • On macOS, if you have Homebrew installed, type: brew install dart.
  • On Linux, the command will depend on your distro's package manager. For example, on Ubuntu or Debian, you would type: sudo apt-get install dart.

For Windows, go to the official Dart SDK Install page, and download the SDK suitable for your system. Use the Dart installer and follow the prompts to install the Dart SDK. It is recommended to leave the default settings for when asked about installation directory or PATH variables.

To check your installation, open a terminal and type: dart --version. This should return the installed version of Dart.


Installing Swift

Install Swift:

  • For macOS: Swift comes pre-installed. If not, you can download it from the Swift website.
  • For Linux: Follow the instructions on the Swift website for Linux installations.

VS Code Setup:

  • Search for the "Swift" extension by Swift Server Work Group and install it. This extension provides support for Swift language, including features like autocomplete, linting, and debugging.

Additional Resources:

Swift.org - Getting Started


Installing Rust

Windows:

  • Go to rust-lang.org to download the "rustup-init.exe" installer.
  • Run the installer and follow the on-screen instructions.
  • Once installation is complete, open a new Command Prompt and verify with rustc --version.

Mac and Linux:

  • Open a terminal.
  • Run the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Follow the on-screen instructions.
  • Restart your terminal (or source the changes as instructed at the end of the installation) to ensure the cargo and rustc commands are available.
  • You can verify the installation with rustc --version.

Installing Haskell

Install Haskell Platform:

The Haskell Platform provides everything needed to get started with Haskell.

  • Windows: You can download the Haskell Platform from Haskell's official website.
  • Mac/Linux: You can install GHCup for Haskell by running curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh in your Terminal and following the instructions.

Install Haskell Extensions for VS Code:

  • Open VS Code, go to the Extensions view by clicking on the square icon on the sidebar or pressing Ctrl+Shift+X. Search for "Haskell Syntax Highlighting" and install it. Also, consider installing "Haskell Language Server" for enhanced features such as type information, autocompletion, and more.

Installing Lua

  • macOS: brew install lua
  • Ubuntu/Debian: sudo apt-get install lua5.3
  • Arch Linux: sudo pacman -S lua
  • Windows: Download and install from the official website: Lua.org

Installing Clojure

On macOS:

brew install clojure/tools/clojure

On Linux (using curl):

curl -O https://download.clojure.org/install/linux-install-1.10.3.967.sh
chmod +x linux-install-1.10.3.967.sh
sudo ./linux-install-1.10.3.967.sh

On Arch Linux:

sudo pacman -S clojure

On Windows:

Setting up Calva for VS Code:

  • Install the Calva extension from the VS Code marketplace. Calva is a rich integrated development environment for Clojure, providing an interactive REPL, linting, and more.

Install Leiningen, a popular Clojure build tool:

On macOS:

brew install leiningen

On Arch Linux:

sudo pacman -S leiningen

Installing Lisp

Install SBCL (Steel Bank Common Lisp):

Depending on your OS, you can follow the instructions on the Official SBCL website to install SBCL.

Install the Lisp Extension for VS Code:

  • Open Visual Studio Code.
  • Go to Extensions.
  • Search for Lisp and install any Lisp extension you like. Usually the one that has the most downloads is the most safest.

Set Up Your Lisp Environment (Windows):

After installing the extension, you may need to set up your Lisp environment by pointing it to your SBCL installation. You need to adjust the configuration (settings.json) and set the lisp.sbcl.path to the path where SBCL is installed.


Installing sqlite3

macOS and Linux:

SQLite comes pre-installed on macOS and most Linux distributions. To verify if sqlite3 is installed, you can open a terminal and type:

sqlite3 --version

If SQLite is installed, this will output the version number.

Windows:

To install SQLite on Windows:

  • Visit the SQLite download page.
  • In the "Precompiled Binaries for Windows" section, download the sqlite-tools-win32-x86-xxxxxx.zip file.
  • Unzip the downloaded file. It will create a directory named sqlite-tools-win32-x86-xxxxxx.
  • Move the directory to C:\ (or another location if you prefer) and rename it to sqlite.
  • Add C:\sqlite to your PATH environment variable.

To check whether SQLite has been installed successfully, open Terminal window and run:

sqlite3 --version

This should output the version number if SQLite is installed correctly.

Note that the terminal in Visual Studio Code (VS Code) uses your system's PATH, so once you've added SQLite to your PATH as described above, you'll be able to use SQLite in the VS Code terminal.


Installing TLA+ Toolbox

The TLA Toolbox is an IDE (integrated development environment) for the TLA+ tools.

Install the TLA+ Toolbox: This is the standard IDE for TLA+. You can download it from here.

Install the TLA+ extension for Visual Studio Code from the VS Code marketplace.


Installing Bash

Ensure you have a UNIX-like environment. If you're on Linux or MacOS, you're already set. Windows users might want to look into WSL (Windows Subsystem for Linux) or use Git Bash, which you should already have in your machine if you have installed Git.


Installing Perl

  • Windows: Use Strawberry Perl. Download the installer and follow the on-screen instructions.
  • macOS: Perl comes pre-installed. You can check its version by typing perl -v in your terminal.
  • Linux: Depending on your distribution, you can use your package manager. For example, on Debian-based systems, you can use sudo apt-get install perl and in Arch Linux sudo pacman -S perl.

Setting up VS Code for Perl:

  • Search for the extension "Perl" in VS Code's extensions marketplace and install it for syntax highlighting and basic debugging support.

Setup Instructions

  1. Fork this repository by clicking on the "Fork" button at the top-right corner of this page. This creates a copy of the repository in your GitHub account.
  2. Clone your forked repository to your local machine with the command:
git clone https://github.com/<your-username>/fork-commit-merge.git

Replace 'your-username' with your GitHub username.

  1. Navigate to your project folder and install the necessary dependencies. If you are solving other than JavaScript or TypeScript issues, you don't need to run npm i.
cd fork-commit-merge
npm i
  1. Create a new branch with the command:
git switch -c fix-issue

Tasks

We present several tasks for different languages, libraries and frameworks with varying difficulty. Firstly, open the tasks directory and select which language you want to work with by opening one of the following directories:

  • HTML
  • CSS
  • Tailwind CSS
  • Bootstrap CSS
  • JavaScript
  • TypeScript
  • React
  • NextJS
  • Vue
  • C
  • C++
  • Java
  • Kotlin
  • Scala
  • Python
  • Ruby
  • Elixir
  • PHP
  • Go
  • Dart
  • Swift
  • Rust
  • Haskell
  • Lua
  • Clojure
  • Lisp
  • SQL
  • TLA+
  • Bash
  • Perl
  • JSON
  • YAML
  • XML
  • Markdown

Then you can open one of these directories to choose between three difficulties:

  • Easy
  • Medium
  • Hard

After that you are ready to get solving!

Go to the task you selected to get more info about the issue by clicking one of the following:

HTML - Easy

HTML - Medium

CSS - Easy

CSS - Medium

Tailwind CSS - Easy

Bootstrap CSS - Easy

JavaScript - Medium

JavaScript - Hard

TypeScript - Easy

TypeScript - Medium

React - Easy

NextJS - Easy

Vue - Medium

C - Easy

C++ - Easy

Java - Easy

Kotlin - Easy

Scala - Easy

Python - Easy

Ruby - Easy

Elixir - Easy

PHP - Easy

Go - Easy

Dart - Easy

Swift - Easy

Rust - Medium

Haskell - Easy

Lua - Easy

Clojure - Easy

Lisp - Easy

SQL - Easy

TLA+ - Easy

Bash - Easy

Perl - Easy

JSON - Easy

YAML - Easy

XML - Easy

Markdown - Easy

Markdown - Medium

Markdown - Hard

Note: You don't have to ask a permission to start solving the issue or get assigned, since these issues are supposed to always be open for new contributors. You can just simply start working with the issue right away! Remember that in real world issues you would usually need to ask permission to get assigned to certain issue to prevent multiple people to working on the same issue at the same time, which would result some contributors wasting their time.


Submitting Your Changes

Once you've made the necessary changes and all the tests are passing, you're ready to submit your changes!

  1. Stage your changes with the command:
git add files-that-you-changed
  1. Commit your changes with the command:
git commit -m "Fixed issue"
  1. Push your changes to your forked repository with the command:
git push origin fix-issue

Once you've pushed your changes to GitHub, you're ready to create a pull request. Go to your forked repository on GitHub.

  • You should see text "fork-commit-merge had recent pushes" and button "Compare & Pull request" next to it.

  • Click the "Compare & Pull request" button to proceed to the pull request page of the original fork-commit-merge repository.

  • Fill in the title and description boxes to inform what you did to make all of the tests pass successfully.

  • Finally, click "Create pull request" to finish creating the pull request.

Congratulations on making your first open source contribution on GitHub!

Sit back and wait for a response and feedback of the pull request. If everything is working fine, you should get the pull request merged.

After the merge, actions-user bot will reset the files for the next contributor.

All the contributors of this project will also be added to the List of Contributors in our website!


Best Practices

Programming languages, despite their diverse syntax and underlying paradigms, universally emphasize the importance of adhering to best practices. These practices evolve over time, influenced by shared challenges faced by developers, innovations in the field, and the inherent features and limitations of the languages themselves. This section serves as a compass, guiding you through the idiomatic ways of coding in various languages, ensuring not only that your code works but also that it aligns with the conventions and norms of the community.

Why Follow Best Practices?

  • Readability: Code is read more often than it's written. Adopting best practices ensures your code remains accessible and comprehensible to other developers, or even to your future self!

  • Maintainability: Idiomatic code, by adhering to established patterns and standards, is easier to update, debug, and expand upon.

  • Performance: Often, best practices evolve in response to the understanding of a language's performance characteristics. Writing idiomatic code might also mean squeezing the best performance out of your programs.

  • Community Support: If you're writing code in the way that the broader community expects, you're more likely to receive help when you run into issues. Moreover, you can benefit from tools, linters, and extensions built with these practices in mind.

  • Reducing Errors: Many best practices are born from the lessons of countless debugged issues. By adhering to them, youโ€™re sidestepping many pitfalls before they even occur.

In this section, you'll find guides tailored to various languages. Whether you're dabbling in a new language or revisiting a familiar one, these insights will help ensure your code is elegant, efficient, and effective.


JavaScript Best Practices and Coding Style Guide

  • Variable Declaration:

    • Use let for block-scoped variables. Avoid var.
    • Use const for values that won't change.
  • Functions:

    • Prefer arrow functions for short, non-method functions.
    • Use default parameters instead of manually checking and setting a default inside the function.
  • Objects and Arrays:

    • Use object destructuring to extract properties from objects.
    • Use array destructuring to extract items from arrays.
    • Use the spread operator (...) to clone or merge arrays and objects.
  • Promises and Asynchronous Code:

    • Always handle promise rejections. Use .catch() or async/await with try-catch blocks.
    • Use async/await for more readable asynchronous code, especially when there are multiple steps involved.
  • Loops:

    • Prefer Array methods like map, filter, and reduce over traditional for loops.
  • Type Checking:

    • Use typeof and instanceof wisely. Remember, typeof null is "object".
    • Use triple equals (===) over double equals (==) to avoid unexpected type coercion.
  • Modules:

    • Use ES6 modules (import/export) over older module systems.
  • Linters:

    • Use tools like ESLint to catch potential problems and enforce style consistency.

The Modern JavaScript Tutorial

MDN - JavaScript Documentation


TypeScript Best Practices and Coding Style Guide

  • Strong Typing:

    • Always prefer to provide specific types over using the any type.
    • Use interfaces for defining the shape of objects.
  • Type Inference:

    • Allow TypeScript to infer types whenever possible. For instance, prefer const foo = "bar" over const foo: string = "bar".
  • Enums:

    • Use string enums for better debugging and readability.
  • Generics:

    • Use generics to create reusable components and utility functions, ensuring type safety without sacrificing flexibility.
  • Type Guards:

    • Use type guards to narrow down types in a specific scope, especially when dealing with union types.
  • Type Aliases:

    • Use type aliases to create your own custom types, especially for complex types used in multiple places.
  • Access Modifiers:

    • Explicitly mark properties and methods with public, private, or protected to indicate their intended accessibility.
  • Linter and Config:

    • Use TSLint or ESLint with TypeScript support. Ensure you have a good tsconfig.json.
  • Always Use strict Mode:

    • Enable strict mode in your tsconfig.json for stricter type-checking.
  • Type Definitions:

    • When using third-party libraries, ensure you have the appropriate type definitions installed, often available as @types/package-name.

TypeScript - Official Documentation

You might also want to check out:


Ruby Best Practices and Coding Style Guide

  • Indentation and Whitespace:

    • Use two spaces per indentation level, no tabs.
    • Avoid trailing whitespace.
    • Use spaces around operators, after commas, colons, and semicolons.
  • Naming:

    • Use snake_case for methods and variables.
    • Use CamelCase for classes and modules.
    • Use SCREAMING_SNAKE_CASE for constants.
    • Use a trailing underscore for unused block parameters or variables (e.g., do |used_var, _|).
  • Methods:

    • Prefer methods with clear names over using comments.
    • Use def with parentheses when there are parameters.
    • Avoid methods longer than 10 LOC (Lines of Code).
  • Strings:

    • Prefer string interpolation over string concatenation.
    • Use single-quoted strings unless you need double quotes for interpolation or special characters.
    • Avoid using String#+ when modifying a string. Instead, use String#<<.
  • Blocks:

    • Use {...} for single-line blocks. Use do..end for multi-line blocks.
    • Prefer &:method_name for simple block operations (array.map(&:method_name)).
  • Hashes:

    • Use the Ruby 1.9 hash literal syntax when your hash keys are symbols: { key: value } instead of {:key => value}.
    • Prefer symbols over strings as hash keys.
  • Arrays:

    • Use %w or %W for arrays of words without spaces. Like %w(apple orange grape).
    • For array literals, use square brackets. For example: array = [1, 2, 3].
  • Control Flow:

    • Use && and || for logical expressions.
    • Use unless instead of if !.
    • Avoid multi-line ?: (the ternary operator); use if/unless instead.
  • Error Handling:

    • Prefer exceptions from the standard library over introducing new exception classes.
    • Always specify which exceptions you're catching.
  • Comments:

    • Write self-explanatory code and only comment when necessary.
    • Start comments with a space and use consistent capitalization.
  • Gems and Dependencies:

    • Be judicious about adding new gems; each addition increases your technical debt.
    • Use the latest stable version of Ruby and libraries.
  • Testing:

    • Aim for thorough test coverage, but don't be dogmatic about it.
    • Use factories and not fixtures.
  • Performance:

    • Write clear and readable code first, then optimize.
    • Use the built-in Ruby methods and libraries for common operations.
  • Linting and Formatting:

    • Use tools like RuboCop to enforce style and linting rules. Configure it according to your team's preferences.

Official Ruby documentation:

Ruby Programming Language - Official Documentation

Additional Resources:

Remember, the most important thing is to keep your code readable and maintainable. The community's best practices are a guide, but always prioritize what makes sense for your team and project.


Rust Best Practices and Coding Style Guide

  • Ownership and Borrowing:

    • Always try to use references (&) when you don't need to take ownership of a value.
    • Be explicit with lifetimes where required, but rely on Rust's lifetime elision rules whenever possible to keep code concise.
  • Immutability:

    • Prefer immutability by default. Use let to create immutable bindings and let mut only when you need to mutate the value.
  • Error Handling:

    • Use the Result type for functions that can fail. Avoid using unwrap() and expect() unless you're absolutely certain the Result is Ok or the Option is Some.
    • Prefer the ? operator for propagating errors in most situations.
  • Use of Enums:

    • Use enums to represent data that can be one of several variants. This is much more idiomatic in Rust than, for instance, class hierarchies in object-oriented languages.
  • Match Statement:

    • Use match statements for pattern matching. It's exhaustive, ensuring every possible case is handled.
  • Clippy:

    • Use clippy, the Rust linting tool. It provides a lot of suggestions and idiomatic ways to write Rust code. You can use it with cargo clippy.
  • Formatting:

    • Run cargo fmt before committing to ensure your code conforms to the Rust community coding standards.
  • Use of Crates:

    • Don't reinvent the wheel. If there's a well-maintained crate (Rust's term for libraries) that does what you need, consider using it. But also be wary of adding too many dependencies.
  • Documentation:

    • Document public APIs with triple-slash /// comments. Use markdown inside these comments.
  • Concurrency:

    • Make use of Rust's powerful concurrency guarantees. The borrow checker will help you a lot here. When shared state is needed, prefer using types like Mutex or RwLock from the standard library.

    • Tests:

      • Write unit tests using Rust's built-in testing framework. Put tests in a mod tests block within your source files and use the #[test] attribute for test functions.
    • Avoiding unsafe:

      • Rust offers the unsafe keyword to bypass the borrow checker. While it's there for valid use-cases, use it sparingly and always document the exact reason and ensure that the surrounding code truly upholds the safety guarantees.
    • Performance:

      • Rust allows for great performance, but always remember: write clear and readable code first, then optimize. With Rust, it's often the case that more idiomatic code is also faster, thanks to compiler optimizations.
    • Keep Cargo.toml Clean:

      • Regularly check your dependencies and remove any that you aren't using. This reduces compile time, binary size, and potential security risks.

Official Rust documentation:

Rust Programming Language - Official Documentation

You might also want to check out these sites:

  • The Rust Programming Language Book: This is affectionately known as "The Book" in the Rust community and serves as the main resource for many learners.

  • Rust by Example: This provides a series of exercises and examples to help grasp Rust concepts.

  • Rust API Documentation: Comprehensive documentation for Rust's standard library.

  • Rust Playground: An online environment where Rust code can be written and executed, which is useful for testing out small bits of Rust code.


Influences

This project was inspired by a number of fantastic resources designed to help newcomers make their first contributions to open source. In particular, we would like to acknowledge:

I highly recommend checking out these projects if you want to learn more about contributing to open source!

What's Next?

Congratulations on making your first open source contribution! If you're looking for more ways to contribute, I invite you to check out my other projects. Just click here to find more. These projects contain real issues that you can help resolve. Also i would really appreciate if you could leave a star, so more developers can find this project. I look forward to seeing your contributions!

Creating New Tasks

Feel free to contribute to this project also by creating new tasks for other contributors to tackle. To do so, please submit a pull request containing detailed information about the task, including relevant code examples. We encourage you to propose tasks across the programming languages already represented in our project, as this helps broaden its versatility and accessibility for developers worldwide.

Contact

For any queries, feel free to open an issue or reach out to me at [email protected].

License

This project is licensed under the terms of the MIT License.

List of Contributors

Massive thanks to all of the these fine individuals who contributed to this project!

fork-commit-merge's People

Contributors

nikohoffren avatar actions-user avatar aneal07 avatar vasfvitor avatar krushnarout avatar michaelmuthomi avatar r-cmd001 avatar sindhunaydu avatar davidthecode avatar nkiriobasi avatar codinglady22 avatar kshitijtodkar48 avatar nitin-pandita avatar dependabot[bot] avatar aishagojo avatar wasiuddinmansoori1 avatar sakibian avatar rajdeep1311 avatar layak-ali avatar khanak21 avatar ht-l1 avatar blindka avatar chemin7 avatar muhaddisrehman avatar omanshu209 avatar sree-hari-s avatar llr3v0ll avatar subhadeepbanerjee2003 avatar vidhanvyrs avatar vinayyak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.