DEV Community

Rickard Engberg
Rickard Engberg

Posted on

An odd post about, well... I really don't know

So I'm at a fun place in my professional life. At the tender age of 52, I've started looking for what I want to do when I grow up. Making a career isn't as important as it was when I was 20 or 30. The kids have moved out, and living expenses are suddenly far less than my income. I never thought I'd say that.

I write code for a living using my preferred programming language, it's summer, and there's ice-cream just across the street from where I work. Without the hassle and stress of career goals and deadlines, I'm pondering my options and opportunities.

One thing I'm doing is reading and blogging about clean coding. Well, I read about a lot of stuff, but concerning tech and computers, it's mostly about clean coding. That's an exciting field in programming, and I'm trying to learn all I can by, oddly, teaching it to other people. Or perhaps that's not so odd after all; teaching is about talking about stuff, discussing stuff and generally thinking about stuff. And I think a lot about clean coding.

One cool thing about clean coding, I think, is that it's about writing clean code (duh), and to me, clean code is beautiful code. I've always been more interested in the code itself than in the functions of whatever program I'm currently working on. That's probably why my hobby projects never get finished. My oldest one is going on close to 30 years and surely 20 editions (I say editions because I usually start over rather than continue on the previous version when I get into the mood to work on it).

So, beautiful code, what is that anyway? I don't know, but I think it's like the feeling a painter or a musician gets when the current piece of art is finished. I bet they can't really say why that piece is suddenly done. It just feels done, feels right, somehow. When I get that feeling, I know the code is done. The program might not be, it seldom is, but the code is done and I usually don't touch that code again. I just let it sit in a repo on Gitlab waiting for better times.

Sometimes, before I do the final commit (which I don't really know is the final commit at the time) I show my code to my wife. She understands none of it, but she likes the indentation. She likes the waves of the program structure, and I agree, getting that waving indentation line is really satisfying. As is getting all the statements, variables, class names, method names etc correctly camel-cased, white-spaced and, you know, just exactly right.

I have never printed and framed a piece of code, but thinking about it I'm sure one could do a really nice painting from a piece of nicely indented and well-written code. When I talk on the subject of clean coding, I like to say that a well-written program is like prose. (It's not my saying, I picked it up from the book Clean Code. I just like to say it). So how would a painter paint a piece of prose? I have absolutely no idea (just as I have no idea where this post is going).

I wonder what programming language is the best for that kind of programming art. My preferred language is Pascal, and Pascal makes for a really nice visual experience. More so than C# in my humble opinion. c++ is just messy to me, Java too but perhaps less so than c++. HTML and CSS (if those can be called programming languages) are very hard to format nicely, I think. Assembler has a nice line to it, those vertical columns appeal to a sense of order. SQL and its various dialects and procedural languages don't go well at all with the artfulness of programming, even though stored procedures can be rather cleanly written (except for MS SQL Server procedures, since MS choose a very odd way of doing if-begin-end).

I started rambling about growing up and going over what I've just written, it seems I have some ways still to go before I find out what I want to do when I grow up. But there seems, at least, to be options and opportunity. Hopefully, there are for you, dear reader, as well. Options and opportunity, that is, of whatever is in your future.

But whatever you do and whatever happens, always write beautiful code!

Top comments (3)

sandeepbalachandran profile image
Sandeep Balachandran

Yeah , About that , The last line.I never had a mentor or a teacher. I learn and write code from internet. I am in my early 20s and a beginner having 1 and half year exp. Even today at work I was rushing to submit the code before EOD. I just spit codes here and there to get the job done. I wanna learn to write clean code. Tech is changing every day. So writing clean code is essential or i dont even stand a chance sooner. Sometimes i write code in php , sometimes in js for angular . I wanna standardize it. As a pioneer let me know your standards.

rickardengberg profile image
Rickard Engberg

That's a really interesting question!

I remember the beginning of my career, it was very much as you describe it. A constant struggle to meet deadlines and deliver code. Pulling 80+ hour weeks was more rule than exception. In my opinion, if that is a constant situation, there is something wrong with the company. I defended complying with it by telling myself, that was who I was; a hard worker, who took pride in pulling those billable hours in. The company loved me. My friends and family, not so much.

Clean coding is not a fast track, however. Code quality and quality assurance are big parts of coding cleaner, and quality needs to be worked at every single moment you sit down and write program code. Tests, trying out solutions, refactoring your solution, getting your code reviewed, fixing the review comments etc. All that takes time, but the time you spend doing it the right way in the first place, you save doubly in maintaining the code in the future. Your company should thank you for being thorough and quality oriented. I'd bet that a lot of the time when you're struggling to make your deadlines, it's actually bugs introduced on previous deadline struggles you're fixing.

My recommendation is to continue reading blogs on the topic (I will certainly address your reply specifically in coming posts, as it is very much in line with what I am trying to communicate). I'll post here and on my blog

Also, I recommend reading the Clean Code series by Robert C. Martin. In Clean Code, you get advice on how to do clean coding (technically), in The Clean Coder he talks about how the professional programmer behaves. That one is my favourite, because of how helpful it was to me. Being a professional programmer is about responsibility, always focus on quality, and, perhaps most importantly, be very clear in communicating with stakeholders, clients, managers, colleagues etc. And to learn how to say no (without getting fired).

Also, you're welcome emailing me with specific questions, if you'd like.

sandeepbalachandran profile image
Sandeep Balachandran

I mean ofcourse its not a giant company.Maybe you are right. There might be something wrong.
I would definetly check out those references you mentioned.
Its so nice to contact you regarding this matter as well.