Page 2 of 2

Re: Skeletal javadocs - feel in love

PostPosted: 10 Sep 2011, 13:41
by Rob Cashwalker
Easier for everyone. Easier to understand. Easier to modify or expand to include more possible outcomes.

More specifically, I was referring to
If you want to add other code, just convert this back into an if-else clause.
Why should I have to convert it back, being totally confused as to which result goes with which if clause? Just use the if block in the first place.

Re: Skeletal javadocs - feel in love

PostPosted: 10 Sep 2011, 20:41
by Max mtg
Rob Cashwalker wrote:Easier for everyone. Easier to understand. Easier to modify or expand to include more possible outcomes.

More specifically, I was referring to
If you want to add other code, just convert this back into an if-else clause.
Why should I have to convert it back, being totally confused as to which result goes with which if clause? Just use the if block in the first place.
Do you have a mental link with "everyone" to speak for them?
Look, jendave doesn't mind against ternaries, I do need them in my work, so who is that everyone you're referring to?

There's nothing confusing about ternary operators when you know the programming language. If your habbits are different that is not a reason to ban them for everyone.

Re: Skeletal javadocs - feel in love

PostPosted: 10 Sep 2011, 21:40
by jendave
Max mtg wrote:Why should I have to convert it back, being totally confused as to which result goes with which if clause? Just use the if block in the first place.
Do you have a mental link with "everyone" to speak for them?
Look, jendave doesn't mind against ternaries, I do need them in my work, so who is that everyone you're referring to?
Easy there Max. This thread has had enough drama between you and me let alone taking jabs at anyone else [-X . I actually do not like ternaries, but I have found them useful if used sparingly. I removed the restriction because checkstyle enforces a line length limit which removes some of the potential for abuse of ternaries.
Max mtg wrote:There's nothing confusing about ternary operators when you know the programming language. If your habbits are different that is not a reason to ban them for everyone.

Re: Skeletal javadocs - feel in love

PostPosted: 11 Sep 2011, 01:06
by Max mtg
jendave, I want those restrinctions in checkstyle to become something reasonable and possible to follow. For now to my mind requirement of a javadocs for each method is absurd, as well as restrictions for line length or ternary.

I am not following them, though I am aware of their existance. And here are my reasons:
Javadocs: noone is going to write good ones for all functions ever, so that warnings won't get away ever.
Ternary: writing 6 lines instead of one is just lame.
Line length: 140 is just better for me, because of some lines I have
Code: Select all
        List<TableColumnInfo<CardPrinted>> columns = new ArrayList<TableColumnInfo<CardPrinted>>();
        columns.add(new TableColumnInfo<CardPrinted>("Qty", 30, PresetColumns.fnQtyCompare, PresetColumns.fnQtyGet));
        columns.add(new TableColumnInfo<CardPrinted>("Name", 180, PresetColumns.fnNameCompare, PresetColumns.fnNameGet));
        columns.add(new TableColumnInfo<CardPrinted>("Cost", 70, PresetColumns.fnCostCompare, PresetColumns.fnCostGet));
        columns.add(new TableColumnInfo<CardPrinted>("Color", 50, PresetColumns.fnColorCompare, PresetColumns.fnColorGet));
        columns.add(new TableColumnInfo<CardPrinted>("Type", 100, PresetColumns.fnTypeCompare, PresetColumns.fnTypeGet));
        columns.add(new TableColumnInfo<CardPrinted>("Stats", 40, PresetColumns.fnStatsCompare, PresetColumns.fnStatsGet));
        columns.add(new TableColumnInfo<CardPrinted>("R", 35, PresetColumns.fnRarityCompare, PresetColumns.fnRarityGet));
        columns.add(new TableColumnInfo<CardPrinted>("Set", 40, PresetColumns.fnSetCompare, PresetColumns.fnSetGet));
        columns.add(new TableColumnInfo<CardPrinted>("AI", 30, PresetColumns.fnAiStatusCompare, PresetColumns.fnAiStatusGet));
        columns.get(2).setCellRenderer(new ManaCostRenderer());
So, it looks like I should not argue here any longer, just keep making some features players would love.

Re: Skeletal javadocs - feel in love

PostPosted: 11 Sep 2011, 14:11
by Rob Cashwalker
Max mtg wrote:Do you have a mental link with "everyone" to speak for them?
When you are one with the Force, you will understand..... Like I said in the thread about why we don't use branches, not all the devs on the project are at the same skill level, much less Java being their native language. (I'm in the latter camp, VB is my native language)

If your habbits are different that is not a reason to ban them for everyone.
It's not about my habits, it's about the simplicity of regular if-blocks and how they can be easily modified.

Re: Skeletal javadocs - feel in love

PostPosted: 12 Sep 2011, 05:04
by Doublestrike
Not sure if checkstyle can be made to allow it, but a compromise solution for this could be to allow ternaries, but force them to three lines for better clarity:

Code: Select all
condition ?
    iftrue :
    iffalse;

Re: Skeletal javadocs - feel in love

PostPosted: 12 Sep 2011, 05:09
by Doublestrike
Also, a little off topic, but is there a polling system built in to this site? If so, we could have a polling area, where stuff like this is put up to vote with a week window or something. If people care, they vote, and a common consensus could be reached easily without much discussion.

Issues such as this ternaries, line length, javadocs in general, GUI features, implement order for new stuff, etc. could be put up to vote and a result achieved efficiently.

Re: Skeletal javadocs - feel in love

PostPosted: 12 Sep 2011, 15:38
by Rob Cashwalker
Did a poll for Ternary Operation. Feel free to create additional polls (following the style - Intro, Pros, Cons, Final Statements) for other things, I don't think it's a special feature for me as a mod. If it is, PM me to create new poll topics on your behalf.

Re: Skeletal javadocs - feel in love

PostPosted: 14 Sep 2011, 08:39
by Doublestrike
@Rob - great looking poll, gives a good cross-section of things. Thanks for that. And there's even all-important option C (just kidding, wasn't me).