DEV Community


Discussion on: Keeping Your Code Simple

pmcgowan profile image

I recently built the most glorious map/reduce/filter bohemoth that transforms one complicated object into another complicated json body, and it was beautiful. It was so cool looking, littered with ternaries and fancy remappings. I was so proud.

I had to fix a bug in it about a week later, and I had to re-read it about 10 times to figure out what could possibly be wrong with it. A perfect example of something someone else said on that you should write code for the next person and not fun, cool-looking code. I've since re-written most of it, but I still feel bad for the next person...