Skip to content

Instantly share code, notes, and snippets.

@vetras
Last active February 4, 2019 12:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vetras/4221dab45185ea943190 to your computer and use it in GitHub Desktop.
Save vetras/4221dab45185ea943190 to your computer and use it in GitHub Desktop.
Programming perls I encountered myself over the years. Epic mistakes to remember. Things I've seen that cannot be unseen.

Wall of shame

Introduction

Throughout life as a software developer you see a lot of gems. Code gems.

Things that are well done, things that are not well done and things that are just plain wrong.

Programming perls I encountered myself over the years. Mainly the bad ones. Epic mistakes to remember. Things I've seen that cannot be unseen.

Epic Ones

  • thread sleeps 10ms to "prevent" concurrency issues

  • our logic code implemented on 3rd party JavaScript files (non-minified js dependencies, such as from npm and such)

  • our logic code implemented on MINIFIED JavaScript files, deployed live, not committed anywhere
    noticed this after we deployed a new version live and it broke.
    then we make a diff with the backup files.
    then we thanked god for inventing backup files

  • add *.orig to git ignore (orig files are internal git files for resolving conflicts)

  • Test URLs hard-coded on payment DLLs
    Found this out after decompiling the DLL from live, while investigating a ticket about missing payments

  • jira ticket FOO-123
    Title: "Implement Everything"
    Description: "none"
    Assignee: "Jesus" (a guy named jesus actually worked there)

  • because someone with permissions to create a new repo took several months to do so, the devs emailed each other with the project zip, and locally merged stuff

"Normal" Ones

  • hard coded configuration, URLs, passwords, user names, etc

  • committed code that does not compile

  • committed code that never gets executed

  • unit test cases that don't compile because someone deleted some classes without re-running the tests

  • unit test cases with api calls, http calls, DB interaction, ...
    you name it! they've got it tested!

  • committed projects with local disk references and those reference files not committed

  • have server side XSLT generating front end HTML (annotated with the CSS and all)

  • have one HTTP redirect file with 8k+ lines

  • .bak files on source control

  • copy-paste source control: where several versions of the file are kept and committed
    example: foo1.a, foo2.a, ... or barDec.a, barOct.a, ...

  • 'relational' DB's WHITHOUT FK
    DB tables with INT type column and no FK constrains for other table's IDs
    but only for some tables, because its more fun this way

  • static all the things
    projects where most classes and methods are static

  • source code files where the IDE tells you:
    "sup, dog! I'm going to turn intellisense off now. kthxbye!"
    (+10K lines on single class)

  • code on DB tables
    html "templates" that code loads and returns to the browser
    binary DLLs, dynamically loaded (a personal favorite)

We will build our own wheels

  • custom encryption algorithm
    because we dont store plain text passwords!

  • custom logging "framework", with File.Open()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment