« first day (2699 days earlier)      last day (2253 days later) » 

9:14 PM
What are some benefits of having mutable and immutable variables in Kotlin?
 
some you can change and others you can't
 
> benefits
 
@TristanWiley You can rest assured that a val won't be modified by another thread.
 
you make things immutable when you don't want them to change, you make things mutable when you expect them to change
val's not immutable btw
it's just read only and even that's not 100% true
 
You can't reassign it
 
I'm trying to sum it up for a presentation
 
327
A: If immutable objects are good, why do people keep creating mutable objects?

Péter TörökBoth mutable and immutable objects have their own uses, pros and cons. Immutable objects do indeed make life simpler in many cases. They are especially applicable for value types, where objects don't have an identity so they can be easily replaced. And they can make concurrent programming way sa...

 
Hm, so for my TL;DR
> "Immutable variables make life easier by ensuring your variable will not be reassigned. Meanwhile, mutable variables allow you to update your variables and objects"
 
Hmmm
I kinda like it
but something is bothering me
 
9:21 PM
it doesn't go beyond the obvious on the mutable ones
 
> "Immutables are a pipe dream for the incompetent, they are a crutch for programmers who cannot handle the awesome power of mutable variables nor basic concepts of mutli threading. It will never be a thing, just like Milhouse will never be a meme."
 
I'm keeping my presentation basic, but what else would you add?
 
a truly immutable object needs to be replaced everytime you make a change, this adds a degree of certainty, that you know what you're working with, exactly, at all times
but it's slow
 
It's expensive to create objects
also, it's kind of an overhead to the GC
 
tbh you can get the same benefits of immutable objects by locking a mutex, making a copy and releasing the mutex
but then you have locks and people don't like locks
 
9:27 PM
Good point.
 
I feel like what I have is good enough for a basic presentation
 
Are you gonna present deez?
 
I could leave out the TL;DR and just leave it as "one can be reassigned and one can't"
Yes
 
DEEZ NUTS
got eem
okay I'm 14 and I'm going back to work now bye
 
@TristanWiley You're right
 
9:29 PM
I mean most people won't care about the details of how it actually works, and it's a basic intro presentation.
 
You have a promising career in politics ahead of you
 
hahahahaha
 
Welp, time to find food
Good luck Tristan, you can do it
<3
 
9:32 PM
@AdamMc331 plz respond
When you can <3
 
ha, suckers, you can have truly immutable values in Swift
iOS > Android confirmed
 
rofl
 
In my mind, cannot reassign != immutable
For example, if a class has setters and a reference variable cannot be reassigned, you can still call the setters to modify the object's state.
 
9:48 PM
the Swift compiler will complain if you try modifying fields on a value type property declared with let
yea totally agree CA
 
@TimCastelijns AndroidBot will survive, it doesn't actually log in. It piggy backs on a manual login
 
 
2 hours later…
11:39 PM
so we got a 3d printer in the office today
we've already printed a dickbutt
 
My 3D printer never worked :(
It caught fire the first time I started it
 
lmao
 
I just finished putting it together, turned it on, and boom. Power supply on fire
It surged the current so much the circuitboard's heat sinks had thermal paste melt and leak out
 
yikes
we got ours used for $500 from someone who didn't want it anymore
works perfectly
 
11:49 PM
gross Raghav, cover up, have you no shame?
 
Why do you think it's an access controlled room?
So glad I bought a regular printer in uni
Have an assignment due in an hour, don't need to walk to the ends of the Earth to print it
Best $30 spent so far
 
it would be kind of weird to print homework with a 3d one tbh
 
I guess it would make sense if you were studying architecture or something
 
we had free printing in all the computer labs and there was like 5 throughout the campus so I never needed one
we had special CS only computer labs with super beefy computers, that was nice when the peasant labs were full of normies
 
We have plenty of printers, but it's like 10 cents a sheet for Black and white and 20 cents a sheet for colour
The assignment I just printed would have cost me a dollar
 
11:53 PM
that's annoying
 
So if I turn in 30 assignments more I'm already ahead
 
except printer ink probably does cost 10 cents a sheet tbh
 
Probably not for the enterprice laser printers though
 
for yours though
 
Hmm. Maybe I should have bought a scale
Hard to draw graphs without a scale
I guess the Surface Pro can be used a scale
 
11:55 PM
@DaveS hahahahaha
 
I don't actually need measurements, just straight lines
At UNC it was much easier
We had printers in the CS dept. that didn't charge your account if you printed directly to the IP instead of going through the uni system
 
Plus, I can't trust uni printers to print private keys and stuff
They almost definitely cache/log data
 
@MehdiB. lol
 
That's why I bought the Canon printer without wifi and any fancy stuff
It's a simple USB printer on which I can flush memory
 

« first day (2699 days earlier)      last day (2253 days later) »