---
layout: post
title: "List of Programming Mistakes"
description: "A list of programming mistakes that I have encountered."
keywords: ""
---

This article is really a list of a programming mistakes that I have encountered or made myself. This article won't really have any structure.

- Unexpected side-effects

    Recently, I came across the following code snippet:

    ```C++
    class HoleDetector {
        private:
            std::vector<int> holeIds;

        public:
            bool isHole(int id) {
                //
            }
    }

    ```

- HashMap that associates key to true value
- Not setting invariants in the constructor
- Use for-each loop instead of classic for loop

---
layout: post
title: "List of Programming Mistakes"
description: "A list of programming mistakes that I have encountered."
keywords: ""
---

This article is really a list of a programming mistakes that I have encountered or made myself. This article won't really have any structure.

- Unexpected side-effects

    Recently, I came across the following code snippet:

    ```C++
    class HoleDetector {
        private:
            std::vector<int> holeIds;

        public:
            bool isHole(int id) {
                //
            }
    }

    ```

- HashMap that associates key to true value
- Not setting invariants in the constructor
- Use for-each loop instead of classic for loop when possible
- Use `std::numeric_limits<double>::lowest()` instead of `DBL_MIN`

Use `numeric_limits` instead of `DBL_MIN`
Use `numeric_limits` instead of `DBL_MIN`
