Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • 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

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. Simple Optimization Trick

Simple Optimization Trick

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
70 Posts 49 Posters 47 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D [email protected]

    I went to college for Microbiology and became a programmer on my own after, so nope, never written a single line in assembly and never thought of checking it out either. Just never really crossed my mind. I might start messing with it soon.

    P This user is from outside of this forum
    P This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #38

    I... Don't recommend it. Rust if anything.

    It's a neat party trick? Helps you understand how a processor works? But for anything modern, it's way more work than it's worth.

    1 Reply Last reply
    3
    • A [email protected]

      Before Doom (1993), almost all games were assembly

      No? Not even close? Why is it people get away with saying such stupid things on the internet?

      F This user is from outside of this forum
      F This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #39

      Because it's true. Here's an article from Tim Sweeney from 2001:

      https://web.archive.org/web/20010105180900/http://www.gamespy.com/legacy/articles/devweek_c.shtm

      Mainstream application programmers switched to C in the early 80's. Game developers were slower to switch, because their small teams and focus on performance kept assembly language viable till the following decade. When id Software released DOOM, they surprised much of the industry by having no reliance on assembly code--despite excellent game performance, and by successfully cross-developing the game (in NeXTstep and DOS), then successfully porting it to an astounding variety of platforms.

      B B 2 Replies Last reply
      22
      • B [email protected]

        Before Doom (1993), almost all games were assembly.

        Carmack wrote Wolfenstein 3d in C. Star Control and Dune 2 were C.

        F This user is from outside of this forum
        F This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #40

        Those games didn't have the splash that Doom did for this sort of thing.

        https://web.archive.org/web/20010105180900/http://www.gamespy.com/legacy/articles/devweek_c.shtm

        Mainstream application programmers switched to C in the early 80's. Game developers were slower to switch, because their small teams and focus on performance kept assembly language viable till the following decade. When id Software released DOOM, they surprised much of the industry by having no reliance on assembly code--despite excellent game performance, and by successfully cross-developing the game (in NeXTstep and DOS), then successfully porting it to an astounding variety of platforms.

        E 1 Reply Last reply
        2
        • F [email protected]

          Animal Well was written in C without an engine and it was a decent hit (for an indie). Although that's definitely an exception, perhaps very similar to the RollerCoaster Tycoon example

          jumuta@sh.itjust.worksJ This user is from outside of this forum
          jumuta@sh.itjust.worksJ This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #41

          Wikipedia says cpp

          1 Reply Last reply
          4
          • H [email protected]

            This looks like a screenshot in the background of the C++ OpenRCT version because the resolution is too high and not supported by the original assembly release.

            K This user is from outside of this forum
            K This user is from outside of this forum
            [email protected]
            wrote on last edited by [email protected]
            #42

            The original goes to 1024 x 786 and has different zoom levels. I've played most of the original parks this year and that does not see to be too high res to me. Give me a sec I'll take a screenshot of mine in a minute.

            Edit here it is. It's the GOG version, which launches fullscreen, so the 1024 x 768 are stretched onto the center of my 1920 x 1080 screen.

            1 Reply Last reply
            3
            • maven@lemmy.zipM [email protected]
              This post did not contain any content.
              K This user is from outside of this forum
              K This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #43

              Hello everyone and welcome to another video.

              N 1 Reply Last reply
              15
              • D [email protected]

                I went to college for Microbiology and became a programmer on my own after, so nope, never written a single line in assembly and never thought of checking it out either. Just never really crossed my mind. I might start messing with it soon.

                K This user is from outside of this forum
                K This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #44

                If you're curious, I recommend this channel. It often delves deep into the code to explain stuff, as well as how the hardware works. Really fascinating!

                D 1 Reply Last reply
                0
                • F [email protected]

                  Because it's true. Here's an article from Tim Sweeney from 2001:

                  https://web.archive.org/web/20010105180900/http://www.gamespy.com/legacy/articles/devweek_c.shtm

                  Mainstream application programmers switched to C in the early 80's. Game developers were slower to switch, because their small teams and focus on performance kept assembly language viable till the following decade. When id Software released DOOM, they surprised much of the industry by having no reliance on assembly code--despite excellent game performance, and by successfully cross-developing the game (in NeXTstep and DOS), then successfully porting it to an astounding variety of platforms.

                  B This user is from outside of this forum
                  B This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #45

                  Focus on performance, wow, well the industry has certainly changed a bit.

                  N 1 Reply Last reply
                  6
                  • D [email protected]

                    I've never written a single line of code in assembly, and I'm now curious

                    addie@feddit.ukA This user is from outside of this forum
                    addie@feddit.ukA This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #46

                    I learned z80 assembly back when the cutting edge of technology was a ZX Spectrum, and 68k assembly when I upgraded to an Amiga. That knowledge served me quite well for my early career in industrial automation - it was hard real-time coding on eZ80's and 65c02 processors, but the knowledge transfers.

                    Back in the day, when input got mapped straight into a memory location and the display output was another memory location, then assembly seems like magic. Read the byte they corresponds to the right-hand middle row of the keyboard, check if a certain bit is set in that byte, therefore a key is held down. Call your subroutine that copies a sequence of bytes into a known location. Boom, pressing a key updates the screen. Awesome.

                    Modern assembly (x64 and the like) has masses of rules about pointer alignment for the stacks, which you do so often you might as well write a macro for it. Since the OS doesn't let you write system memory any more (a good thing) then you need to make system calls and call library functions to do the same thing. You do that so often that you might as well write a macro for that as well. Boom, now your assembly looks almost exactly like C. Might as well learn that instead.

                    In fact, that's almost the purpose of C - a more readable, somewhat portable assembly language. Experienced C developers will know which sequence of opcodes they'd expect from any language construction. It's quite a simple mapping in that regard.

                    It's handy to know a little assembly occasionally, but unless you're writing eg. crypto implementations, which must take the exact same time and power to execute regardless of the input, then it's impractical for almost any purpose nowadays.

                    D 1 Reply Last reply
                    1
                    • K [email protected]

                      Hello everyone and welcome to another video.

                      N This user is from outside of this forum
                      N This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #47

                      The YouTube algorithm works in mysterious ways.

                      Because I'm nice, to anyone who doesn't get the reference: https://www.youtube.com/@MarcelVos

                      1 Reply Last reply
                      9
                      • B [email protected]

                        Focus on performance, wow, well the industry has certainly changed a bit.

                        N This user is from outside of this forum
                        N This user is from outside of this forum
                        [email protected]
                        wrote on last edited by
                        #48

                        Performance is very much still a significant factor. At the end of the day, games are expected to run at certain FPS on certain machines. The machines have gotten better to the extent that unoptimized code can be used sometimes, but when competing for graphics, badly optimized games will have to sacrifice fidelity to hit performance targets, where well-optimized games can get squeeze out better graphics and hit those same targets.

                        There's plenty of tricks these days but optimized code will always have an edge.

                        1 Reply Last reply
                        2
                        • maven@lemmy.zipM [email protected]
                          This post did not contain any content.
                          M This user is from outside of this forum
                          M This user is from outside of this forum
                          [email protected]
                          wrote on last edited by
                          #49

                          Since it wasn't mentioned yet: https://openrct2.io/

                          L F 2 Replies Last reply
                          27
                          • F [email protected]

                            Those games didn't have the splash that Doom did for this sort of thing.

                            https://web.archive.org/web/20010105180900/http://www.gamespy.com/legacy/articles/devweek_c.shtm

                            Mainstream application programmers switched to C in the early 80's. Game developers were slower to switch, because their small teams and focus on performance kept assembly language viable till the following decade. When id Software released DOOM, they surprised much of the industry by having no reliance on assembly code--despite excellent game performance, and by successfully cross-developing the game (in NeXTstep and DOS), then successfully porting it to an astounding variety of platforms.

                            E This user is from outside of this forum
                            E This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #50

                            Those games didn’t have the splash that Doom did for this sort of thing.

                            I would say that Wolf3d would certainly count as proof of concept.

                            1 Reply Last reply
                            3
                            • D [email protected]

                              I've never written a single line of code in assembly, and I'm now curious

                              M This user is from outside of this forum
                              M This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #51

                              A little late to this comment but there are some assembly videogames out! They are puzzles and gives you the gist of how assembly works.

                              I really enjoyed TIS-100. I just never got around to beating it.

                              D 1 Reply Last reply
                              3
                              • M [email protected]

                                Since it wasn't mentioned yet: https://openrct2.io/

                                L This user is from outside of this forum
                                L This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #52

                                Best way to play till this day

                                1 Reply Last reply
                                6
                                • addie@feddit.ukA [email protected]

                                  I learned z80 assembly back when the cutting edge of technology was a ZX Spectrum, and 68k assembly when I upgraded to an Amiga. That knowledge served me quite well for my early career in industrial automation - it was hard real-time coding on eZ80's and 65c02 processors, but the knowledge transfers.

                                  Back in the day, when input got mapped straight into a memory location and the display output was another memory location, then assembly seems like magic. Read the byte they corresponds to the right-hand middle row of the keyboard, check if a certain bit is set in that byte, therefore a key is held down. Call your subroutine that copies a sequence of bytes into a known location. Boom, pressing a key updates the screen. Awesome.

                                  Modern assembly (x64 and the like) has masses of rules about pointer alignment for the stacks, which you do so often you might as well write a macro for it. Since the OS doesn't let you write system memory any more (a good thing) then you need to make system calls and call library functions to do the same thing. You do that so often that you might as well write a macro for that as well. Boom, now your assembly looks almost exactly like C. Might as well learn that instead.

                                  In fact, that's almost the purpose of C - a more readable, somewhat portable assembly language. Experienced C developers will know which sequence of opcodes they'd expect from any language construction. It's quite a simple mapping in that regard.

                                  It's handy to know a little assembly occasionally, but unless you're writing eg. crypto implementations, which must take the exact same time and power to execute regardless of the input, then it's impractical for almost any purpose nowadays.

                                  D This user is from outside of this forum
                                  D This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by
                                  #53

                                  Very interesting. Thank you. I may start looking into C instead. I'll still watch a couple of videos on assembly, just for the hell of it.

                                  1 Reply Last reply
                                  1
                                  • M [email protected]

                                    Since it wasn't mentioned yet: https://openrct2.io/

                                    F This user is from outside of this forum
                                    F This user is from outside of this forum
                                    [email protected]
                                    wrote on last edited by
                                    #54

                                    Holy fucking shit this is the best motherfucking news this year

                                    F 1 Reply Last reply
                                    2
                                    • K [email protected]

                                      If you're curious, I recommend this channel. It often delves deep into the code to explain stuff, as well as how the hardware works. Really fascinating!

                                      D This user is from outside of this forum
                                      D This user is from outside of this forum
                                      [email protected]
                                      wrote on last edited by
                                      #55

                                      This is a very interesting channel. Thank you

                                      1 Reply Last reply
                                      1
                                      • maven@lemmy.zipM [email protected]
                                        This post did not contain any content.
                                        H This user is from outside of this forum
                                        H This user is from outside of this forum
                                        [email protected]
                                        wrote on last edited by
                                        #56

                                        Have you seen the insane complexity of modern CPUs? Ain't no one hand coding that like a 6502 in 1985.

                                        M S 2 Replies Last reply
                                        13
                                        • M [email protected]

                                          A little late to this comment but there are some assembly videogames out! They are puzzles and gives you the gist of how assembly works.

                                          I really enjoyed TIS-100. I just never got around to beating it.

                                          D This user is from outside of this forum
                                          D This user is from outside of this forum
                                          [email protected]
                                          wrote on last edited by
                                          #57

                                          Oh, that's pretty cool. Thank you

                                          1 Reply Last reply
                                          1
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups