[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Jaba

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 21
Thread images: 1

File: Capture.png (13KB, 258x499px) Image search: [Google]
Capture.png
13KB, 258x499px
I understand your hate now /g/
>>
idgi are these supposed to be filled in
>>
this is literally the same thing you would do in c++ in this situation, except for a few keyword changes
>>
>>57304733
just make everything public and not be autistic
>>
>>57304786
But I have to protect the memory from unwanted mutation.
>>
>>57304733
>encapsulation is bad
Wat?
>>
>>57304733
literally how would you do this in another language then
>>
>>57304779
Or use a language with immutable data and record types and just do Unit.Item, you fucking clod.

God damnit OO languages are so fucking stupid.
>>
>>57304815
Some languages generate this bullshit automatically but most discount the idea altogether because preemptively writing useless boilerplate like this is overgeneralizing for the sake of preserving the lifetime of sloppy design without foresight.
>>
>>57304805
The same you protect people from calling your public accessers
>>
>>57304733
use lombok. no need to thank me.
>>
>>57304733
wtf i hate jaba now
>>
>>57304805
so store it all as strings
>>
>>57304815
Syntactic sugar, obviously. I'm learning Ruby at the moment and it's pretty cool,
attr_reader foo, bar
generates getters for instance variables foo and bar.
>>
>>57304815
C#

public foo { get; protected set }
>>
>>57304815
public int BaseStats
{
get
{
return baseStats;
}
set
{
baseStats = value;
}
}

public char Type
{
get
{
return type;
}
set
{
type = value;
}
}

public Ability[] AB
{
get
{
return ab;
}
set
{
ab = value;
}
}

public Item Item
{
get
{
return item;
}
set
{
item = value;
}
}

public int Owner
{
get
{
return owner;
}
set
{
owner = value;
}
}

public InteractSprite Sprite
{
get
{
return spt;
}
set
{
spt = value;
}
}

public string Name
{
get
{
return name;
}
set
{
name = value;
}
}

public int UnitID
{
get
{
return UnitID;
}
set
{
UnitID = value;
}
}
>>
>>57304833
That is not safe tho
>>
>>57304733
Lombok.
>>
>not making your arguments final
also just let an IDE generate them. Java is obviously meant to be used with an IDE because otherwise you'd probably just kill yourself
>>
>>57304733
It's not the language's fault that you don't put the open curly brackets on a new line, you fucking neanderthal.
>>
>>57306727
lmao you do realize there is an official Java code convention that puts opening curly braces where op put them? He's just missing a space
Thread posts: 21
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.