Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 8113

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 60k
Author
Asked: November 28, 20242024-11-28T10:05:08+00:00 2024-11-28T10:05:08+00:00

How to start actually engineering software, instead of just coding it

  • 60k

Before I learned how to build apps with code, I thought software development would be like building something out of wood… you learn a couple of basic skills, put a shelf together, and then the project is done forever. I honestly thought the hardest part would be learning fancy techniques or complicated algorithms. Boy was I wrong.

What I didn't understand is that software is never actually done… and that the never done-ness is actually the trickiest part of software. Sure, you can hack an app together quickly, but it won't run in a few weeks after the dependencies update. Sure, you can write a whole bunch of code and deploy it, but will you be able to change that code easily?

In many ways, what makes software engineering difficult is actually how easy it is to write code, install some dependencies, and get something running; This leads to implementing short-term solutions and bad practices that bite back hard later on.

As my apps started to get out of date and out of control, I quickly found out that software engineering is not just the creation of software, it's also the improvement and maintenance of it. As it turns out, improving and maintaining code is extremely hard because of compounding complexity as the codebase grows, and technical debt that accrues overtime. So, how can we start actually engineering software, rather than just continuing to commit more and more code until we end up with a tangled mess?

Learn from my mistakes

To avoid disaster, you need to dedicate time to the quality of your codebase. To help get you started, I'll give some examples of ways to improve your code as you are writing it. Some of these are written in pseudo code (vaguely ruby-ish so I refer to methods instead of functions) but many languages have similar concepts so the underlying principles will translate:

1. Extract a method to reuse

DRY (Do not repeat yourself) is a well-known principle of software engineering. If you create methods that encapsulate a certain behavior, then you can reuse the method and will not have to change the code in multiple places if you need to update it later on. This technique also cuts way back on the amount of code in your codebase, making it easier to keep a handle on. If you find yourself writing the same code again, pull it out into a reusable method.

2. Change comments into descriptive code

It's so easy to update some code and forget to update the associated comment. This leaves outdated comments in our codebase that can confuse or lie to us later. Instead of writing comments that detail what a method does, make a small method and write the comment as the method name. For example… instead of writing:

# This creates or updates a subscription

I could name the method create_or_update_subscription.

3. KISS (Keep it simple…)

Sometimes when we are trying to get something working we write really long lines of code like:

if user.confirmed && user.subscribed && user.profile.complete || user.team.no_profiles_allowed?

A lot going on here! Now I have to keep track of all of these conditionals, and if I ever change this code I will have to review what each on is checking to make sure I don't mess up the implementation. Instead I could pull some of these out to smaller, more descriptive methods… perhaps pull the first part into a method called user_onboarding_complete? Then the code would read:

if user_onboarding_complete?

This is much less confusing. Now if I need to know more about the implementation details of these methods I can go look at them, but I can instantly see the higher level purpose of the code quickly.

Want more ideas for how to keep a codebase that is easily improvable and maintainable over time?

These 3 small improvements techniques will yield huge gains as your app gets larger and your code multiplies, but if you want more ideas, you can join the free 30-Day code quality challenge to get one daily maintenance or improvement challenge for you to tackle a day. It is programming language agnostic and open to anyone.
I signed up for a previous cohort and found it very useful. (Full disclosure I am running the next cohort that starts May 3rd)

Photo by Oskar Yildiz on Unsplash

codenewbiecodequalitywebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 1k
  • Popular
  • Answers
  • Author

    How to ensure that all the routes on my Symfony ...

    • 0 Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.