http://asawicki.info/ Programming, graphics, games, media, C++, Windows, Internet and more...
The Virtual Reality of Code
In my opinion, coding is a virtual reality with its own set of rules unlike in the physical world. In physical world, each thing has its specific location at the moment, things don't appear or disappear instantly, we have laws of energy and mass conservation. Inside a computer, we have data in memory (which is actually linear - 1D) and processors, processes and threads executing instructions of a program over time.
I have been trying for years to imagine some nice way editing or at least visualizing code, which would be more convenient (and look more attractive) than the text representation we all use. I am unsuccessful, because even if we render some nice looking depiction of a function code, its instructions, conditions and loops, drawing all the connections with variables and functions that this code uses would clutter the image too much. It's just like this virtual world doesn't fit into a 2D or 3D world.
Movie depiction of computer programs is often visually attractive, but far from being practical. This one comes from "Hackers" movie.
Of course there are ways of explaining a computer program on a diagram, e.g. entity diagrams or UML notation. I think that electrical diagrams are something in between. Electrical devices end up as physical things, but on a diagram, the shape, size and position of specific elements doesn't match how they will be arranged on a PCB. Logical representation and electrical connections between them is the only thing that matters.
Today it occured to me that this virtual reality of code also has "dimensions", in its own sense. It's evident when learning programming.
1. First, one has to understand control flow - that the processor executes subsequent instructions of the program over time and that there can be jumps caused by conditions, loops, function calls and returns. It's called dynamic aspect of the code. It can be depicted e.g. by UML sequence diagram or activity diagram.
I still remember my colleague at university who couldn't understand this. What's obvious to every programmer, was a great mystery to him as first year's computer science student. He thought that when there is a function above main(), instructions of that function are executed first and then instructions of the main function. He just couldn't imagine the concept of calling one function from the other and returning from it.
2. Then, there is so called static aspect - data structures and objects that are in memory at given moment in time. This involves understanding that objects can be created in one place and destroyed in another place and at later time, that there may be a collection of multiple objects (arrays, lists, trees, graphs and other data structures), objects may be connected to one another (the concept of pointers or references). Various relationships are possible, like one-to-one and one-to-many. In object-oriented methodologies, there is another layer of depth here, as there are classes and interfaces (with inheritance, composition etc.) and there are actual objects in memory that are instances of these classes. It can be depicted for example by entity diagram or UML class diagram.
3. Finally, one has to learn about version control systems that store history of the code. This adds another dimension to all the above, as over successive commits, developers make changes to the code - its structure and the way it works, including format of data structures it uses. Branches and merges add even more complexity to it. GUI apps for version control systems offer some way of visualizing this, whether it's showing a timeline with commits ("History") or showing who and when commited each line of a file ("Blame").
There is even more to it. Source is organized into files and directories, which may be more or less related to the structure of contained code. Multithreading (and coprocessing e.g. with GPU, SIMD, and all kinds of parallel programming) complicates imagining (and especially debugging!) control flow of the program. Program binaries and data may be distributed into multiple programs and machines that have to communicate.
It fascinates me how software is so multidimensional in its own way, while so flat at the same time (after all, computer memory is linear). I believe that becoming a programmer is all about learning how to imagine, navigate and create stuff in this virtual reality.
|Excellent article! Being new to learning C++, and while having gathered a lot of the basic concepts of coding and OOP in general, lacked a cogent and concise high level view of the different dimensions those pieces might exist in. |
The short holistic view of programming and its underlying infrastructure presented here was the perfect summation of all the small details I've learned about, but tying them together in a single thought form, and making them much more real.
Thank you for the introduction to a dimensional vision of coding, I'll definitely be printing this for the memorization clipboard.
|beautiful www.nike-air-max.ca things www.bottega-veneta.us.com to www.michael-kors-outlet-online.us.org read www.swarovskijewelry.com.co more, www.oakley.org.es look www.michael-kors-outlet.us.org for www.michaelkors-uk.org.uk a www.oakley-sunglasses-canada.ca long www.oakleysunglasses-cheap.in.net time, www.ugg-boots-australia.com.au I www.ugg-boots.ca felt www.michael-kors-australia.com.au closer www.chanelhandbags.net.in to www.coco-chanel.com.de reality www.ralph-laurenoutlet.ca very www.asicsgels.de far away, www.toms-shoes.net.co life www.burberryoutlet-canada.ca is www.michael-korshandbags.org.uk short, www.weddingdressesuk.org.uk if www.rayban-sunglasses.us.org put www.louis--vuitton.org.uk too www.rayban.com.de much www.nikefree5.net time www.michael-kors.com.co is www.nikefactory.org spent www.new-balance.ca on www.converse.com.de practical www.burberry-outlet.net.co things, www.bebeclothing.in.net really www.kate-spade.in.net is www.oakley-sunglasses.mex.com a waste of www.jimmy-chooshoes.com life, www.nike-air-max.com.se but www.nike-free-run.de some www.louisvuitton-outlets.us things, www.tommy-hilfiger-online-shop.de but www.michaelkorsoutlet-online.ar.com if www.true-religion.com.co the raw www.the-northfacejackets.us.com flavor, leisure www.airjordans.us goods airmax.shoesoutlet.us.com for gossip, www.replicarolex-watches.us.com so www.burberry-handbags2016.in.net I www.hermesbirkin-bag.net love www.michael--kors.us.com romantic www.longchamp-bags.us.com dreamer, www.yoga-pants.ca but www.mcmhandbags.com.co I www.oakley--sunglasses.com.au love airmax.misblackfriday.com real www.ralphlaurenoutlet-online.us.com life.Day www.outlet-burberry.net.co in www.pandora-charms-canada.ca a www.ralphlaurenoutletonline.us.org hurry, www.ralphlaurenpolos.in.net took www.coach-factoryyoutletonline.net all www.ray--ban.ca the www.designer-handbagsoutlet.us.com joy www.ugg-australia.com.de and www.guccishoes.com.co sadness, a lot www.tiffany-jewelry.net of www.retro-jordans.com things, www.marcjacobs.us.com not www.coachblackfriday.com enough time www.jimmy-choos.com to www.nikeair--max.fr recall, Chaoyang uggaustralia.misblackfriday.com July, www.ralph-lauren.com.au early www.pandora.com.de June www.soft-ballbats.com already www.abercrombie-fitchsale.com covered www.adidas-superstar.de confused. Season www.guccishoes-uk.co.uk removed, www.michael-kors-handbags.us.com landscape www.burberrybags-outlet.com transformation, the www.tiffany-andco.us.com so-called www.adidas.com.se forever www.pandora-charms.org.uk always far-fetched, www.guccishoes.in.net time, www.tomsoutlet-online.com not www.soccer-shoes.us.com to www.pulseras-pandora.com.es be www.mizuno-running.net squandered, www.the-north-face.ca the www.rolexwatchesforsale.us.com true www.nikeskos.dk meaning www.ray-ban-outlet.us.com of www.ralphs-lauren.co.uk life is to www.louisvuitton.so enjoy www.uggsoutlet.com.co the www.adidas.org.es good www.coach-factoryoutlet.net.co in the www.handbagsoutlet.net.co flat, www.ralphlaurenoutletonline.in.net I www.timberlandshoes.net.co Dimei www.cheapuggboots.us.com fireworks, www.burberry-handbagsoutlet.com.co also www.instylers.us.com read www.salomon-schuhe.com.de the www.coachoutletstore.net.co leisure, www.prada-shoes.com.co with a www.katespadeoutlet.gb.net touch www.nike-roshe-run.de of www.tiffanyand-co.net.co ink, www.ray-bansunglasses.net painting www.nike-schoenen.co.nl a www.harrods-london.co.uk thin www.oakley-outletstore.in.net clear www.abercrombie-fitchs.us.com Huan, www.coach-factory.in.net look www.cheap-oakleyglasses.us.com lush www.nikestore.us green, www.jordanretro.org covered www.timberlands-paschere.fr with www.mkoutletonline.us.com mottled www.polo-ralph-lauren.de wall. www.coachoutletstore-online.com.co This July, www.juicycoutureoutlet.net.co I www.uggboots.net.co kept www.ralphlauren-polos.co.uk the www.nikemercurial.in.net book's www.oakley.com.de swoosh; www.timberlandbootsoutlet.us.com this www.uggs-onsale.net July, www.hermesbags.jp.net I www.christian-louboutin-shoes.ca dream in www.oakleysunglass-outlet.net Lijiang; www.christianlouboutinshoes.jp.net this www.nike-air-max.us July, www.bcbg-dresses.com and has www.newbalance.com.es been www.thenorthface.com.de well, www.maccosmetics.gr.com not www.zxcoachoutlet.com made www.lululemonoutlet.gb.net sad.If you www.longchamp.com.de can www.ralphslauren-outlet.co.uk do www.reebok.com.de if www.adidas-superstar.nl a www.uggs.co.nl light www.oakleys-sunglasses.us.com breeze right www.eyeglassframes.in.net woman, placed in www.abercrombie-and-fitch.us.com the www.giuseppezanotti.com.co text www.michael-kors.com.es soul, www.nikestore.com.de written www.supra-shoes.org imprint www.michaelkors.so of www.gucci-shoes.net life, www.eyeglassesonline.us.com write www.nike-maxfr.com thin www.omegarelojes.es cool www.abercrombieand-fitch.ca and www.ghdhair-straighteners.co.uk clear www.oakleyoutlet.ar.com Huan, www.ralphlauren-polos.com.co occasionally www.longchamp.com.co write supra.shoesoutlet.us.com love, www.chanel-bags.com.co but www.polo-outlets.com.co never give www.raybans-sunglassesoutlet.in.net love, keep www.tommy-hilfiger-canada.ca a www.nike-rosherun.nl clear www.adidas-schuhe-online.de gel www.coachhandbags2016.us.com Bay, www.ralphlaurenoutlet.us.com look www.montblanc--pens.in.net for www.cheapoakley-sunglasses.com a www.canada-goosesjackets.us.com parts www.nike--freerun.co.uk of the peace, www.rolex-watches.us.com the joy www.michaelkorsoutletonline-sale.us.com and www.mcm-bags.in.net sorrow www.rayban-sunglassesoutlet.co.uk of all www.oakleys-glasses.us.com his www.toms-shoes.com.co writings, www.louis-vuittonoutletcanada.ca and www.polooutlets-store.com text www.hollister-clothing.in.net only www.hogan.com.de affair www.louboutin.jp.net has www.juicycouture.com.co nothing www.cheapmichaelkors.us.org to do www.coco-chanels.us.com with www.nikeair-max.es the www.ugg-bootsclearance.com other.Morning www.nike.org.es time, www.celine-bags.org with www.tnf-jackets.us.com a www.giuseppe-zanotti.net tranquil www.uggsaustralia.com.co and www.rayban-wayfarer.in.net contented www.coach-purseoutlet.net Zen www.hollister.us.org cloud water, www.poloralphlaurenoutlet.net.co eyes www.nikerosherun.us closed, www.prada.com.de the www.tommy-hilfiger.co.nl heart www.burberry-outletonlinesale.in.net distant www.lauren-ralph.co.uk exile, Wind www.cheap-michaelkors.com and www.uggs.in.net Smoke www.nikefree-run.net curl www.cheap-jordans.net in the www.ralphlaurenepolo.com mountains, www.nike-huarache.nl such www.cheap-nike-shoes.net as www.truereligionjeans.net.co Dai, www.guccihandbags.net.co ups www.fashionclothes.us.com and www.adidas--canada.ca downs, www.christian--louboutin.in.net indeed, www.truereligion-outlet.com.co like www.burberry2016.co.uk a www.ugg-boots.us.org thread, www.montres-pascher.fr the www.ray-banocchiali.it ups and www.raybans.us.org downs www.tomsoutletonline.net of www.uggboots.com.de life, www.guccioutlet-sale.in.net with www.truereligion-outlet.us.org long www.lululemon-australia.com.au Qingyuan . www.longchampoutlet.com.co Flowers followed www.babyliss-pro.us.com the www.kate-spade.gb.net road, facing www.polos-ralphlauren.us.com the www.hollisters-canada.ca sun www.tommy-hilfigeroutlet.com slowly www.salvatoreferragamo.in.net forward, then the www.christianlouboutinoutlet.net.co mind www.chi-flatiron.us.com is calm, www.air-huarache.co.uk quiet www.thejoreseproject.com as www.nikefree-run.org.uk the www.rayban.org.es lake, the www.hermes-outlet.com.co water www.asics-outlet.us.com peach, www.abercrombie-hollister.nl flower www.swarovski--uk.me.uk with www.louisvuitton.jp.net water, www.uhren-shop.com.de just www.ghd-hairstraightener.net like www.burberryonlineshop.de the www.iphone-cases.net.co fate www.converse.net.co of www.toryburchsale.com.co this www.cheap-baseballbats.net world, www.jordan-shoes.com.co do www.bcbg-max-azria.ca not www.rolexwatches-canada.ca ask www.christianlouboutinshoesoutlet.org why, www.the-northface.net.co regardless airhuarache.shoesoutlet.us.com of www.chiflatiron.net.co come www.nike-skor.com.se and www.burberrys-outlet.co.uk go, www.tommyhilfigeroutlet.in.net only flowers www.converse-shoesoutlet.com need www.beatsbydre.com.co to www.michael-kors-canada-outlet.ca remember www.hollister-abercrombie.com.se Lu www.levisjeans.com.co Qing, www.thenorth-faces.co.uk Yue www.tiffanyandco-canada.ca possessor of www.swarovski-australia.com.au the www.marc-jacobs.us.com green www.ugg-uggboots.net heart, cool www.air-max.com.de count. www.coachoutlet-online.com.co Sunlight www.thomas-sabo.com.de penetration mist, www.beats-by-dre.com.co alluding www.oakleyoutlet-online.us.com on www.burberryoutlet2016.us.com the www.tocoachoutlet.com lake, www.new-balance-schuhe.de the www.cheapoakley-sunglasses.in.net water www.michaelkorsbags.us.org green, www.pradahandbags.net.co clear, www.mmoncler-outlet.com sparkling, www.toms-shoesoutlet.net on www.omega-watches.us.com the www.replica-watches.com.co beach, www.tiffany-andco.com.au there www.newbalance-outlet.org are www.insanity-workout.us.com birds www.p90xworkout.us.com flying www.abercrombie-kids.us.com over www.gucci-taschen-outlet.de from www.adidasshoes.top time www.soccer-shoesoutlet.com to www.moncler-outlet.us.org time, www.pumashoes.in.net the www.rolex-watch.me.uk sky www.swarovski-online-shop.de blue www.converse-shoes.net and www.michaelkors.co.nl empty, www.lululemoncanada.ca with a quiet www.burberryoutlet-sale.in.net life www.swarovskicanada.ca after www.nfl-jersey.us.com ups www.nike-shoes-canada.ca and www.ralphlaurenonlineshop.de downs, this time www.nike-shoesoutlet.us.com the www.vans-shoes.net heart www.toryburchoutlet-sale.us.com is www.louisvuittons.com.co close www.mcm-handbags.org to www.pumaonline-shop.de nature, www.toryburch-sandals.in.net without www.pandorajewelry.top the www.louis-vuitton-taschen.com.de slightest www.thomas-sabos.org.uk ripples, www.michael-kors.net.co content with this www.nike-schuhe.com.de quiet www.burberry-outletstore.net and www.northfaceoutlet.com.co peaceful. www.toms-outlets.us.com An www.vans-schuhe.com.de end, www.newoutletonlinemall.com wins www.edhardy.us.org the www.cheapjerseys.com.co snow www.mk-outlet.us.com lotus, www.rosheruns.us world www.mcmsworldwide.com clarity, www.ralph-laurens.org.uk years www.nike-tnrequinpascher.fr of www.louisvuitton-outlet.com.co silence, www.tory-burchshoesoutlet.net the www.hollisteronlineshop.com.de heart www.michaelkorsoutlet.ar.com is www.vans-shoes.co.uk also www.airmax-2015.org safe.Time, www.scarpe-hoganoutlets.it very www.rosherun.org.uk long. I www.airmax-90.org know, www.beats-headphone.com.co I www.replica-handbags.net.co can stay www.longchamps.us.com in www.ferragamo.com.co my www.bottegaveneta-bagsoutlet.com mind there www.hollisterclothingstore.org are www.michael-kors-taschen.com.de limitations, not www.nike-air-max.com.au the www.barbour-factory.com majority, www.toms--outlet.com.co can only www.rayban.co.nl rely on www.christian-louboutinshoes.com.co these www.louis-vuittonblackfriday.com words to memory.Time, www.cheap-raybans.com is very www.yoga-pants.net.co short. www.nike-air-force.de I www.cheapjerseys.us.org understand, www.michaelkors-outlet-online.com.co you www.longchamp-handbagsoutlet.us.com can www.woolrich-clearance.com never www.tomsshoes-outlet.us.com forget so www.cheapshoes.com.co little, www.longchamphandbagsoutlet.net so www.pandorajewellery.com.au I nike.shoesoutlet.us.com was www.mcmbags.net in www.designerhandbagsoutlet.net.co such www.pradaoutlet.com.co a www.tiffany-und-co.de manner www.nike-roshe-run.com.es so as www.thenorthfacejackets.net.co to www.horloges-rolex.nl leave www.louis-vuitton-australia.com.au some www.tommy-hilfiger.com.de more.Youth, www.basketballshoes.com.co is very www.christianlouboutin.org.uk long. www.the-northface.com.co In www.gucci-outletstore.com life, www.jordanrelease-dates.us.com shiny www.ferragamoshoes.in.net people, www.michaelkors.com.se in www.beatsbydrdre.co.com fact, www.burberrys-outlet2016.com that www.calvin-kleins.us.com a figure, www.nikeshoesoutlet.org.uk how the passage www.valentino-shoesoutlet.us.com of www.airhuarache.co.uk time, www.michaeljordan.com.de or www.swarovski-crystal.us.com the www.nike-airmaxinc.co.uk whole www.canadagooses-2016.com dazzling www.coach-outletonline.net.co Love.Youth, www.tommyhilfiger.net.co is www.prada-handbags.com.co very www.nike-air-max.com.de short. www.cheaprayban.com.co In www.newbalance-shoes.org life, www.wedding--dresses.ca flickering www.barbour-jacketsoutlet.com days www.maccosmetics.net.co|