Solved

How long should variable names be?

TomBeckerOP

In stage 3, is fuel_remaining_after_burn_kg too long?

8

Comments 4

Log in to join the discussion.

Log in Create account
  1. CharlieH Solutionreplies: 2

    Long is fine if it's clear, but there's a balance. fuel_left_kg says the same thing in fewer characters. Good test: can someone guess what it holds without reading the rest of the code?

    6
    1. TomBeckerOPreplies: 1

      fuel_left_kg it is. Units in the name are useful though, right?

      0
      1. CharlieH

        Very. Mixing kg and tonnes is how real missions get into trouble.

        5
    2. NoahLoops

      The task says no one- or two-letter names, so anything readable passes. Readability is the real goal.

      6