Skip to content

Instantly share code, notes, and snippets.

@elongeau
elongeau / file.md
Created August 1, 2023 07:47
Embrace Ownership, Avoid References: A Rustic Journey

original article put here for readability

Abstract:

Rust is a powerful and modern systems programming language known for its emphasis on safety and memory management. One of the language's key features is its ownership system, which enables Rust to achieve memory safety without the need for a garbage collector. In this paper, we delve into the concept of ownership in Rust and make a case for its superiority over the use of references. We explore the advantages of ownership, discuss the pitfalls of references, and illustrate our points with code examples to demonstrate the importance of embracing ownership for black box function interfaces. By the end of this paper, readers will gain a deeper understanding of Rust's ownership system and the benefits it brings to software development.

  1. Introduction

{
"basics": {
"name": "Emmanuel LONGEAU",
"label": "Back-end Developer @ SFEIR",
"picture": "",
"email": "[email protected]",
"phone": "",
"website": "",
"summary": "I'm a software developer at heart. I'd love to make that both works and is maintanable (make it work, make it right, make it fast). I'm also looking at the DDD side, because before coding a solution, we must understand the problem that the program should solve.",
"location": {
function closestLocation(targetLocation, locationData) {
function vectorDistance(dx, dy) {
return Math.sqrt(dx * dx + dy * dy);
}
function locationDistance(location1, location2) {
var dx = location1.latitude - location2.latitude,
dy = location1.longitude - location2.longitude;
return vectorDistance(dx, dy);