Salta al contenuto
0
  • Home
  • Piero Bosio
  • Blog
  • Mondo
  • Fediverso
  • News
  • Categorie
  • Recenti
  • Popolare
  • Tag
  • Utenti
  • Gruppi
  • Home
  • Piero Bosio
  • Blog
  • Mondo
  • Fediverso
  • News
  • Categorie
  • Recenti
  • Popolare
  • Tag
  • Utenti
  • Gruppi
Skin
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Predefinito (Nessuna skin)
  • Nessuna skin
Collassa

Piero Bosio Web Site

Forum federato con il resto del mondo. Non contano le istanze, contano le persone

gramundefined

gram

@orsinium@fosstodon.org
Informazioni
Post
4
Discussioni
1
Condivisioni
0
Gruppi
0
Da chi è seguito
0
Chi segue
0

Visualizza l'originale

Post

Recenti

  • @eclectechi use Aves Libre from FDroid.
    gramundefined gram

    @eclectech

    i use Aves Libre from FDroid. it has an editor with simple drawing.

    Senza categoria

  • Everything is beautiful in #golang:"Arrays have their place, but they’re a bit inflexible, so you don’t see them too often in Go code."What for and why they designed Array then?#scentmark
    gramundefined gram

    @petbrain

    [4]int is on stack, *[4]int is on heap. slices are powered by *[N]T arrays.

    using arrays directly is rare, that's the point. however, having them in the language is essential for the language to work.

    Senza categoria golang scentmark

  • Everything is beautiful in #golang:"Arrays have their place, but they’re a bit inflexible, so you don’t see them too often in Go code."What for and why they designed Array then?#scentmark
    gramundefined gram

    @petbrain

    a point in 3D space would be a struct{x, y, z int} but a vector in 100-dimension space would be [100]int.

    Senza categoria golang scentmark

  • Everything is beautiful in #golang:"Arrays have their place, but they’re a bit inflexible, so you don’t see them too often in Go code."What for and why they designed Array then?#scentmark
    gramundefined gram

    @petbrain

    1. arrays are allocated on stack, not heap. slices cannot be allocated on stack because their size is not statically known.

    2. array size is static and part of the type. taking a[4] from 2-element array is compilation error.

    3. a[0] on array usually produces faster and safer code because boundary check is static.

    4. arrays power slices.

    use arrays when all items are the same type and their number is known. you'll know when you can. for example, matrices in a 3D game engine.

    Senza categoria golang scentmark
  • Accedi

  • Accedi o registrati per effettuare la ricerca.
Powered by NodeBB Contributors
  • Primo post
    Ultimo post