#dev-general
1 messages ยท Page 505 of 1
That's how Ktor does it, the companion works like a factory, this way the main feature doesn't have to be a singleton
I think if i were to do it (which I won't), id prolly take the WebEngine then override some of the draw methods of the Scene/Stage class in JavaFX
then pass the pixel data stuff into the itemframes
ahh
JavaFX seems like a massive pain the arse
This is how it looks behind the scenes, generics galore
also uh why the public modifiers?
what part about it?
Taking after KTor are we
ExplicitAPI mode, for libs it's recomended
Hell yeah, i love it
The XML mainly
oh kotlin has such a mode that comes with it? or is it separate?
Oh yea thats reasonable
It comes with it, a option on the Kotlin extension on gradle
Can't argue with that. I made a POST API with it at the weekend and it's very simple
ah, thats pretty lit
Hi everyone! We've run into an unexpected problem and will not be releasing a snapshot today. Stay tuned for the first 1.17 Pre-release tomorrow!
206
2177
oh wait, they split it up into 2 actual versions
I thought part 2 was coming in a minor version of 17
welp
so now the huge cliffs thing is for 1.18
yea
yeah dude summer 2021
You can try this quite remarkable construction by Aad van de Wetering here:
https://cracking-the-cryptic.web.app/sudoku/2QM8JHJ4HB
Normal sudoku rules apply. In addition, both marked diagonals must also contain the digits 1 to 9. Cells that are a knight's move apart (in chess) cannot contain the same digit. The central 3x3 box must form a mag...
Um.....
Somehow I'm finding Swing easier than JavaFX... I feel like this is eventually going to hurt me but eh
also can't u use arrayOf :p
instantiating an array there is setting its max size
Is it really that much better?
All I need is an interactive grid
What are you making?
Its just more apt if working with javafx on kotlin
Eventually, Conway's Game Of Life for my A-Level CS project
In that case, why not draw the cells instead?
I've literally never made a GUI in Java/Kotlin before in my life
๐ฅฒ
yea, id say drawing is better than using actual components for this use case
That should be almost the same across swing and javafx
Wait but if I just drew them on how would I change the colour of them later and stuff
What filth
not sure if that's a sin or not but it bloody god damn works
https://i.imgur.com/1hYRxwt.png I think that might clear things up
mmm look at all that contrast
what
You draw every frame
Or atleast when you want change if you want to optimize
I can sort of draw a grid, but I have no idea how I'd change them later on
if (field != null) throw IllegalStateException("You can't reassign the server! Honestly, plugins these days...") lol
Why are you exposing a field if it always needs to be null
just asked someone about my rpi not logging in... im doomed
oh ok
Javafx or swing?
Swing
https://bin.osable.tech/udukoxifiw.kt
Well yeah but surely that'd be horrible if I only have to change one square
You'd probably not even notice it
this is with js canvas but redraws the entire thing every frame
https://vshnv.github.io/game-of-life/
wdym lazily redraws?
like only redraws the part it needs
same as like how video streaming works kinda
i dunno that might be totally wrong
im getting a error "No handlers found for this command" how do i fix
im using this
https://autocode.com/tools/discord/command-builder/
what
all those github actions
Lol
https://paste.lucyy.me/fojuhivupu#kotlin I wonder if I should actually add this to the API and if this looks good for the API console sender
Lucy's Pretty Pastebin
I only want to expose the console sender to allow you to make checks to see if a sender is the console more easily
I gotta work out how to code these things, this'll be "fun".
Ayy Lucy fixed the colors
๐ฎ
how the hell do I cancel an ovh VPS? Do I just let it expire?
you looked in your panel?
yes
you tried asking your best friend Google?
yes
literally searched "ovh cancel vps" and that was the first result
smh Blitz
oh boy... let me amaze you
it says its suspeneded but they still spam me renewal emails
that's what I meant
anyways will just let them spam me for now xD
lol
I gotta say, wine sucks
I was talking about actual wine smh
Here we go
Waffle + Slimjar = Happy
Yup, switching to linux everytime to test on 16 takes too much time
Makes sense
hmmm
Status report?
Oh really? That sounds promising.
Well if it works, that's good enough for me.
Alrighty, now just need to have it switch been this and normal addURL while on 8
Awesome!
hmm @frail glade are you able to access my fork of DeluxeMenus? Like if you go to my profile can you see it?
ah according to the settings you can. So I must not be able to see your fork bcz I was added after you forked it I guess
cj
but yeah just wanted to make sure bcz I'll ask you to review the code later. (made a different branch so it doesn't mess up the opened PR)
๐
testing rn and seems to work so far
@frail glade think I'm done. Fixed the /dm list command as well finally :).
When u got a few minutes to check the code and tell me what I've messed up here's the link: https://github.com/BlitzOffline/DeluxeMenus/tree/menureload
||btw maybe check the PR first so I can PR this too if its fine. xD|| well I Think that's all for tonight. gn
My brain hurts, doesn't the class implement TriumphPlugin? So this should fit P : TriumphPlugin no? >.<
a blob of meat and proteins
Matt, the issue is that P need not be a "BukkitPlugin"
Generics ๐ฉ
Wouldnโt it be like TriumphPlugin<BukkitPlugin>
beta blitz or matt help me in #placeholder-api
Or nvm
Imagine a case where someone tried to make a BukkitPlugin<SomeOtherPlugin> where SomeOtherPlugin : TriumphPlugin
now that this isnt valid
Whether you should open source your company or not.
https://www.reddit.com/r/benawadmerch
https://github.com/benawad/dogehouse
#benawad #opensource
Checkout my side projects:
If you're into cooking: https://www.mysaffronapp.com/
Join the Discord: https://discord.gg/Vehs99V
Patreon: https://www.patreon.com/benawad
Foll...
short answer. yes but actually no xD
xD
@cinder flare I'm sorry. How is this a javascript syntax error? (https://paste.helpch.at/egeyiqaxim.pl) lmao
Hmm Yugi, this doesn't work either ๐ซ
BukkitPlugin<P : BukkitPlugin<P>>

Why do you have to use generics btw
Because I need the "child" to be the one extending, for example if I don't do generics and do this instead
This works
But this doesn't
BukkitPlugin<P : BukkitPlugin<P: BukkitPlugin<P: BukkitPlugin<P: BukkitPlugin<P: BukkitPlugin<P: BukkitPlugin<P: BukkitPlugin>>>>>>>```
better
I guess throw in a cast Matt
Uh Idk cuz I havenโt worked with kotlin generics
I'm trying to do this: https://docs.gradle.org/current/userguide/signing_plugin.html#using_in_memory_ascii_armored_openpgp_subkeys but it keeps saying Could not read PGP secret key.
The variables are set (not null), copied and pasted keyId and password from gradle.properties and for key i pasted it (without the header and footer) from gpg --export-secret-keys --armor blah
Anyone know why?
public abstract class BukkitPlugin<P : TriumphPlugin>(
private val module: P.() -> Unit
) : JavaPlugin(), TriumphPlugin {
override fun onLoad() {
module(this as P)
}
}
Aight let me give that a try
Oh btw @ocean quartz
Oh?
Got it to append to system classloader on 16
Oh yeah I saw it earlier, so it doesn't need jar in jar?
That's awesome, how did you do it?
Does it depend on ByteBuddy now? ;o
I can download that at runtime
Ooh that's really cool, imma be honest the jar in jar was being very hard to understand xD
xD
is anyone here good with modding
Perhaps
What for
Okay Joseph I see you waited 2 minutes and left
Casting works, kinda nasty but works ๐ฉ
https://github.com/dkim19375/dkim19375JDAUtils/runs/2680744069
How do i fix this? because it's not like i have can 2 build.gradles...
i have can 2 build.gradles.
Remove direct property references dkim
use project.findProperty("propertyName") instead
Impatience is a virtue
does your TriumphPlugin extends BukkitPlugin?
The other way around
so the hierarchy is JavaPlugin -> TriumphPlugin -> BukkitPlugin (in which -> means extends)?
: means implements/extends
kotlin is complaining because there's nothing preventing the user from doing KT Class1 : BukkitPlugin<Class1>(...) // fine Class2 : BukkitPlugin<Class1>(...) // stupid user, cast exception
Yeah i know but there isn't anything i can do about it
Well other than the unsafe cast
stupid user
there's your answer
I'll probably be the only user so
can't you store the class as variable?
I mean i need the instance not the class
no you didn't got what I tried to say
public abstract class BukkitPlugin<P : TriumphPlugin>(
private val clazz: KClass<P>,
private val module: P.() -> Unit
) : JavaPlugin(), TriumphPlugin {
override fun onLoad() {
module(clazz.cast(this))
}
}``` or something like that
Hmm that just sounds like extra steps
yeah, but the way I see you only this option or unsafe casting
because type erasure ๐คฎ
actually, what this consumer module is supposed to do?
what is the point of exposing P to P if P is already got access to members inside P
oh nvm, if you're extending it you need to pass all the arguments direct on the constructor
just add a check inside a init block then
init {
require(this is P) { "Stop being dumb dumb" }
}```
Not exposing P to P, I just need instance of P to call the module function
I meant like using P as receiver (which is basically expose P as this inside the module consumer lambda), and if I understood correctly, P should be the class that is directly extending BukkitPlugin
Yeah that is correct
so it in, in a sense, expose P as this to the own P
This is the full example
does BukkitPlugin<TestPlugin> { install(TestFeature) } also compile?
Uh where would i do that?
public class TestPlugin : BukkitPlugin<TestPlugin> { install(TestFeature) }
just curious, I have never something like that before
how about public class TestPlugin : BukkitPlugin<TestPlugin> ({ install(TestFeature) })
Yeah but that's the same as having the extension, just .. uglier
Ayy this works now
The feature still doesn't but the enable, etc, is being called correctly
uh that looks like a yaml error? did I say it was a js error? ๐
Feature works in a very simple way too, don't even need to do much to get the plugin instance
Yeah. It was mentioning a javascript but is a yaml error indeed
oh yea yea
Well if you read the entire error ..
Reading is for nerds
:O
discord lookin fancy https://i.gyazo.com/b78e5f737893ad7f26e28a9d708448fe.gif
Nice
Hot
does jda have that?
JDA has it on a test branch
But it's not in stable since the API is really rushed according to Minn
yo @ocean quartz is this not the latest version of GUI?
implementation 'me.mattstudios.utils:triumph-gui:3.0.5' bcz rn it can't find it for some reason
nvm it can't find older versions either. repo down?
oh nvm
forgot -SNAPSHOT
Smh
Is anyone available to help me test my plugin
Just need you to login
and type a command
and click a button
if no one can in the next few mins, ill ask again later i gotta go soon
version?
latest pls
just wanted to make sure xD
@ocean quartz how am I supposed to use SkullBuilder?
Think this means the constructor is private ^
you access it through ItemBuilder afaik
yeah found it. ty very much
np
where can I ask questions regarding deluxemenus? I believe there is an issue with the plugin
how??
yup, so amazing
JDA when ;-;
i'd probs still use it lol.
no need to saving message id anymore xd
I'm always like 4 years behind on updating so
but it's still kinda shit, you can only use 4 colors or something
why no hex
sadly isn't all features rushed now?
It's all rushed
oh hi bm
hows you
I thought you finish school at like 12?
btw, i don't actually know if I managed to sort out the feature I was saying about yesterday
I might just be coding it badly in my plugin what is hooking into but idk
o
?
o i woke up like 50 minutes ago
I don't get that meme
whatsapp cologne
Drip Car, also known as WhatsApp Car, refers to a photoshopped image of a BMW Z4 car used as an exploitable meme format. In memes, the BMW Z4 typically has its colors changed as well as various logos added to it referencing pop culture or other themes. The image is then set to various music, most commonly trap music, to create the remix video. W...
^^
does it smell like angry ex?
You know when you're getting old when you don't know all the new memes ๐ฆ
atleast that was on mute
Shut it
I dont think there is more to that meme than the car's color
People are just really bored
the Helpchat car
๐ฎ
The music is fire though
lol
epic
Install IntelliJ.
why
lol
its not even properly wrapped on.
๐
๐
Doesn't that trigger others?
I do not condone this usage of the placeholderapi logo
xD
why not
lol
lmao
i swear i'm getting more and more dumb
I set the blocks to chiseled sandstone and couldn't workout why the blocks didn't update... the creeper face is only on the side
๐ฅฒ
LETS GOO
Patreon โบ https://www.patreon.com/Flyingkitty
Instagram โบ https://www.instagram.com/flyingkittyy
Twitter โบ https://twitter.com/FlyingKittyy
Discord โบ https://discordapp.com/invite/flyingkitty
Steam โบ http://steamcommunity.com/id/flyingkittyy
Alt YT Channel โบ https://www.youtube.com/user/FranklinGreenStretch
KIK โบ Flyingkittyy
lol
i wanna ask something but i know i'll be roasted like hek
that thumbnail is seriously cursed Yugi
lmao
ikr xD
Nice edit
who is daBabby
rapper
sounds overrated
Like haskell
Have you not heard "Rockstar"?
?
It was literally playing everywhere around the blm times
rockstar kinda fire
disown me go ahead
rockstar, the game dev company?
Song
Dababy โ Rockstar (ft. Roddy Ricch) [BET Awards Performance]
Listen: https://smarturl.it/DaBabyRockstar
Spotify: https://smarturl.it/DaBabyRockstar/spotify
Apple Music: https://smarturl.it/DaBabyRockstar/applemusic
Director: Mike Mihail
Producer: John Lathan, Arnold Taylor, Garrett Williams, Mark Bridges, Fatima Washington
Production Company: G...
oh
man I saw that one yesterday alongside the "whatsapp car" ones... what have i brought upon these lands....
never heard of
don't think I've heard it either
wait what xD
the whatsapp car vs the Helpchat car
The convertible one?
ty
jesus christ
Helpchat car all the way!
where's the helpchat car
dont think he is talking about dababy
I am
I haven't heard that song before
lol
the fuck
That was top on spotify playlists for a few weeks
look up "helpchat" in the gif search
What xD
i listen to the same 40 songs on repeat every day, idk what you're talking about lmao
enjoy yugi
smh who sent that
who tf uses spotify
me
I do
not me ๐
I do
?
what a waste
I havent found a better free replacement for phone yet
you unculutured pig
Im not wasting any money, Im on the free package
Same ^
๐ฅฒ
Im almost always have a song playing
Airpods + spotify go well together
cant bring my laptop around
airpods = shite
No ur shite
yea spotify is okay
you spend like 200 bucks on nitro
airpods are overrated
no comment
airpods aren't really overrated
I need bluetooth headphones ๐ฅฒ
yugi listen to nature
the point is ease of use
nature is boring tho
just pop em in and they work, it's amazing
only artificial music
ah yes dev chat not on topic per usual
Not my fault
chaotic normal
same thing
nah you gotta listen to music while developing!
cube there's no such thing as on topic dev general
Yea its lacking some monoids
it is quite annoying having wires lol
"not configuration help"
Not configuration help though
I believe dev-general is more off-topic than off-topic is
get wireless then?
get wireless headphones exist
that's... what airpods are
but airpods are tiny
๐
Thats the point lol. Airpods are supposed to be tiny and easily transportable
and they mess up your hair if you just got out of the shower
Lol
Quick! name your favorite development jargon words
yea the point is airpods are small and super easy to use
i don't have long hair
set theory!
Monad
neither do i
And also no one runs in a huge ass headphone
Applicatives!!
airpods are ideal for sports
then how does it mess up your hair?
i do?
Maybe odin is bald
u dumbass
yes
lol
flattens the top and gives you big ear rings lol
true
Headphones add weight
dude i got a flat head so
false

I think yes is just my favourite word in general
Flat head?
i mean you don't have like.. any hair?
Lol
You are a yes man
anything that goes above your normal hair can be flattened
where does your flatness start frank
i have more hair than funnycubes pfp
like above the eyebrows?
loch ness monster bug
buttons coming to djs v13
below piggy
many hype
no
yeah upon rereading that sentence, it doesn't make any sense
buttons?
The +1 -1 things I mean
lol
"I will turn a ni**a into an Applicative"
- DaMonad
Can the yrespond to them?
buttons don't seem suited to showcase
i think i meant "any hair that is above your scalp can be flattened"
๐ฎ
fire bm
hmm
wat

bm gonna get redacted
impossible
I've sent 28k messages?! wtf
you like denying a lot ๐
power trip
piggy am i hot
ive sent 32k messages in helpchat and 31k messages in spigot
fuck no
lmao
oh
weak
spigot has a discord?
spigot does indeed have a discord
cant believe you didnt know
lmao
its the palce for most shit
i prefer helpchat's
which goes on
oh my
i've never been there
Damn old man has no side profile photos
?
stupid Simon
bm who's that dev you support atm
?
Aristotle!
simon cowell or something
Simon Peyton Jones
๐
thats him
simon cowell
overrated person
lol
why you guys bully me
cause you a hater
it's the same name
"i hate airpods"
yes
heresy
nah
then i can get to 30
IOException
i'm a better gift candidate
IO ๐
๐
i might've caught and done a return; on a NPE today
ok
isn't that good practice?
wat
Haskell compiler wouldn't allow that
why would that be good practice
i might've caught and done a return; on a NPE today
stops errors
(obvious bait)
is intellij 2021 actually much different btw
u guys wanna see some questionable shit
this is how I used to write objects https://github.com/MinePoS/Plugin/blob/6daa73a289a66872b509585bc8d57fa111551053/src/main/java/net/minepos/plugin/core/objects/gui/GUIItem.java
yes
different to what
2020
what is that
looks like mine piece of shit maybe?
Aren't you using 2021?
@obtuse gale idea was u didn't have to care about order when u put in parameters
obviously failed miserably when there was two fields of the same type
that looks cursed
parents just told me that some people have told them they'll be taking the internet out for a couple of hours, and they gave no notice or anything ๐ฅฒ
ah well that's when parameter naming is brought out lol
I did consider just passing a big string in
RIP
get a book
hurry load this before the internet turns off
turn on the phone hotspot
also "mine piece of shit" ๐ฆ
"listen to nature"
wait is that not what it stands for lmao
star are you aware of the biggest scams in the minecraft community
no
minecraft point of sale
LOL
wait it's actually point of sale
that thought flashed my mind for like .3 seconds
are you aware of the biggest scams in the minecraft community
Minecraft Dungeons?
๐ฅฒ
ok
yeah might do that
in the server world, there are known scammers
not in game
ohhhh
server administration side
good guys?
ok
the biggest scams in the minecraft community, is a list
made by me
about 2 minutes ago
it looks like this:
oh
- Tebex
- Tebex
- Tebex
Whats Tebex?
oh I see you made a storefront
how
ohh
huh?
Also.. uh.. so a guy got banned on spigot and is now asking me to add his alt manually to the buyers list...
um
Named after Haskell Curry, one of the inventors of combinatory logic. there's a man named HASKELL CURRY
Yea
i love him
They were initally going to name Haskell, "Curry"
lmao
does he rap and code
But then switched to "Haskell"
why
so he can download the plugin still?
wait why
wait really?
you can
This is his ban reason btw
yea, hmm
How..?
very expensive for what it offers
I guess I should just ignore his messages then
I guess so. What's you alternative?
he made one lmao
MinePOS!
mine piece of shit!
ded
๐คฃ
lmao
Wasnt there a commit like a month ago?
ah
craftingstore
that was minecraftmarket
hi remence
Hey dkim
no idea. I just know its cheap xD
well cheaper*
i broke my pi D:
Yeah but I remember one with craftingstore as well
and also the free plan has a bit more customisation as well
rip bot hosting
point is tebex is ridiculously priced for what it offers
it's insanely expensive
lots of people disagree with me though so maybe i'm just (what's the word when you don't like to spend money)
frugal?
poor xD
haha
stingy?
12.49 euro per month isn't that bad for all the features it has though
stingy works too
it's annoying accepting credit cards and stuff
but crafting store offers a lot more for a lot less.
except star, that literally costs more than most peoples servers
lmao
alr
i might leave the potato pc group in a few weeks ๐
oh damn you need to do 24.99 per month to remove branding
k
that's a yikers
yet can't afford another pi huh?
lol
im still trying to see if i canc recover it
it just black screens whenever i log in
and then goes back to login page
For that 250CPS PogChamp No scope420 bridge??
๐ฅฒ
ofc
but u said windows good tho...
Modded discord client?
yea, that happens on pi, i use it to host bot


uh


wtf

@onyx loom found the new smiling face with 3 tears lmao
> idonthavetheemojisadface

๐ ๐ ๐ ๐ฅฒ

its too yellow
thinking of switching Krypton to using Guice, anyone wanna try and convince me? lol
lol
typical
I would use Koin but it seems like a bit of effort
maybe someone's made some Guice Kotlin stuff
because plain old Guice kinda sucks ass to use in Kotlin imo
there is a project with extensions
any idea where it is?
no idea just google "guice kotlin"
https://github.com/misfitlabsdev/kotlin-guice here we are
Guice DSL extensions for Kotlin. Contribute to misfitlabsdev/kotlin-guice development by creating an account on GitHub.
Guice, Kuice, and Juice
also BM, Koin would be good if it automatically scanned for stuff to inject, instead of always requiring manual configuration
that's the only reason I don't like it
guice is best
property injection in Kotlin is actually decently idiomatic
no it's not
yes it is
Elaborate
Having a nice API doesn't mean it's a good practice
it's still implicit coupling which is generally considered a bad practice in every language
implicit coupling?
makes it very hard to unit test your classes
yes
without looking at the class body there's no way of knowing MyClass depends on SomeOtherClass
maybe Koin with constructor injection isn't a bad idea
So you can't instantiate it "normally"
so you'll get confusing errors, and as I said, harder to unit test
no extra configuration required lol
Without setting up koin static bindings again
just works
Spring is good
like Spring DI is so good that you can inject all subclasses of a class by using the type Set<SuperClass>
rpf can do dat
and with Kotlin, it doesn't even require any annotations either
Guice has that too
can Guice scan say @Singleton constructors and call them without needing to explicitly use @Inject btw?
like if you have this ```kotlin
@Singleton
class MyClass(val injected: SomeClass)
no need for the @Inject annotation there
is there?
because having to do @Inject constructor is really annoying
also, is @Singleton a bit like Spring's @Components?
unless guice has special support for kotlin
like it's a singleton instance that can be injected elsewhere
singleton ensures only a single instance of the class will exist in the injector
yeah
kinda thinking that Koin still might be the better option (using constructor injection, not property injection before you blow up again)
Probably doesn't matter
yeah it doesn't, just Koin is much more idiomatic and just better to use in Kotlin than Guice is
how does that work?
Delegate properties
what is everyone else's opinion on Koin's property injection btw?
because I've heard BM's POV too many times now lol
It's alright, i know it's used quite a bit in the android community
๐
oh the spigot discord
yeah didn't you hear dkim? Intel just released their new Pentium models yesterday, and legend has it, they're the fastest ones yet!
i know - it was a joke -_-
Good day. I can't ping my menu I put the domain there but I can't please send it to me as it should be.
input: '%pinger_online_mc.viveland.eu:25569%'
(&e%pinger_players_mc.viveland.eu:25569%&8/&e%pinger_max_mc.viveland.eu:25569%&8)
wrong channel - #placeholder-api
koin would be great, if you didn't have to specify the injections directly
Features work 
Seggc
oh btw, before I forget again, can you guys compile a list of all the things you've ever had to use NMS for with Bukkit for me pls?
The one feature I kinda like playing around (that Paper provides) is custom GameProfiles
For head textures, player skins etc
You can't do that on Bukkit or Spigot API
NBT (could use nbtapi, but still, without nbtapi you would have to use nms i think)
you mean being able to access GameProfile through the API?
For me, custom mobs, pathfinding (paper provides), navigation, etc
PDC
the issue with NBT is that it's implementation-specific
it's implementation detail
Plus Dkim, NBT api is useless, there is PDC
Why would you need that anyway? Most of vanilla NBT is exposed in API, display name, lore, attributes, etc etc
Why would you need to access vanilla nbt like that? 
And fuck old versions
it was just a suggestion for krypton api ยฏ_(ใ)_/ยฏ
Yeah so like Player#setProfile or whatever, same thing for player heads
How so?
The end result is always the same
Also there are no guarantees that tag names will stay the same across Minecraft versions, things like the display name and display lore have changed capitalization and names entirely throughout the years (among many other things)
The server API resolves that
The format is well documented
about RUDDY time
problem?
Yes
okay ๐
Nice, I love the CSS
lol
Writing @Nullable Point is analogous to Optional<Point>, but with significant benefits:
You get a compile-time warning or guarantee, not a run-time crash.
WHAT
I personally prefer JSR 305 to optionals
I mean... you also get a warning for .get()ing without checking lmao
some of these points are literally trolling
That's literally a stupid point to compare
the misuse one is kinda interesting I think, since it shows how optionals are actually more verbose and require more checking
thats the point lmao
since the optional itself might be null
That's the dumbest shit one could ever say
nullable optionals are very very highly discouraged, to the point where you should always assume an optional is not null
yeah but to be at least 90% sure that your reference is non null, you should probably be checking if the optional itself is null
Reminds me of this
no you shouldn't
dear god
Every error that you might commit when working with nullable references has a direct analogue that you might commit when working with Optional, and the consequences (a run-time exception) are equally as severe. Thus, Optional alone doesn't solve any problems.
tf does that even mean
I mean the idea around optionals is it forces you to check
also, java if (myOptional.isPresent()) { myOptional.get() } vs ```java
if (myValue != null) {
myValue
}
K?
path finder
And?
that's not really a real example
typically you'd combine map, ifPresent, etc
Optional's syntax is uglier than use of nullable references.
debatable, it's often more concise
average optional user vs average JSR 305 enjoyer
Optional is less efficient than use of nullable references.
sure, but it's negligible (valhalla should fix this too), and all abstractions have overhead
"Enjoyer" no one is enjoying anything with nullability
Valhalla ๐ฅบ
no but more people use JSR 305 than the people that use optionals lol
and more people enjoy JSR 305 than people that enjoy optionals
vox populi fallacy
More people use Java than Kotlin, is Kotlin worse?
Yes
true
๐
we have already established MANY times that popular != better
Popularity has nothing to do with something being better or not
also, I really need to bug Kotlin about upgrading to allow optionals' semantics to come closer to those of nullable types lol
There is no real reason not to use Optionals in Java, but I personally only use them in the cases I know its utility methods will come in handy (orElseGet/Throw, map, ifPresent, stream etc)
this guy's entire argument is "yeah null sucks, but you can use an external tool to make it a bit better!"
lol
If that doesn't apply I prefer @Nullable
Sponge likes to go full pepega and use Optional everywhere, even in places it's not at all necessary
it's even in their official style guide
when would it not be necessary
"Yeah Java's boilerplate sucks, but you can use Lombok" ๐
when you don't need the utility methods, like what emily said
true
how can you say that the methods will never be needed
true
also, why can't Java just throw in some better nullability like what Kotlin exposes
a bit of spigot for you
"DO NOT USE KOTLIN, lombok exists and uh.. kotlin gradle boilerplate and new language complexity bad!!!"
๐ฉ ๐
Spigot good ๐
spoogit
lol
said no one ever
well, said no sane human ever
it's the same points as that article
I still remember when that guy flamed you for calling Lombok bad
Sane humans use Lombok, Netbeans, and annotate nullable methods with NotNull ๐คก



