Bad practice with inline functions?

When writing inline functions when defining classes, if i have a simple "get function" that only returns something, I normally define it in one line like this:

1
2
3
4
5
6
7
//this is just a short example, not an excerpt from my code
class Circle {
private:
    double radius;
public:
    void getArea() { return 3.14 * pow(radius, 2); }
};


Is this bad practice? I am asking because though it is discouraged to write code in one line like that, this seems more readable than any other way to define it in multiple lines, at least to me.
Last edited on
shameless bump
It's not a bad practice AFAIK.
Styles are like religions. The usual advice given here is "pick a style and stick to it".
Makes sense, thank you.
I don't have a professor as I am teaching myself, so I thought it would be good to ask.
Topic archived. No new replies allowed.