mio.chanAvatar border
TS
mio.chan
The Lounge Programmer #176
Spoiler for Trit Lounge sebelumnya ::


28 Juli 2015

emoticon-I Love Kaskus
KASKUS
The Lounge— PROGRAMMER#176


Rules :
  • Kaskus General Rules >> http://www.kaskus.co.id/about/general_rules
  • Dilarang posting pornografi
  • Dilarang posting berbau SARA yang dapat memicu pertengkaran / perpecahan
  • Dilarang bertengkar atau memancing emosi kaskuser lain
  • Harap menyikapi sesuatu dengan bijak
  • Dilarang nge-junks
  • Dilarang posting jualan
  • Dilarang posting lowongan kerja, sudah ada thread nya sendiri buat penawaran lowongan kerja
  • Dilarang ...




Diubah oleh mio.chan 07-09-2016 02:34
nona212
nona212 memberi reputasi
1
497.5K
10K
Thread Digembok
Mari bergabung, dapatkan informasi dan teman baru!
Programmer Forum
Programmer ForumKASKUS Official
20.2KThread4.2KAnggota
Tampilkan semua post
lunanAvatar border
lunan
#4042
Immutable
+ No thread locks
+ Fast read and lookup
- Bad for objects that highly mutable (increase memory usage everytime it mutates)

Mutable
+ Fast for highly mutable objects
+ Low memory footprint
- Thread locks

Where you use immutable/mutable depending on the objects and pattern utilized. Functional and Math programming requires immutability on all objects to ensure consistency with parallel execution. Object Oriented apps rarely needs immutability since object is reused over and over with high mutability.

1 very clear example of mutability : Try playing games and imagine if all the objects is immutable, including interaction between objects (player on terrain, player vs player, gravity simulation, etc) and if this immutable, how do you deal with the number of objects generated everytime it mutates.

1 example for immutabilty : Math calculation that can be break down and spread across multiple parallel threads (calculating/simulating)
0
Ikuti KASKUS di
© 2023 KASKUS, PT Darta Media Indonesia. All rights reserved.