It is currently 12 Sep 2025, 23:04
   
Text Size

Skeletal javadocs - feel in love

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Skeletal javadocs - feel in love

Postby Rob Cashwalker » 10 Sep 2011, 13:41

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.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Skeletal javadocs - feel in love

Postby Max mtg » 10 Sep 2011, 20:41

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.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Skeletal javadocs - feel in love

Postby jendave » 10 Sep 2011, 21:40

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.
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Skeletal javadocs - feel in love

Postby Max mtg » 11 Sep 2011, 01:06

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.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Skeletal javadocs - feel in love

Postby Rob Cashwalker » 11 Sep 2011, 14:11

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.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Skeletal javadocs - feel in love

Postby Doublestrike » 12 Sep 2011, 05:04

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;
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Skeletal javadocs - feel in love

Postby Doublestrike » 12 Sep 2011, 05:09

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.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Skeletal javadocs - feel in love

Postby Rob Cashwalker » 12 Sep 2011, 15:38

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.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Skeletal javadocs - feel in love

Postby Doublestrike » 14 Sep 2011, 08:39

@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).
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 13 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 13 users online :: 0 registered, 0 hidden and 13 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 13 guests

Login Form