Giter Club home page Giter Club logo

spaghetti-code-example's Introduction

Getting started

  1. Clone this repo: git clone [email protected]:aprilmintacpineda/spaghetti-code-example.git
  2. cd to the directory: cd spaghetti-code-example
  3. Install dependencies: yarn
  4. Run app: yarn start

Working examples can be found here:

Writing readable codes using ReactJS as an example

In this discussion, I aim to educate the audience about the problem of spaghetti code.

  • We will define what spaghetti code is.
  • Dive into examples of spaghetti codes.
  • Find the root cause of spaghetti code.
  • Propose a solution to avoid spaghetti code.
Inspiration: What drove me to choose to talk about this topic?

A while back, I had a conversation with some developers about spaghetti code, I asked them to give me an example, in codepen, in jsfiddle, or other similar sites, of codes that would be deemed as spaghetti code. One of them responded he can't give any because (and I quote) "calling it spaghetti is more subjective rather than objective". This leads me to believe that a lot of people don't really have a firm understanding of code, they simply write codes and hope that the program works. Not to say that he is wrong, there's a bit of truth to it, but that's a very small slice of a much bigger pie.

So I'm looking to shed some light on this topic especially for people who are just starting out their developer career, I believe it's very important for developers to have a clear understanding of what spaghetti code is, this will increase the general quality of the codes that we write, and also present an example of spaghetti code and the clean version of the same code.

So, let's get started.

What is spaghetti code?

Wikipedia defined the term "spaghetti code" as

"Spaghetti code is a pejorative phrase for unstructured and difficult-to-maintain source code."

It's quite generic but it's the most common thing that you'll hear from people when you ask them what spaghetti code is, and if you ask them for some example codes, they wouldn't really be able to give that.

For us to be able to prevent spaghetti code, we need to understand its nature.

spaghetti-code-example's People

Contributors

aprilmintacpineda avatar

Watchers

 avatar  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.