Had a convo with CSC friend of mine. He was mentioning that a excellent programmer would write 500 lines of usable code a week.I might write 10-50 php/sql lines a week but due to my other job duties it's just not possible for me to sit down and write that much in a week.How much do you guys write?
8/4/2010 10:40:10 AM
number of lines written is irrelevent. The only thing matters is if you ship something that works on time.
8/4/2010 10:43:17 AM
yeah more like an excellent programmer downloads the right library and plugs in about 50 lines to implement it
8/4/2010 10:44:19 AM
programmers who worry about this metric aren't generally good programmers to begin with.
8/4/2010 10:49:55 AM
I probably write a line per minute.But I also do my if statements like:
if (this){// whatever}
8/4/2010 11:09:22 AM
let's turn this thread into a vigorous debate about indent styles
8/4/2010 11:10:04 AM
Allman style or death
8/4/2010 11:10:28 AM
hard tabs only
8/4/2010 11:10:53 AM
one true brace
8/4/2010 11:12:54 AM
*runs clean up on ur code and checks it back into svn w/ eclipse style prefs*
8/4/2010 11:14:17 AM
i have a closing brace on this line by itself}and it says you're a bitch
8/4/2010 11:15:20 AM
if(godTierCoder){ useAllmanStyle();}
8/4/2010 11:19:12 AM
Lets discuss ternary operators and how fun it is to embed them within print/echo statements.
8/4/2010 11:20:03 AM
//if (obviouslyFucked == true){ compileWithoutReportingErrors();}
8/4/2010 11:22:20 AM
if i wanted to comment out a block i'd use /*
8/4/2010 11:26:40 AM
who said anything about a block
8/4/2010 11:27:52 AM
scenario 1: want to comment out a conditional block, use /*scenario 2: want to comment out the conditional statement only, use //Allman style scenario 1: alter 2 lines scenario 2: alter one lineotb style scenatio 1: alter 2 lines, scenario 2: alter 2 linesAllman supremacy.
8/4/2010 11:30:59 AM
clearly highlighting how easy it is to mistakenly comment out the conditional statement and not realize it nub
8/4/2010 11:34:38 AM
if you comment out a conditional when you meant to comment out the block its you who are the scrub. Allman style is the most readable which is the only valid measure.
8/4/2010 11:36:03 AM
WHO SAID ANYTHING ABOUT A BLOCK
8/4/2010 11:38:49 AM
if(something){ }
8/4/2010 11:41:34 AM
nobody said anything about commenting out a block newbie
8/4/2010 11:41:57 AM
then how could you accidentally comment out the conditional?
8/4/2010 11:42:23 AM
line i mean to comment out//line i accidentally comment out and don't get warned about because the braces are fine because my indent style is dumb{rest of my dumb block}[Edited on August 4, 2010 at 11:43 AM. Reason : ...]
8/4/2010 11:43:38 AM
or // line i comment out because i want the code to run regardless
8/4/2010 11:44:24 AM
sorry for your parkinson's i guess. Also, a true allman user would have whitespace between previous lines and the block.[Edited on August 4, 2010 at 11:45 AM. Reason : ]
8/4/2010 11:45:31 AM
Lokken please try to focus
8/4/2010 11:46:50 AM
ur rite
8/4/2010 11:47:23 AM
usable code is usable.
8/4/2010 11:59:59 AM
i use allman in .net/sql and k&r in c/php, those being the general consensus in those development communities.can't say i've ever accidentally commented out the conditional statement alonebut then again, i'm awesome and resistant to flaws so...]
8/4/2010 12:09:17 PM
AllmanSometimes I want to comment the conditional line and let its block run all the time to test something. I don't think I've ever seen somebody accidentally comment out a conditional statement.If you want to comment out a block you should use //, most IDEs should help you out with that. The only time I use /**/ is if I'm commenting out a portion of a single line, like a function parameter's name in the definition to get rid of the YOU AIN'T USE THAT warning.also I <3 ?: operators
8/4/2010 12:19:51 PM
i'm a fan of the null-coalescing operator. i think it's neat.
8/4/2010 12:21:42 PM
lol neatso y = x ?? -1; is a shortcut for y = x ? x : -1;[Edited on August 4, 2010 at 12:25 PM. Reason : me = liberty ?? death;]
8/4/2010 12:23:18 PM
Visual Studio doesn't give me a choice. Wherever I put my braces, it moves them.
8/4/2010 12:57:24 PM
I'm a OTB user. Fuck your Allman and fuck whitespace.
8/4/2010 1:00:25 PM
If I'm working with code inherited from someone else, I just stick with whatever style they were using.If I'm writing something from scratch, I usually gravitate towards the Allman style braces because it seems easier for my eyes to quickly identify blocks (especially multiply nested blocks) with the braces surround the block at the same indent level. Something to do with the symmetry, I suppose.In any case, I don't recall ever having any issue, commenting or otherwise, where I've thought to myself "If only I had been using the other style..."While we're talking about something that's almost entirely aesthetic, how about this one: Has anyone found a way of doing long, multi-line method/function argument lists that doesn't come out looking strange?
8/4/2010 1:26:44 PM
Ask yourself why you need that many arguments and whether there's a better way to handle it (e.g. passing a single full-fledged object).[Edited on August 4, 2010 at 1:30 PM. Reason : I AIN'T MEAN TO BE HATEFUL, IT'S JUST THE THREAD MADE ME THAT WAY]
8/4/2010 1:28:53 PM
This function has more pointless arguments than a tech talk phone thread.
8/4/2010 1:32:05 PM
8/4/2010 1:42:52 PM
k&r is much more friendly to scm diffing tools I find
8/4/2010 1:47:47 PM
One true brace has a way better name, so I usually go with that.
8/4/2010 1:49:30 PM
I let eclipse handle the formatting for multiple arguments. I usually write them out on one line and if its crazy long i'll let the clean up handle reformating them. I have it set for arguments after a certain length to be put on the next line indented to line up with the first argument on the first line.Most of the time when this happens its because of either long constructors for pojos or overridden/implemented methods from other libraries.
8/4/2010 1:53:47 PM
LongFunctionName([tab]param1,[tab]param2,[tab]...[tab]paramn);
public class Foo { public Foo(ILogger logger, IFooRepository fooRepository, INotificationService notificationService, IMailService mailService, IPaymentProcessor paymentProcessor) { _logger = logger; _fooRepository = fooRepository; _notificationService = notificationService; _mailService = mailService; _paymentProcessor = paymentProcessor; } }
8/4/2010 2:22:49 PM
to be fairFrosh is an English major
8/4/2010 2:30:43 PM
yeah that is basically one step above retard
8/4/2010 2:33:13 PM
well, i mean sometimes it is appropriate to encapsulate a bunch of stuff in a class and pass around an object insteadi'm just saying, that's not always the case. although to counter my own example, constructor injection can be avoided too through other dependency injection techniques or through the use of DI frameworks.
8/4/2010 2:33:45 PM
8/4/2010 3:20:03 PM
today I wrote about 20 lines and copied another 20 from google
8/4/2010 7:19:04 PM
A only program with graphics.
8/4/2010 7:32:18 PM