- Is it number of line it takes in the IDE or editor?
- What about line continuations (implicit and explicit).
- Do comments count?
- Is it the number of end of statement markers? eg. ; in C style languages.
- Is it the number of statements?
- What is a statement?
- What is a expression?
- What about multiline Lambdas?
- Is method-call-chaining 1 LoC or higher?
- What is a statement?
- Is it number of lines it gets compiled to?
31 Replies - 4986 Views - Last Post: 21 November 2012 - 12:54 PM
#1
"Line Of Code" How do you define what one is?
Posted 16 November 2012 - 03:28 PM
Replies To: "Line Of Code" How do you define what one is?
#2
Re: "Line Of Code" How do you define what one is?
Posted 16 November 2012 - 03:36 PM
If it is to complain about a'boot my work then it's 43-57% more than current IDE line reporting.
In general the IDE's clean up keycommands provide me a decent approximation on how many lines. Of course I don't comment my code so no need to fear about that mucking up the number.
#3
Re: "Line Of Code" How do you define what one is?
Posted 16 November 2012 - 04:00 PM
#4
Re: "Line Of Code" How do you define what one is?
Posted 16 November 2012 - 04:02 PM
or 2 LoC ( the lambda is considered a part of line)
or 4 LoC (Using ; statement terminators )?
or 5 LoC (Same as above but includes the if statment)
var numbers = Enumerable.Range(1, 100);
var odds = numbers.Where(x => {
if (x % 2 == 1)
{
return true;
}
else
{
return false;
}
}
);
If not LoC? then what?
This post has been edited by AdamSpeight2008: 16 November 2012 - 04:03 PM
#5
Re: "Line Of Code" How do you define what one is?
Posted 16 November 2012 - 06:16 PM
#6
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 03:03 AM
#7
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 10:59 AM
#8
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 12:52 PM
I personally think of things in complete lines of thought. Where your lambda would be one line because all that conditional stuff is just to specify conditions for the where(). But if someone asked me how many lines of code I wrote today I would turn to them and ask "Why would that matter?" The ultimate goal is to solve problems, not and try to verify my performance by measuring how many lines I can pump out in X minutes/hours.
In short, ishkabible said it best, stop confusing lines with constructs. But to add to that, stop fussing about lines of code meaning anything.
#9
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 03:34 PM
cfoley, on 17 November 2012 - 02:16 AM, said:
So you are say its 12 Editor lines of code. Is it that simple?
The 12 Lines are an arbitrary stylistic choice.
This is valid C# and functionally the same.
or 5 LoC
or as non of you "so called programmers" not pointed out.
I thing can conclude is you lot are paid in terms of the number of lines of codes, and that ishkabible and jon.kiparsky still having an hissy fit at getting FizzBuzz wrong?
This post has been edited by AdamSpeight2008: 17 November 2012 - 03:35 PM
#10
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 03:50 PM
I see that c# code as 46 lines, all of them terrible. The last example is a lot better quality.
I actually typed a post about refactoring your original code but decided it was off topic. Your code was obviously crafted to make a point, not to stand as an example of good programming.
#11
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 04:01 PM
for ( int i = i ; ....
is one line or some or many? What's at stake here, for you? How can this possibly matter to anyone?
(as for your efforts to bait me into some sort of squabble - it's not going to work, so come off it and quit acting like a child)
#12
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 05:39 PM
Code Golf challenges tends just the metric of minimum number of non-white-space characters wins. So is using the programming language WhiteSpace cheating? (Since the count will always be Zero.) What about significant whitespace? are they also excluded also? They are required to make the program syntactically correct, in for example languages like Haskell and Python.
Since LISP is homoiconic, so is right to say all LISP program are a single S-Expression?
This post has been edited by AdamSpeight2008: 17 November 2012 - 05:52 PM
#13
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 06:20 PM
and where you are allowed to set breakpoint in that example.
(IDE Lines 23 onwards.)
You can't set one mid-expression, but can set one on the beginning of the lambda body.
This post has been edited by AdamSpeight2008: 17 November 2012 - 06:25 PM
#14
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 06:37 PM
You can write an s expression on one line or several.
Python and Haskell are pretty cool. I wish more languages has sensible whitespace rules rather than conventions.
#15
Re: "Line Of Code" How do you define what one is?
Posted 17 November 2012 - 07:16 PM
|
|

New Topic/Question
Reply



MultiQuote










|