As an electrical engineer teaching himself to code, I found programming to be a lot more comparable to writing than engineering. Coding is at the same time a logical and creative process, and a lot like juggling how pieces of an essay or story fit together to a chosen goal for your audience. Engineering seems a lot more rigid - you have a set problem and a known best practice solution. In that sense it is more like solving a list of math problems. Yes I know the best math (and engineering) problems require creativity and an intuitive feel, but by and large that kind of work is only available to the top of the field. But, you can code and write whatever you like and ship it at zero cost.