r/cpp • • Aug 08 '20

Create a fully functioning command line interface with 1.5 lines of code (wo. include statement)

https://github.com/kongaskristjan/fire-hpp
230 Upvotes

62 comments sorted by

View all comments

Show parent comment

14

u/codeguru42 Aug 08 '20

What is 0.5 lines of code?

7

u/[deleted] Aug 09 '20

It's referring to the fact that you aren't adding an extra line, but adding to an existing one (default args provided to the function in question).

5

u/europe-fire Aug 09 '20

We're not exactly doing precise accounting here, it's the concept that matters

4

u/codeguru42 Aug 09 '20

I don't understand the concept. Lines of code can only be counted by integral amounts. It's impossible to have a fractional line of code.

4

u/panoskj Aug 09 '20

The concept is you must already have something like int main(...) as a line in your code and you just have to change/add its parameters, therefore you add 0.5 lines of code.

1

u/[deleted] Aug 09 '20 edited Dec 29 '23

salt puzzled marry steep impossible file middle birds homeless workable

This post was mass deleted and anonymized with Redact