Jump to content

Acis Coupons + Redeem


Recommended Posts

Designatix answered you but it's not only this thing.

Imagine this topic in marketplace section with these bugs inside ;)

Also there are many shares that deserves your question and not mine for sure :P.

I'm gonna update it to be completed and reshare it

Thank you for your good words my friend!

i love your idea, i always try to do new things (but since i'm newbie on java i can only imagine them xD) so it's good to see new things. I'll be waiting for the update :D

Link to comment
Share on other sites

i love your idea, i always try to do new things (but since i'm newbie on java i can only imagine them xD) so it's good to see new things. I'll be waiting for the update :D

if you can imagine ( that is good ) just try to write it ( is not so hard ) 

 

Designatix answered you but it's not only this thing.

Imagine this topic in marketplace section with these bugs inside ;)

Also there are many shares that deserves your question and not mine for sure :P.

I'm gonna update it to be completed and reshare it

Thank you for your good words my friend!

is not so bad ( drama ) ... just need 1 simple rework 

Link to comment
Share on other sites

if you can imagine ( that is good ) just try to write it ( is not so hard ) 

Well, it's not that easy, my ideas are not that simple for a newbie to make them..

Link to comment
Share on other sites

Can't get it, so you're saying that few unnecessary calls that give you a dummy empty list are cleaner than nullptr ? Its obvious that this emptylist should be used on other cases but here? Explain me why this is worst and I will go to fck off right away

 

final ArrayList<Coupon> coupons = getCoupons(player);

if (coupons == null)

{

     //msg and exit

}

{

else

{

   for (Coupon c : coupons)

        c.something();

}

 

if getCoupons returns empty list instead of null, the flow of the rest code is dumb and nonsense. null checks are as fast as 1 == 1

 

I personally believe (and most ppl on the internet, so far, since the time I checked it) it's not to the developer to care about null behavior. Or at least, as low as possible.

 

An empty list for looping does nothing, since it iterates on nothing it doesn't reach internal content of loop. The overhead is minimal.

 

It's just cleaner code-wise and in the developer's mind, you are sure you won't face any null, anywhere, anytime. So building new methods associated to such empty container become "easier".

 

Performance-wise, you win almost nothing using null since you call a static list (and what would be heavy with my method is the creation of the list).

 

But well since you explained you see it as a "error" and not an "exception" (so far it's called NullPointerException, not NullPointerError :D), what you say is correct, for yourself. If you seek on the internet the "standard" behavior, however, it's not that. After it's personal preferences, personally when I see a null I drop it, it remembers me the dark age of L2JIL where everything was tested using null, even if not needed ; so you were losing tracks of what could be null and what couldn't.

Link to comment
Share on other sites

Imagine this topic in marketplace section with these bugs inside ;)

 

Most of shares made for L2JFrozen so far (with all due respect for sharers).

Edited by Tryskell
Link to comment
Share on other sites

One interesting thing to add : grade type is counted as part of reward list. That way your system works even for low/mid rates servers.

 

Grade could be written on coupon in order player doesn't accumulate them when he reach lvl 80 (so a grade C coupon will still be a grade C coupon).

 

Obviously you have to write more reward lists :D.

 

Another thing : create a specific HTM for no coupon behavior (instead of the 20 non clickable "+").

Edited by Tryskell
Link to comment
Share on other sites

I personally believe (and most ppl on the internet, so far, since the time I checked it) it's not to the developer to care about null behavior. Or at least, as low as possible.

 

An empty list for looping does nothing, since it iterates on nothing it doesn't reach internal content of loop. The overhead is minimal.

 

It's just cleaner code-wise and in the developer's mind, you are sure you won't face any null, anywhere, anytime. So building new methods associated to such empty container become "easier".

 

Performance-wise, you win almost nothing using null since you call a static list (and what would be heavy with my method is the creation of the list).

 

But well since you explained you see it as a "error" and not an "exception" (so far it's called NullPointerException, not NullPointerError :D), what you say is correct, for yourself. If you seek on the internet the "standard" behavior, however, it's not that. After it's personal preferences, personally when I see a null I drop it, it remembers me the dark age of L2JIL where everything was tested using null, even if not needed ; so you were losing tracks of what could be null and what couldn't.

 

Most of shares made for L2JFrozen so far (with all due respect for sharers).

 

One interesting thing to add : grade type is counted as part of reward list. That way your system works even for low/mid rates servers.

 

Grade could be written on coupon in order player doesn't accumulate them when he reach lvl 80 (so a grade C coupon will still be a grade C coupon).

 

Obviously you have to write more reward lists :D.

stop the drug plz or change simple yous first message ... why you need 3 message ? you talk alone ?

Edited by pirama
Link to comment
Share on other sites

stop the drug plz or change simple yous first message ... why you need 3 message ? you talk alone ?

 

I thought you would have enough time to post between each.

Link to comment
Share on other sites

Tryskell, Pirama, with all respect guys, please don't start this flame and here. Respect Merlon's share.

 

Thanks!

ah Baggo You Don't Know What Real Love Means,This flame is just love :D 

 

on Topic nice idea melron thanks for share

Link to comment
Share on other sites

ah Baggo You Don't Know What Real Love Means,This flame is just love :D

 

on Topic nice idea melron thanks for share

hahahah pirama love you re, more than Tryskell. :o 

 

Merlon thanks for this share mate.. It's a fresh idea.  :1010:

Edited by 'Baggos'
Link to comment
Share on other sites

On the other hand if coupons were empty you dont even need to check.

All you do is:

 for (Coupon c : coupons)

        c.something();

 

No null checks, no NPE possibility, safer and cleaner code.

And if you seriously look at me in the face and tell me that returning null and checking it for performance reasons is better then you are not as smart as i thought you were.

 

idk how java optimizes empty list or empty loops, I don't even think it does, I always prefer nullptr due to the fact that things are straightforward once you have it. Imagine storing it somewhere and having to check if the character has any coupons, personally I prefer coupons == null than a dumb list.isEmpty() on an immutable empty list, I believe this case is just coding style, but my C background forces me to go with nullptr.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now



×
×
  • Create New...