Page 1 of 3 123 LastLast
Results 1 to 15 of 34

Thread: Informatica/programmazione

  1. #1
    NelloDominat's Avatar
    Join Date
    Sep 2007
    Location
    Montreal - Canada
    Posts
    7.093

    Default Informatica/programmazione

    riferimento:
    http://www.reddit.com/goto?id=8d586

    D: Quale espressione per l'incremento e' comunemente utilizzato dai programmatori e Web developers?

    1) Variabile++
    2) Variabile = variabile+1

    Mi potete dare anche una spiegazione?
    poiche' mi ricordavo forsse la 1) ma per alcuni test universitari in US compare quello che vedete. Grazie




  2. #2
    Lieutenant Commander Mosaik's Avatar
    Join Date
    Dec 2004
    Location
    Roma
    Posts
    9.724

    Default

    E' tutta una questione di abitudine ma diciamo che "variabile = variabile + 1" è piu' standard forse ... o meglio sei sicuro che in qualsiasi linguaggio tu stia scrivendo funziona...

    Variabile++ ad esempio in ASP o VB (Pre .net ovviamente) non funzionano

  3. #3
    Lieutenant Commander Rayvaughan's Avatar
    Join Date
    Mar 2005
    Location
    45.663989,8.783906
    Posts
    17.274

    Default

    lol che domanda vaga... comunemente in tutti i linguaggi c oriented (li fa riferimento anche a web dev, quindi c'includiamo anche il java) la sintassi più usata perchè si fa prima ed è più compatta è variabile++....

    aveva più senso una domanda del tipo "qual'è la differenza tra var++ e ++var"

  4. #4
    Hador's Avatar
    Join Date
    Mar 2004
    Location
    Milano
    Posts
    31.321

    Default

    ma che cazzo di domanda è, uno usa quel che gli pare.
    per fare buona programmazione è "meglio" usare la due (come è meglio non mettere su una riga più dichiarazioni di variabili ad esempio) ma per motivazioni di stile non di altro.
    c'è da dire che v++ nn ha lo stesso significato di ++v in alcuni linguaggi e quindi puoi far casino.

  5. #5
    Lieutenant Commander Mez's Avatar
    Join Date
    Sep 2003
    Location
    Milano
    Posts
    6.607

    Default

    $var++

  6. #6
    Lieutenant Commander Bakaras's Avatar
    Join Date
    Apr 2004
    Location
    Roma
    Posts
    9.562

    Default

    chiede:
    "which is the one most commonly used "

    considerato che var++ non funzia in tutti i linguaggi, mi sembra ovvia la risposta.

    Once upon a time....
    Bakaras Night elf Warrior DragonLance on WOW server DAGGERSPINE
    Bakaras Fjellstorm Nordic healer 4lx Guildmaster DrL on Daoc server Lancelot
    Bakaras Fjellstorm Troll skald 6lx Guildmaster DragonLance on Daoc server Vortigern
    Viridian Fjellstorm Nordico healer 4lx Guildmaster Dragonlance on Daoc server Vortigern

    Quote Originally Posted by peluche View Post
    quindi burino e onesto...mai pensato di farla finita?

  7. #7
    Tanek's Avatar
    Join Date
    Apr 2004
    Location
    Milano, Midgard
    Posts
    11.225

    Default

    Si ok Baka, ma resta una domanda del cazzo, no? :P
    Non so in che tipo di esame fosse, ma è a mio avviso palesemente stupida

    Tanek™: Game Designer & Algorithm Mastermind, Team Leader & SW Engineer and Dungeon Master!
    "Datte Foco"™ and "Ma KITTESENCULA"™ are registered trademarks of Tanek Entertainment Inc.
    ‎"One of these days, scientists will discover that second X chromosome contains nothing but nonsense and twaddle." - Sheldon Cooper
    Per non dimenticare:
    Spoiler


  8. #8
    Lieutenant Commander Rayvaughan's Avatar
    Join Date
    Mar 2005
    Location
    45.663989,8.783906
    Posts
    17.274

    Default

    dalla domanda sembrerebbe un esame ecdl

    oh ma che è sto smile nuovo... cioè old!

  9. #9
    Lieutenant Commander Bakaras's Avatar
    Join Date
    Apr 2004
    Location
    Roma
    Posts
    9.562

    Default

    Quote Originally Posted by Tanek View Post
    Si ok Baka, ma resta una domanda del cazzo, no? :P
    Non so in che tipo di esame fosse, ma è a mio avviso palesemente stupida

    E' una domanda del cazzo perchè non è previsto che tu conosca le abitudini dei programmatori di tutto il globo per poter stilare una statistica

    btw ti assicuro che in tanti anni ne ho viste di peggiori

    Once upon a time....
    Bakaras Night elf Warrior DragonLance on WOW server DAGGERSPINE
    Bakaras Fjellstorm Nordic healer 4lx Guildmaster DrL on Daoc server Lancelot
    Bakaras Fjellstorm Troll skald 6lx Guildmaster DragonLance on Daoc server Vortigern
    Viridian Fjellstorm Nordico healer 4lx Guildmaster Dragonlance on Daoc server Vortigern

    Quote Originally Posted by peluche View Post
    quindi burino e onesto...mai pensato di farla finita?

  10. #10
    Chief Petty Officer
    Join Date
    Jan 2004
    Location
    Trento
    Posts
    1.127

    Default

    Si, domanda del cacchio... io uso var++ nei cicli o simili e sulle variabili temporanee, mentre la seconda e' piu' elegante... ma ovviamente il linguaggio deve permettertelo!
    Jeff
    "I'm not a stranger, I'm just a friend you haven't met yet"
    "il bello degli ingegneri è che hanno sempre una dote non sfruttata che un’altra parte di mondo avrebbe usato per guadagnarci i milioni. L’ingegnere no, fa calcoli. Fenomenale."
    "This program had an unexpected end. What I have to do? [R]etry, [I]gnor or [C]ancel?" "C[a]re a saw"

  11. #11
    Lieutenant Commander Ercos's Avatar
    Join Date
    May 2004
    Location
    Asdolandia!
    Posts
    19.586

    Default

    var++ ftw

  12. #12
    Tanek's Avatar
    Join Date
    Apr 2004
    Location
    Milano, Midgard
    Posts
    11.225

    Default

    Quote Originally Posted by Jeff View Post
    Si, domanda del cacchio... io uso var++ nei cicli o simili e sulle variabili temporanee, mentre la seconda e' piu' elegante... ma ovviamente il linguaggio deve permettertelo!
    Jeff, il tuo quote sugli ingegneri in firma mi sembra troppo ironico

    Tanek™: Game Designer & Algorithm Mastermind, Team Leader & SW Engineer and Dungeon Master!
    "Datte Foco"™ and "Ma KITTESENCULA"™ are registered trademarks of Tanek Entertainment Inc.
    ‎"One of these days, scientists will discover that second X chromosome contains nothing but nonsense and twaddle." - Sheldon Cooper
    Per non dimenticare:
    Spoiler


  13. #13

  14. #14
    Lieutenant Commander Ercos's Avatar
    Join Date
    May 2004
    Location
    Asdolandia!
    Posts
    19.586

    Default

    Quote Originally Posted by Hador View Post

  15. #15
    Lieutenant Commander Verci's Avatar
    Join Date
    Apr 2004
    Location
    Gallarate
    Posts
    8.540

    Default









    no aspetta... sono pure io un ingegnere...
    Actually:
    DAoC: off, forever...
    ReaLife: on? oh really?
    Work: slave...

    Puppatemelo aoe

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[Output: 102.60 Kb. compressed to 87.39 Kb. by saving 15.21 Kb. (14.83%)]