Skeletal javadocs - feel in love
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
24 posts
• Page 2 of 2 • 1, 2
Re: Skeletal javadocs - feel in love
by 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
More specifically, I was referring to
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.If you want to add other code, just convert this back into an if-else clause.
The Force will be with you, Always.
-
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
by Max mtg » 10 Sep 2011, 20:41
Do you have a mental link with "everyone" to speak for them?Rob Cashwalker wrote:Easier for everyone. Easier to understand. Easier to modify or expand to include more possible outcomes.
More specifically, I was referring toWhy 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.If you want to add other code, just convert this back into an if-else clause.
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
by jendave » 10 Sep 2011, 21:40
Easy there Max. This thread has had enough drama between you and me let alone taking jabs at anyone elseMax 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?

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
by 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
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());
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
by Rob Cashwalker » 11 Sep 2011, 14:11
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)Max mtg wrote:Do you have a mental link with "everyone" to speak for them?
It's not about my habits, it's about the simplicity of regular if-blocks and how they can be easily modified.If your habbits are different that is not a reason to ban them for everyone.
The Force will be with you, Always.
-
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
by 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.
A joke is a very serious thing.
-
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
by 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.
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.
A joke is a very serious thing.
-
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
by 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.
-
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
by 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.
A joke is a very serious thing.
-
Doublestrike - UI Programmer
- Posts: 715
- Joined: 08 Aug 2011, 09:07
- Location: Bali
- Has thanked: 183 times
- Been thanked: 161 times
24 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 13 guests