#dev-general

1 messages · Page 310 of 1

prisma wave
#

my point is that the server doesn't need a fancy DSL or type safety or anything

#

it's never gonna actually use any of those things

jovial warren
#

also, what's wrong with Komponent on the backend? it's literally designed for the purpose of being both Kotlinified and working with kotlinx.serialization natively

#

it's literally perfect to use on the backend

prisma wave
#

when will the server implementation ever need a DSL for json messages?

jovial warren
#

when you have to wrap a chat message into {"translate":"chat.type.text","with":[{"text":"Herobrine","clickEvent":{"action":"suggest_command","value":"/msg Herobrine "},"hoverEvent":{"action":"show_entity","value":"{id:f84c6a79-0a4e-45e0-879b-cd49ebd4c4e2,name:Herobrine}"},"insertion":"Herobrine"},{"text":"I don't exist"}]}

prisma wave
#

the server doesn't do that

jovial warren
#

yes it does

prisma wave
#

it will just take some abstraction or the actual json text and send it

jovial warren
#

that's the format for chat messages

prisma wave
#

it doesn't need to ever create that text itself

jovial warren
#

¯_(ツ)_/¯

#

also, how would it not?

#

you never receive that text from the client

#

all you receive is the message in plain text

prisma wave
#

when will the server ever use something this complicated?

jovial warren
#

it's not even that complicated anymore

prisma wave
#

you're misunderstanding me

jovial warren
#

I mean, I get what you're saying, but writing raw JSON is ugly

prisma wave
#

the server will never need that DSL

#

the vanilla is just TextComponent(message)

#

and that's only ever used once

jovial warren
#

I guess you're right

prisma wave
#

i dont have anything against you making APIs but i feel like the time would be better spent at this current point in time

jovial warren
#

fair

ocean quartz
#

This would look better than clickEven = ...

component {
    text("Hello! I am text!") {
        ...
        openURL("https://example.com")
        showText("Hello! I am hover text!")
        ...
    }
}
jovial warren
#

trying to think if that'll work

#

also, that kinda raises a bit of ambiguity

ocean quartz
#

Don't see why it wouldn't work
And how? lol

prisma wave
#

the supposed "type safe DSLs" that can't even check you don't have duplicate click events 🤣

jovial warren
#

yeah the DSL is changing lol

#
textComponent("Hello! I am text!") {
    text("I am a child!")
}
#

annoying arrows (kinda) =

jovial warren
ocean quartz
#

Because it makes a lot of sense to open a url when hovering

lunar cypress
#

I like your version better

jovial warren
#

who's?

ocean quartz
#

Then do it like adventure does

text("Hello! I am text!") {
    ...
    clickEvent(openUrl("https://example.com"))
    hoverEvent(showText("Hello! I am hover text!"))
    ...
}
jovial warren
#

also, just thought about the fact that because these are vars, that means you can reassign the colour, formatting, insertion, click event and hover event multiple times

jovial warren
ocean quartz
#

I guess preference

jovial warren
#

I mean, I can add those functions if you want them lol

ocean quartz
#

No lol

jovial warren
#

¯_(ツ)_/¯

#

hmm

#

maybe I could make openURL an infix fun

prisma wave
#

sick to death of hearing about "kotlin's DSLs are so good! so type safe!! so flexible!!" bro if u cant even stop me from setting the same thing twice go back to school 😃

ocean quartz
#

That's ugly imo

lunar cypress
#

don't just slap infix somewhere because it looks cool at first glance

jovial warren
#

¯_(ツ)_/¯

#

just making suggestions

prisma wave
#

infix functions should require backticks

#

that would be a good idea

lunar cypress
#

when in doubt it only complicates things because it's not made to be used like this

jovial warren
#

click `open url` "https://example.com" lel

ocean quartz
#

Infinx is better for only small things like something in "message" or something is Object etc, putting a lot of infinx in the middle of your code will make it more complex than needed

jovial warren
#

yeah

prisma wave
#
10 `div` 3```
lunar cypress
#

and not just because you want to omit some parentheses

jovial warren
#

isn't the entire purpose of infix functions to omit parentheses though?

lunar cypress
#

no

#

its purpose is to make a binary operation infix

prisma wave
#

suffix fun x() 😃

jovial warren
#

lol

surreal quarry
#

prefix fun

prisma wave
#

that would be a good addition to the kotlin language

jovial warren
#

that's called an extension function lel

prisma wave
#

normal functions are already prefix 🥲

surreal quarry
#

we need the modifier

prisma wave
#

true

#

to be more explicit!!

lunar cypress
#

and
openUrl: click * string -> Unit is simply not a sensible operator

jovial warren
#

the entire purpose of Kotlin is to be less explicit

lunar cypress
#

the first arg is only aesthetics even

jovial warren
#

yeah it really isn't

prisma wave
#

how to handle data reloading whilst maintaining immutability

#

inject a Provider<T>?

#

seems easy

#

but there could be pitfalls

stuck harbor
#

animal crossing pitfalls

prisma wave
#

MapConfig contains Map<String, GameMap>... MapManager constructor takes a MapConfig... what if we do /plugin reload? should MapConfig update? make a new MapManager?? mutable fields?

#

this is a genuine question

stuck harbor
#

ImmutableFactoryConstructorGetter.java

prisma wave
#

tnx

stuck harbor
#
while (true) {
 Map<Brister, Mitten> eeee;
}
lunar cypress
#

Lifetime of your objects begins with onEnable and ends with onDisable don't you agree

stuck harbor
#

...oui?

static zealot
#

I not do yes agree

prisma wave
#

Can't get a serious answer to anything these days

#

I see how you guys feel when I make a "joke"

static zealot
#

xD

lunar cypress
#

that was a serious answer

#

but ok

prisma wave
#

Oh was it

#

MapManager lasts while the whole plugin is running, yes

#

Creating a new MapManager isn't particularly easy since it's injected to other components that also last the whole time

jovial warren
#

AbstractMapFactoryBuilderProvider

lunar cypress
#

you're writing a library though, right?

prisma wave
#

Kinda

#

Does it matter?

lunar cypress
#

I mean a bit, yes

#

but why is it hard to create new objects

jovial warren
#

Unsafe#allocateMemory xD

ocean quartz
lunar cypress
#

Whereever this is used, it's most likely initialised in onEnable by creating an Injector

#

so what's the issue if you do that again

#

there's nothing special to handle

prisma wave
#

Well for example one of the Command classes has a MapManager injected, if I made a new one I'd also have to update the Command

lunar cypress
#

but... that's how it's done in every spigot plugin, no?

#

you create everything in onEnable

prisma wave
#

Uh

stuck harbor
#

yes everything

lunar cypress
#

and Guice doesn't care about state, it's just a dependency graph

#

Could you perhaps make an example to illustrate the issue

old wyvern
#

He means with an explicit reload command I think?

prisma wave
#

yeah

#

Not /reload

#

If I had a command to just reload configs

#

I don't have a way of actually updating all of the components with the new config

old wyvern
#

No idea tbh, never used guice

prisma wave
#

This isn't a guice specific thing

#

It would be the same problem with manual injection

old wyvern
#

Wasnt the issue with not having access to an injector?

lunar cypress
#

Then I see the issue even less

prisma wave
#

Ok let me make an example

old wyvern
#

sure

lunar cypress
#

You have one MapConfig binding and in your reload command you mutate it?

prisma wave
#

Ideally I don't want to mutate it

#

I'd rather create a new MapConfig

#

But I guess keeping the mutation in the data class isn't bad

lunar cypress
#

Guice does everything ahead of time so there's not much you can do

#

And besides that restriction is a bit hard considering you're working with Spigot

prisma wave
#

My problem is that if I did make a new MapConfig, I can't then update all of the other components without mutating their MapConfig field or making new components

#

I guess mutability in the POJOs isn't that bad

#

Just feels messy

old wyvern
#

Wouldnt the other components be recreated as well?

prisma wave
#

ideally not

#

They probably could be

#

But then I'd have to recreate the entire dependency graph again

#

Which seems overkill when reloading a single file

old wyvern
#

You could alternatively have a delegating MapConfig which basically stores an internal instance of a MapConfig and passes down all calls to that, then you'd only need to change that instance.

lunar cypress
#

those are your only two options really

prisma wave
#

yeah I considered delegation

#

I could probably do something with Guice providers there

#

Inject a Provider<MapConfig> and encapsulate that mutability into the provider implementation

lunar cypress
#

in effect

old wyvern
lunar cypress
#

but same in effect

prisma wave
#

No such thing as a stateless program 😔

lunar cypress
#

well it all comes down to how you model MapConfig

#

Imo there's no point in abstracting this kind of mutation away to some container in Java

#

especially if you implement it via a map (or something else mutable) anyway and there is no concurrency

prisma wave
#

the only issue with having MapConfig itself be mutable is that the instances are created by Gson

#

they're pretty much just typed wrappers of a json file

stuck harbor
#

yes I agree

#

I concur

prisma wave
#

so a mutable wrapper is probably easier, considering deserializing the new file contents will make a new instance anyway

stuck harbor
#

yes

prisma wave
#

ok

lunar cypress
#

well in that case yeah

prisma wave
#

okay cool

#

oh im so dumb i already had a solution for this

half harness
#

brister mitten

prisma wave
#

yes

surreal quarry
#

Sister Britten

jovial warren
#

when your maths is broken because of brackets 😐

#

converting RGB to a single integer is done like this: (red shl 16) or (green shl 8) or blue

#

but I was doing red shl 16 or green shl 8 or blue and wondering why I was getting a negative number lol

prisma wave
#

bitwise in kotlin is horrible

#

change my mind

jovial warren
#

I kinda like it

#

shl is more readable than << imo

#

I sometimes have to sit there and actually think about whether << is a left or right shift lol

prisma wave
#

yeah but the precedence is messed up

jovial warren
#

precedence?

old wyvern
prisma wave
#

doubt

old wyvern
jovial warren
surreal quarry
#

Bitwise always confuses me lol

prisma wave
#

theyre not that confusing

#

just not very useful

#

unless ur in a very specific situation

regal gale
#

Yeah...

surreal quarry
#

I think that’s the issue. I never use it so when I have to I need to look it up

#

And by have to I mean stackoverflow uses it but I need to modify it to fit my needs

regal gale
#

I don't like bitshift also

prisma wave
#

bitshifting is just multiplying by 2^n

#

or dividing

regal gale
#

It used to help me kind of way with chunk handling

#

Thank you my bot 👍

static zealot
prisma wave
#

🙄

static zealot
#

its a serious question

jovial warren
#

😐

static zealot
#

because second one is funny, but first one looks cool

jovial warren
#

god damn you

#

also, on the second one, that is proper zoomed

prisma wave
#

ima be honest i saw that coming

static zealot
#

any time you want

prisma wave
#

yay

static zealot
static zealot
prisma wave
#

😦

#

doesnt work with dark reader on btw

old wyvern
#

That looks dope

static zealot
#

btw its not mine xD

#

I just googled cool 404 pages

#

well the second one was my idea

old wyvern
#

still

static zealot
#

but the first one is just stolen xD

old wyvern
#

🤷

static zealot
#

yeah I think I'll change it back

old wyvern
#

Add attribution I guess?

static zealot
#

attribution?

surreal quarry
#

blitz first one for 404 page

#

rick roll for other things

static zealot
#

yeah I think I'll stay with that. and make a wiki for rick roll

#

xD

surreal quarry
#

wiki soon™️

old wyvern
static zealot
#

oh problem is idk the author. this one is on a few websites

#

couldn't find who actually made it

old wyvern
#

lol

surreal quarry
#

if you have a wiki and don’t have fpprank what’s the point of having a website

old wyvern
#

then just ignore tit I guess

#

no issues probably

static zealot
#

yeah because I think it was on w3schools as well or something like that. also it said "FREE" specifically for some reason

static zealot
#

is that what you 2 have?

surreal quarry
#

mines guides but yea lol

static zealot
#

yeah seen it

surreal quarry
#

it’s very useful

prisma wave
#

very very useful

static zealot
#

anyone wanna borrow me their code? xD

prisma wave
#

so many people helped!

surreal quarry
#

great for helping others in this so called “HelpChat”

#

blitz i use BMs

prisma wave
#

yes

#

open source

static zealot
#

BM is yours on github?

prisma wave
#
  • a docker image
half harness
prisma wave
#

😍

surreal quarry
#

it’s a docker thing

#

just run it lol

half harness
prisma wave
#

git clone, docker run

#

i think

#

something like that

surreal quarry
#

you gotta build the image

#

then run

#

but yea

prisma wave
#

yea

static zealot
#

oh I see. some ADVANCED stuff xD

surreal quarry
#

docker build -t bm/fpprank .

prisma wave
#

docker is easy

ocean quartz
#

Very good read me and about

prisma wave
#

and very useful

surreal quarry
#

docker run —name fpprank -p blah:blah bm/fpprank
i forget what ports are exposed

old wyvern
#

docker run docker

surreal quarry
#

something like that

prisma wave
#

thank you

old wyvern
#

rm -f ~

prisma wave
#

i added a readme

ocean quartz
#

Lol i found an issue with Ktor, using CIO server the locations become http://0:8080/location instead of http://localhost:8080/location, with Netty or Jetty it works fine

jovial warren
#

dis why Jira exists xD

ocean quartz
#

Already reported fingerguns

static zealot
#

lmao BM.

jovial warren
#

also, isn't writing tests so fun

surreal quarry
#

yes?

#

if you don’t enjoy unit testing your code

#

then i won’t speak to you ever again

old wyvern
jovial warren
#

yeah but the repetition lol

#

writing tests is kinda boring

#

having the tests work is nice though

surreal quarry
#

i’m joking lmao

surreal quarry
old wyvern
#

🥲

#

anyway gn now, dead tired

prisma wave
#

gn

#

poor guy

static zealot
#

wait there's a chrome extension called AdFly Skipper

#

and the AdFly website is broken. nice. is this the end of AdFly?

jovial warren
#

also, no matter how much people argue about whether Java or Kotlin is better, everyone must be able to agree that being able to write test methods with spaces in them makes Kotlin better for writing tests

surreal quarry
#

time to make my own adfly

static zealot
#

👍

ocean quartz
#

Kotlin + Assertj is great

jovial warren
#

what's assertj?

#

I just use built-in assertions lol

prisma wave
#

yeah you know what's nice for unit testing? a functional programming language

ocean quartz
ocean quartz
#

Has a bunch of useful things too, like between, similar, greater, etc

static zealot
#

hmm

surreal quarry
#

that’s nice

static zealot
#

seems useless tho

#

xD

ocean quartz
#

Why?

static zealot
#

because I have no use for it

surreal quarry
#

it’s the same as like assertEquals or something it seems but it might be more readable

ocean quartz
#

I mean it's unit testing lol @static zealot

#

I find it more readable yeah, but at the end of the day it's the same thing

static zealot
#

damn he hit me with the edit ping

jovial warren
#

looks pretty nice

#

I don't really need it though, since all I use is assertEquals with two strings lol

#

also, maybe generating a random username by generating random bytes and converting that to a UTF-8 string wasn't the brightest of my ideas

#

and also because it seems that kotlinx.serialization can sometimes struggle dealing with Unicode

#

it converted the first character to \u001c for literally no reason

ocean quartz
onyx loom
#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

half harness
#

why do some ppl use ```java
for (;;)

steel heart
#

Why not

half harness
#

what does it do

ocean quartz
#

Basically while (true)

steel heart
#

Basically while (true)

#

Lol

ocean quartz
#

Lmao

half harness
#

then why dont they use while (true)

steel heart
#

It’s shorter init?

half harness
#

ok

ocean quartz
#

They'll compile to the same thing, people use the one they find more readable

prisma wave
#

For loops are just syntax sugar for while loops

#

Not necessarily

tough gull
#

Why do while do loops exist

half harness
#

who knows

prisma wave
#

do while

tough gull
#

what's the point

#

Im deprecating them

half harness
#

do {

} while (true)

prisma wave
#

They're useful in a few situations

half harness
tough gull
#
while(true) {
}
do {
} while (true)
#

wtf is the point

half harness
#

its just reversed

static zealot
#

execute the code once

#

even if condition is not met

prisma wave
#

In that example they're useless

static zealot
#

very usefull sometimes

half harness
#

OH

static zealot
#

instead of repeating the code

#

from the while loop once

tough gull
#

o

half harness
#

do while loops are useful

#

now that i know that

obtuse gale
static zealot
#

well they're more of a don't repeat code type

half harness
#

Instants are also useful

#

is using epoch second time good for storing times?

tough gull
#

System.currentTimeMillis() grr

half harness
#

but

obtuse gale
#

yes, but Instants give you more flexibility

half harness
#

what about system restart

#

or different system

#

i want it to be universal

#

also

prisma wave
half harness
#

anyone know why y my code doesn't work

#

1 sec

#

lemme givse more ifno

obtuse gale
#

I'm saving a hasNext I previously checked

static zealot
#

I love while(true) loops tho

half harness
#

deleted

#

wrong channel

#

oops

ocean quartz
#

Yes

half harness
#

oops i forgot to delete that

#

;-;

jovial warren
static zealot
#

used to crash the pcs at school like that. they had like 2gb of ram lmao

onyx loom
#

i sure do love stack overflows

static zealot
#

a classmate was like, wanna see something cool? I was like sure, he just made an infinite loop sending some random 0s and 1s on the screen until it blue screened

#

I was like: cool teach me

#

and just started doing it xD

half harness
#

oh my

#

isn't that considered malicious

#

🚨

obtuse gale
#

an infinite loop sending some random 0s and 1s on the screen

#

malicious

#

lol

prisma wave
#

u can go to jail for that!!

half harness
#

!!!11!!1!! call the police!!

ocean quartz
#

Oh boy that reminds me of the day my class took down the school network by ddossing it from every computer in the class fun times

static zealot
#

yeah we used to crash other's PCs because they were all connected

hot hull
#

I mean computers here legit have root access to the network, which is kek

onyx loom
#

oh god

hot hull
#

Half the pcs have crash programs installed on them

hot hull
#

Legit one big kek

onyx loom
#

yeah we could shut others computers down from our computers too

ocean quartz
#

We only had access to our own drive z

static zealot
#

oh we didn't have access but a few of us knew the administrator password xD

hot hull
#

Yea but noone will do anything cause ain't nobody care enough, also 90% of the people don't even know how to use a fucking pc

half harness
prisma wave
#

admin access

#

for the primitive windows users

jovial warren
#

in Linux, there is literally nothing you cannot do with root

#

root is what is called the "superuser"

#

it has no regard for permissions. literally none.

ocean quartz
#

We had Linux Mint in our computers, it's pretty bad

#

Some had Ubuntu which was much nicer

winter iron
#
private fun applyAmountPlaceholder(scrapAmount: Int) : String =
    NAME.replace("{amount}", scrapAmount.toString()).color()

private fun applyAmountPlaceholder(scrapAmount: Int) : String {
    return NAME.replace("{amount}", scrapAmount.toString()).color()
}
#

Which is more readable

#

id say 2nd

#

but i like first

jovial warren
#

also, when you waste time with custom serialisers without realising that default serialisers can do a much better job than you can lol

distant sun
#

noob as usual

prisma wave
winter iron
#

yuh 😦

#

if it was a 1 liner

jovial warren
#

also, you should read Kotlin official conventions

#

fun myFunction() : String big ew

#

you're not meant to have a preceding space, probably to differentiate inheritance from type declaration

ocean quartz
winter iron
#

with parameters i do it as var: type

jovial warren
#

what in the name of fuck

#

is that Matt

ocean quartz
jovial warren
#

also, I guess I can't really talk, my code is a mess lol

ocean quartz
#

Official docs

jovial warren
#

anyone know how to remove new lines from a raw string btw?

prisma wave
#

don't put newlines

#

Or just replace

ocean quartz
#

What would you say is better, 2 repositories on github one for backend and other for frontend or one repository with both? thonking

prisma wave
#

probably 1 for both

jovial warren
#

nvm, fixed it lol

prisma wave
#

Unless it's in an org

jovial warren
#

trimIndent().trimMargin().replace("[\n\r]".toRegex(), "") seemed to do it lol

ocean quartz
#

Oh god

jovial warren
#

dw, only for testing purposes

#

wrote a data class's toString as a raw string lol

prisma wave
#

You don't need to trim both an indent and a margin

ocean quartz
jovial warren
#

very nice

#

uniqueIndex

jovial warren
#

I need to first remove the indent, then remove the lead and trail whitespace, then remove new lines and carriage returns

prisma wave
#

so you don't need trimMargin

jovial warren
#

actually I don't even have any lead and trail whitespace lol

distant sun
#

How would one add bungee support for a plugin that uses mysql without redis or something like that to let the other servers that a valut was changed

jovial warren
#

PMC

#

and no, not Planet Minecraft

#

Plugin Messaging Channels

distant sun
#

Uhh that require a player connection =/

#

Which is probably not that bad

jovial warren
#

I mean, to send from Bukkit it does

#

to send from Bungee though, you require a ServerInfo instance

#

or a ProxiedPlayer instance iirc

#

you can send to both

#

the PMC is a mess though

prisma wave
jovial warren
#

really?

prisma wave
#

Plugin messages are sent over a player's connection

#

Yes

jovial warren
#

well then your only option is third-party messaging Gaby

#

a.k.a Redis, Kafka, RabbitMQ, etc.

ocean quartz
#

So actually interesting question
I allow login from 3 different providers so far (Github, Gitlab, Google), I get their email and register/log them in
But was thinking, if they register through github then login with google, they'd get access to the same account (same email), since I only accept verified emails that shouldn't be an issue right? thonking

distant sun
#

Is there any that doesnt require an installation

heady birch
#

Probably

#

Oauth or something isn't it

ocean quartz
#

Yeah

unkempt tangle
#

@prisma wave How would you rate lua? 10 to Kotlin?

prisma wave
#

I hear it's good

jovial warren
#

Lua is kinda ew ngl

#

but BM loves ew languages lol

unkempt tangle
#

My first confrontation with lua was at the PSP scene.

jovial warren
#

and when I say ew, I don't mean tolerable ew, like Kotlin ew, I mean whatever tf <$> .: is meant to be

unkempt tangle
#

Everyone tried to develop games with it.

jovial warren
#
function factorial(number)
  if n == 0 then
    return 1
  else
    return number * factorial(number - 1)
  end
end
```not a bad language
ocean quartz
# jovial warren what you making btw?

Right now is just for learning, still not sure if i'll make it a thing or not, but something similar to Crowdin, for handling language files for plugins

jovial warren
#

but kinda over verbose

prisma wave
jovial warren
#

seems legit

prisma wave
#

Ok I will explain for the third time

jovial warren
prisma wave
#

.: is from a specific library and looks good in the context it's designed to be used in. <$> is almost definitely designed to replicate the mathematical symbol whilst being easy to type

jovial warren
#

fair

#

still big ew

prisma wave
#

If you're gonna say Haskell is trash get some actual evidence

jovial warren
#

that came from Haskell?

prisma wave
#

Rather than "these specific symbols are ugly"

#

yes?

jovial warren
#

also, Haskell's not bad, it's just kinda ugly

prisma wave
#

Where did you think it was from

jovial warren
#

I don't mind ugly languages though so I can't really say shit

prisma wave
jovial warren
#

not actually that bad I suppose

#

has its uses

prisma wave
#

Haskell is great

lunar cypress
#

:OMEGALUL:Caml is also great

prisma wave
#

I prefer MSCaml

#

I mean F#

distant sun
#

What symbol is <$> lol

lunar cypress
#

it's for people who are scared of parens

prisma wave
#

I believe that is the operator for mapping a functor

#

An alias to the fmap function but infix

#

I think

#

Something like that

distant sun
ocean quartz
prisma wave
#

ima be honest I think most of the standard kotlin code is unbelievably ugly

#

Ktor, Exposed, the compiler

#

It's all a mess

ocean quartz
#

I actually like how ktor looks, but exposed is very ugly

prisma wave
#

not even a good ugly

prisma wave
#

don't take my words out of context you cretin

prisma wave
#

One thing I have noticed is that it's a lot easier to write messy kotlin code than it is java

#

Because it's not as strict

#

If you wanna do something in java you pretty much have to follow some design pattern

#

Whereas kotlin doesn't particularly care about that

lunar cypress
#

kotlin simply has a lot of syntax

prisma wave
#

Yeah but I mean on a larger scale

#

I am starting to see why people would prefer java though

#

Kotlin is more productive but it becomes hard to read and manage at scale

lunar cypress
#

I disagree

prisma wave
#

Oh?

ocean quartz
#

I think a well written large scale Kotlin is easier to read than a Java one, the issue with Kotlin is when people start making it too complex for no reason
For example Bardy's idea of using infix

prisma wave
#

Yeah maybe that's the reason, people tend to want to abuse kotlin's features

#

To try and make things more "idiomatic"

ocean quartz
#

Since there isn't really good guidelines like Java has, people do what they feel most of the times

prisma wave
#

Yeah

#

I think there's an Effective Kotlin book

#

But I'm not sure it's any good

ocean quartz
#

Yeah i think so, was released last year, I remember watching a conf of the writter

prisma wave
#

might be worth a read

heady birch
#

too bad I do not even know what IdioMatic even means

lunar cypress
#

I just think it's a bit silly to say that Kotlin is harder to manage at scale considering it's so close to java

#

if anything it's just as hard

#

because I think we can all agree that most of Kotlin's additions are good and do not introduce new scalability issues

prisma wave
#

Yeah I'm not denying they're more productive

#

I think what I'm trying to say is that it's easier to write messy code in kotlin

heady birch
lunar cypress
#

I think it's as easy as writing messy code in Java, but it's easier to write Kotlin-specific inconsistent code

tough gull
#

Could someone tell me the difference between continue and break?

steel heart
#

continue doesn’t break a loop

#

It just moves to the next item in the iteration

tough gull
#

Oh sick

#

That's what i've always wanted them

steel heart
#

break is used to prevent switch cases falling through and breaking loops

#

(:

half harness
#

ahh im stupid 🤦

tough gull
#

instead of disgusting nested if statements

steel heart
#

Lol

prisma wave
obtuse gale
#

Hi
I have a problem i don't know where ask my question, i will ask here
When i download the faction expansion, she's not detect with a papi reload. If someone can help me please ?

surreal quarry
obtuse gale
#

Thanks

jovial warren
surreal quarry
#

iomadict

jovial warren
#

can you spell, James?

forest pecan
#

Jams

#

BombBradyGazer

#

PeanutBeat02

jovial warren
#

change your username back from whatever tf that is lol

forest pecan
#

Nah

jovial warren
#

whoever u =

prisma wave
#

what is idiomatic

jovial warren
#

not you

prisma wave
#

genuine question

#

considering streams and higher order functions are now in java, is using first class functions everywhere idiomatic?

#

could java become a functional language?

jovial warren
#

¯_(ツ)_/¯

#

oh also, anyone here figured out how to stop IJ saving empty indentations btw?

#

like when you leave a gap you have to manually delete the whitespace to push it back

steel heart
prisma wave
#

im not getting carried away

steel heart
#

Not so?

prisma wave
#

just contemplating

#

if we can express something in a language, is it necessarily idiomatic?

#

what defines idiomatic?

steel heart
#

Your thoughts are getting carried away then perhaps? :0

prisma wave
#

¯_(ツ)_/¯

#

maybe

steel heart
#

Java imperative oop is nice

#

Makes more sense

#

Not to mention I can’t get a good grip of composition

prisma wave
#

composition isn't that hard

#

you do it in imperative languages too

steel heart
#

Hmm I think that is the design I tried in react

prisma wave
#

blah(other(s)) is composition

steel heart
#

It made me hella confused

prisma wave
#

do you mean function composition?

steel heart
#

Yeah

#

That’s probably it

prisma wave
#

well there's also composition that's an alternative to inheritance

jovial warren
#

imagine a purely declarative language

steel heart
#

Lol

jovial warren
#

that would be omega ew

prisma wave
#

there are many purely declarative languages

jovial warren
#

control flows

prisma wave
#

what do you mean by control flow

steel heart
#

Tbf angular is the way

prisma wave
#

because if/else is fine in declarative languages

steel heart
#

var x;
if (y) x = z else z = t

#

I like mutations

prisma wave
steel heart
#

the ones that causes trouble are the better ones

prisma wave
#

and side effects are inherently imperative

#

logic programming languages like Prolog are probably the closest you can get to purely declarative

steel heart
#

I get declarative and functional is nice but so is oop and imperative?

prisma wave
#

i guess imperative can be nice in a modern language

#

i.e something like Go

#

im just bored of java lol

steel heart
#

Yeah, just started learning react typescript jsx shit and damn I want to go back to java so badly

lunar cypress
#

Java will not become a functional language

#

You can of course be unorthodox

#

Clojure was written that way

#

but first class functions aren't really a thing

prisma wave
#

yea i'm just playing devil's advocate really

winter iron
#

What sort of frameworks would i need in order to build a website, front-end with basic backend (Like simple calcluations)

#

what sort of technology i am looking for

#

im thinking just webstorm with CSS HTML and JavaScript to do my calculation stuff

#

but would i need something like react or Node.js or are they primarily for more complex things

prisma wave
#

you could probably do it all on the client side

#

with just html css and JS

surreal quarry
#

might want to consider react

prisma wave
#

React is nice for bigger sites

surreal quarry
#

its a good framework

prisma wave
#

probably overkill for a single page

winter iron
#

few pages, low traffic

#

simple calculations

#

just multiplication

#

basically

#

so i wouldnt really need any frameworks right

surreal quarry
#

probably not

steel heart
#

Maybe just write from scratch unless you want to learn react or smtng

#

Then why not try it out

prisma wave
#

are you making this just for learning?

#

or is there a practical use

winter iron
#

i guess both

frigid badge
#

vue is pretty easy even for tiny sites

prisma wave
#

yeah vue is good

winter iron
#

its for my uncles business, just a simple front-end for some contact information

#

and a calculator

#

to do math stuff

steel heart
#

Angular poggies

winter iron
#

all these frameworks are mainly used to have some sort or client-server interaction right?

#

I dont really need it if thats the case

steel heart
#

No I think react and vue are just javascript frameworks sorta?

surreal quarry
#

they help with "reactivity"

steel heart
#

Like for building webapps and websites

#

And angular ofc my baby

surreal quarry
#

like react gives you access to stateful components that you can change the state of when certain things happen (nice for calculator potentially)

prisma wave
#

depends on the framework

surreal quarry
#

but it can also be accomplished without a framework

prisma wave
#

Vue is only about the View, i.e the UI

#

Angular and React are the full MVC afaik

steel heart
#

React also has so many extensions or libs whatever it’s called which is absolutely fantastic

winter iron
#

the fuck is MVC

steel heart
#

Probs the case for vue and angular as well

prisma wave
#

Model View Controller

winter iron
#

Isee

#

I feel like i should defo use some framework in case they want future stuff added

#

and i like the word angular

surreal quarry
#

i really enjoyed using nextjs

prisma wave
#

react is possibly nicer than angular

surreal quarry
#

very similar to react but faster load times, server side rendering and stuff

prisma wave
#

ive not used either much but react is based on FP rather than OOP

#

so it's sexier

steel heart
#

Wow

#

Wow

#

No

#

Well anyway you should use typescript

#

Very nice

surreal quarry
#

you can use TS with any of these frameworks lol

winter iron
#

hmm

steel heart
#

Yeah

surreal quarry
#

all JS is valid TS

prisma wave
#

use Elm

winter iron
#

doesnt Java have some sort of framework for backend stuff?

surreal quarry
#

elara/js

prisma wave
winter iron
#

any good?

#

i wont end up using it

prisma wave
#

depends

ocean quartz
#

Spring prolly

prisma wave
#

Spring is useful but almost definitely overkill here

steel heart
#

Spring lol factoryfactory

prisma wave
#

🥲

winter iron
#

whats the best way to make a front end would be my next question?

#

just going in with html and csss

#

or some sort of web builder

steel heart
#

Depends

#

If you care about speed

prisma wave
steel heart
#

DIY Ig

prisma wave
#

learn how to do it the hard way

surreal quarry
#

learn it yourself

frigid badge
#

vue ez

ocean quartz
#

Tbh the only Java one i know is spring xD
If you want to do Kotlin instead, Ktor

steel heart
#

Wordpress is nice sometimes

frigid badge
#

pick whatever you want

winter iron
#

Ktor

#

😮

prisma wave
#

waiting for Ding Boot to make an impact on the industry

#

any second now

surreal quarry
#

tf is that

steel heart
#

Elara web application and website framework when?

prisma wave
#

elara's web framework

#

that doesn't exist yet

surreal quarry
#

lmao

prisma wave
#

but it'll be great once it does

surreal quarry
#

nice

steel heart
#

Yes indeed

prisma wave
#

every startup will instantly switch to Ding

winter iron
#

i shall wait for Elara then

prisma wave
#

ok great 😃

winter iron
#

🙂

steel heart
#

() => Unit

#

This would be correct in kotlin right

prisma wave
#

-> in kotlin

steel heart
#

Oh

#

Same thing blah blah blah

surreal quarry
prisma wave
#

coming soon

#

any second now

steel heart
#

@ocean quartz is ktor good like with react?

surreal quarry
#

ktor & kotlin-react-app fingerguns

steel heart
#

Hmm might try kotlin instead of nasty tsx

ocean quartz
#

Really like it so far yeah

steel heart
#

Okay then that’s a yes for me

#

Let’s migrate

surreal quarry
#

honestly kotlins html syntax didn't look to appealing to me, but it might be better than I think

prisma wave
#

DSLs are overrated

lunar cypress
#

Barely anyone uses that I think

#

I kinda want to finish this simple web project I had. So far I've done it in plain HTML/CSS/JS, I wonder how I would migrate to something like react

prisma wave
#

rewrite it in CoffeeScript

#

it's the next big thing dude!!

lunar cypress
#

for example how do you incorporate data from the backend? Right now I use a template engine for html rendering on the backend but apparently all those frontend frameworks do that too

obtuse gale
#

anybody know if theres a way to code/run visual basic on mac?

lunar cypress
#

might be a dumb question

prisma wave
#

yeah i think you'd have to be querying an API

#

rather than server side rendering

lunar cypress
#

hmm I see

#

that's effort

prisma wave
#

indeed

#

that's what's discouraged me from trying them out in serious applications

frigid badge
#

there are loads of libraries for it though

#

if you use a json api specification

#

you can abstract all the requesting away into a frontend orm

#

using a library

lunar cypress
#

definitely too much effort to migrate but I will try it in the future

prisma wave
#

i wanna learn either rust or haskell properly

#

any suggestions?

#

kinda tempted to try and make another mc server impl

#

hard to think of project ideas that don't involve mc

steel heart
#

Make chess

frigid badge
#

lmfao imagine your future employer reading your ideas/repos

prisma wave
#

Boring

frigid badge
#

mc this, mc that, mc this

prisma wave
#

Code is code

frigid badge
#

so uh... do you do anything not mc related?

prisma wave
#

I made a fake wiki site that sends people to functional language websites

#

Any employer would love that

steel heart
#

lmfao

prisma wave
#

But non MC stuff is usually boring

#

I've never felt the desire to make a website ever

steel heart
#

yeah mc is nice to work with

#

bruh autocorrect

prisma wave
#

Lol

steel heart
#

Tbf I would create websites and webapps more if I could wrap my head around react

lunar cypress
#

There's really nothing special about MC

#

unless you're really into the game itself

prisma wave
#

I'm not lol

#

I barely play it

lunar cypress
#

If you want to write a server so badly just take some other server protocol

prisma wave
#

True that could be cool

lunar cypress
#

Something smaller that you will actually get done

prisma wave
#

Like xmpp or something?

lunar cypress
#

anything, honestly

prisma wave
#

or an http server from scratch

#

That could be fun

lunar cypress
#

or write an emulator for something

#

if you want to go low level

prisma wave
#

ooo these are cool ideas

#

Like an ARM VM or something?

#

Or emulator

lunar cypress
#

whatever you like

prisma wave
#

yea I'm just thinking out loud here

lunar cypress
#

I imagine some older console or something could also be fun

prisma wave
#

I wouldn't even know where to start there

#

Is there documentation on stuff like that?

#

Have people reverse engineered them enough to actually know how they worked

#

This is more MC related but one of those "making minecraft in a week" ideas sound cool

lunar cypress
prisma wave
#

Okay

#

That could be cool

lunar cypress
#

Although that's already quite a lot

prisma wave
#

I think I wanna learn more about low level stuff, OpenGL and things so maybe that would be good

#

Maybe implementing a simple language in C or something

#

Like a Lisp or Basic or something

lunar cypress
prisma wave
#

👀

#

looks fun

#

Ugh there's so much I wanna learn more about

#

Do you just learn stuff in school or do you actively teach yourself?

lunar cypress
#

you, as in, me?

prisma wave
#

yeah

#

Or anyone else lurking

half harness
#

i'm working a bot/plugin with someone else and they use maven 😬

prisma wave
#

🥲

half harness
#

and im trying to shade in my lib

#

and

#

usahdiuashd

#

i hate maven

#

like 1000 lines to put shade plugin

lunar cypress
#

Most of what I'm doing I'm teaching myself

#

School didn't do much other than getting me started

#

And sometimes stuff I learn about inspires me to try some things

prisma wave
#

ic

lunar cypress
#

For example when we were taught low level machines in basics of computer science I wrote an emulator for the model we used

prisma wave
#

That sounds cool

lunar cypress
#

And now I want to make a language with a formal spec because there's a lot about languages right now

prisma wave
#

Makes sense

#

Do you have a routine you use for learning new languages or do you just try it out?

lunar cypress
#

usually my motivation to learn something new comes from a different source than just pure curiosity

#

So I do tend to have an application where I want to use it directly

prisma wave
#

I see

lunar cypress
#

But I always start by just reading the official docs nowadays

prisma wave
#

Fair enough

lunar cypress
#

for example I wanted to learn Rust because I wanted to use this i18n framework written in Rust in Java

#

Or rather I thought it would be cool to make bindings to it

prisma wave
#

Oh yeah I think I remember you talking about that

oak raft
lunar cypress
#

that it did

oak raft
#

I meant the game 😛

quiet depot
#

that phrase also heavily applies to the game rust

oak raft
#

hahaha

prisma wave
#

Yeah I guess I have way too much curiosity with no actual direction at the moment

lunar cypress
#

as for the programming language this turned out to be a terrible entry point however

lunar cypress
prisma wave
#

I'm not sure I'm at the idea phase yet

#

I wanna learn Prolog for example but I have no idea what it's even used for

#

It just sounds cool though

lunar cypress
#

fair enough

prisma wave
#

But yeah that's a good tip for other situations

lunar cypress
#

reminds me I have to update my gh readme again to not lose track

half harness
#

BRISTER MITTEN_ _

#

😠

prisma wave
#

?

half harness
#

u

#

you are months

#

overdue

#

for the tutorial

prisma wave
#

hehe

#

Yeah

steel heart
half harness
prisma wave
#

I promise I'll have another look once this round of commissions is done

#

Might start over from scratch

half harness
prisma wave
#

Keep the slides but rerecord everything I mean

half harness
#

ohh ok

prisma wave
#

Do u think I should be more like enthusiastic

steel heart
#

Basically copycat fireship but spigot edition

prisma wave
#

Yes

#

Fireship is so good

half harness
prisma wave
#

He has such a nice voice

steel heart
#

The video layouts are the best

prisma wave
#

Ikr

steel heart
#

Thumbnails holy duck

prisma wave
#

They're really well structured

prisma wave
half harness
#

o

#

then what did u mean?

prisma wave
#

I'm not sure how to explain

steel heart
#

BM was depressed last time recording obv

half harness
#

oh

steel heart
#

Emo bm

half harness
#

wot

#

Hey guys!
Today we're going to learn some super awesome java coding!!
wOOOhoOOOOOOOOO

#

no-

prisma wave
#

Yes I did sound very dead

half harness
#

Hey guys! Brister Mitten here!
Today we're going to learn some java!
epic

prisma wave
#

Cuz I was trying to be professional lol

half harness
prisma wave
#

I will rerecord in my normal voice I guess

#

Rather than trying to sound super serious

steel heart
#

Mr BM Oracle Employee 20 years Web Enterprise knowledge and 50 CS degrees

half harness
#

Hi**.**
We will learn java today**.**

prisma wave
#

Also does anyone here have a Mac that would be willing to record a jdk install guide that I'd narrate over

steel heart
#

I gave mine away sadly

prisma wave
#

Shame

steel heart
#

Depends

prisma wave
#

i guess macos peasants will have to follow the Linux guide and use a bit of common sense

steel heart
#

Lmao

surreal quarry
#

i blew mine up

#

sorry

prisma wave
#

They should be pretty similar anyway

#

😔

steel heart
#

Just draw your own mac ui in mspaint

#

And then explain

prisma wave
#

good idea

#

I'd use a VM but they're super laggy and probably illegal

regal gale
#

What's up Youtube *oof* and welcome back to another video, and here we have the best lesson *wow sound* to cheer your day *yey sound*

surreal quarry
#

it should be pretty similar to linux

prisma wave
#

Yeah sdkman is on macos I think

#

So in theory it's the exact same

surreal quarry
#

ye

regal gale
#

That's definition of most cringe youtuber these days ._.

steel heart
#

lol

half harness
#

anyone good with linux?

prisma wave
#

Define good

half harness
#

whats the command to show list of screens

prisma wave
#

all the screens running?

surreal quarry
#

screen -ls

half harness
#

There is a screen on:
2238.pts-0.raspberrypi (02/17/2021 07:11:10 PM) (Attached)
1 Socket in /run/screen/S-pi.

#

uh

#

how do I open it?

surreal quarry
#

screen -rd name

#

but you are attached already

#

ctrl a ctrl d to detach

prisma wave
#

yeah you're already in it

half harness
#

oh lol

#

I didn't know

#

[screen is terminating]
pi@raspberrypi:~ $ screen -ls
No Sockets found in /run/screen/S-pi.

#

um

surreal quarry
#

you terminated the screen

#

so no more

half harness
#

oh

surreal quarry
#

screen -S name to start one

half harness
#

i thought it was screen -R

#

ohh wait

surreal quarry
#

talking abt different things. its screen -S name to start one

half harness
#

alright

#

I can't believe I just terminated the screen 😫

surreal quarry
#

just restart it

#

noob

prisma wave
#

bro just install KDE and VNC in

#

Ez

half harness
#

[detached from 2266.bot]

#

done

surreal quarry
#

use docker

#

smh

half harness
#

what is docker for

prisma wave
#

My bad

jovial warren
#

Imagine still using screen in 2021 ew

prisma wave
surreal quarry
#

run linux inside docker inside docker inside your raspberry pi

jovial warren
#

tmux > screen

surreal quarry
#

docker > everything

#

respectfully

prisma wave
#

No need for screen when you have a docker container!!

half harness
#

lol my javafx build.gradle is 66 lines long

#

so long

surreal quarry
#

short

half harness
#

o

surreal quarry
#

my build.gradles average 327 lines

half harness
#

WHAT

surreal quarry
#

/s stoopid

jovial warren
#

Screen isn't in RHEL anymore because it's codebase is dog shit

#

Tmux was chosen over it

half harness
#

mainClassName = 'me.dkim19375.mcservercreator.MCServerCreatorMain'

#

the very start

#

of my project

surreal quarry
#

Okay

#

.

half harness
#

lol

jovial warren
#

What does that project do

half harness
#

it generates mc server files

#

for lazy ppl