Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Can you think in computer code?

Author
Message
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th May 2012 15:07 Edited at: 14th May 2012 15:14
I read of new members asking for code, and when they type it in they don't know how it works. I'm glad I started programming in 1980 when you had to teach yourself. I can think in code, and run the code in my head without even typing it into the computer. When I said this on a science site, they didn't believe me, but I'm pretty sure that most of the TGC members can do it. I mean you must think of the code before you type it into the computer, and often it works the first time you type it.

Code is like another language.. say Japanese, and we are translating this language, and speaking in games. But when you think of Einstein, he was working in formulas that had to agree with the discoveries in the Universe. I find that a program is similar to doing that. The program in your head has to agree with a games universe, and often it has to agree with physics.

Like for example someone wanted a faster way to program Minecraft, and I could see it in my head. The poster thought that I had already written the code before. But I didn't need to. I can program, and run it in a sort of dream imagery.

So we can all think in code can't we?

WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th May 2012 15:38
This is weird because for the last few hours I was thinking the same thing. When I come up with ideas, the images and pictures of the code are in my head first before I start to type anything up. Debugging is all done in my head too. And I've been programming for approximately 30 years.

I was also thinking too that programming might actually be easier to learn than say learning another language, but I got myself confused at that point trying to figure out why.

The main part of teaching yourself programming is understanding algebra. Other math is only really required the further in depth you go into programming. Such as trigonometry which I've had to re-learn recently, and once I grasped it again I could picture what I wanted and then code it.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 14th May 2012 15:46
Sure, I think all programmers who are actually programmers visualize a problem, break into it's steps and code it out. Sometimes in 3 steps or sometimes all at once.

That said, I often solve programming problems away from the computer. On my way to or from work, when I'm going to bed, when I'm showering, etc... I can step through my own programs hours after I've last touched them to resolve a bug. It's kind of wierd.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 14th May 2012 16:12
I'm not sure that I think directly in code, maybe it's more like I'm fluent - like I tend not to have to think about code, like how if you are fluent in a language, you don't have to think about the words or pronunciation or anything, it just flows. Of course, if the code doesn't work, then I have to go think about it. Our subconcious has a lot to do with it - I mean I think about techniques all the time, how would I achieve a particular effect, how would a complex model work, that sort of thing. Then when it comes to programming that, I can usually go right ahead and start coding, only compiling once I'm done. It's scary sometimes how often it works on the first compile. It's not so much that the code is brilliant, because it's not, it's just code that gets the job done, usually gets improved or optimised later. But I've seen myself code an entire system from scratch without thinking about it much at all, knowing what needs done and knowing what the rules are, then it's like having a conversation in English with the interpreter... as if the programming language is just a tool in which our brain communicates, just like a spoken or written language - but we still have to convert the syntax.

I think it's something that you can only get with a lot of experience, a lot of thinking about how things are done in videogames, sleepless nights. Like instinct - old school instinct, just like a plumber who has been doing the job for 30 years can probably smell what the problem is before even looking, his subconcious has already been through all the options and solved them all - his concious only taking part when deciding how much to charge .

Did you study technical drawing Pincho?

I think that helped me a lot, I studied that all through high school. Being able to focus and decipher a complex object or idea in your head - the brain has to be trained to do stuff like that, but nobody really knows how the subconcious works, it just gets on with it based on the tools it has I guess. In my previous job I would take a clients blueprints and break it all down to components, order the material, make drawings and instructions on how to build the thing, and I would be doing that 3 times faster than the guys with engineering degree's and all sorts of experience. I don't think the modern education system is doing very much to nurture and improve the actual thought processes, it's a shame, because where on earth are the innovators gonna come from now! - we can't afford to wait until people hit university before they start properly thinking for themselves.

Health, Ammo, and bacon and eggs!
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 14th May 2012 16:19
I usually just think about what I have to do, think about what sort of approach I'm going to take, and once I have that basic outline in my head, I code it right off.

Quote: "because where on earth are the innovators gonna come from now!"

I think about this all the time. I mean the guys at Intel, AMD, Nvidia and all those other microprocessor companies must be incredibly intelligent. I know that I could never fully understand how a CPU or GPU works, let alone design a newer and better one. Of all the people I know, I know that none of them could either. So when the current generation of hardware developers retire, what happens then? Do we just descend into chaos?

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th May 2012 16:21
A programmer has to be able to "run" simple programs in their head. Whenever I'm presented with a problem, my brain usually always has a few code snippets generated and prepared for my fingers. Like WLGfx said nicely, it's a second language (or third in my case )

Quote: "That said, I often solve programming problems away from the computer. On my way to or from work, when I'm going to bed, when I'm showering, etc... I can step through my own programs hours after I've last touched them to resolve a bug. It's kind of wierd."


Finally someone who has the same expirience!

How many times have you actually solved a really hard problem while smashing your head against the computer monitor? I myself can say that this almost never occurs. The answer comes to you when you're doing something completely different, like taking a walk, or eating a bagle (like a BOSS). Why do you think google allows their employees to take walks and sit on couches?

My dad told me an interesting story of the time he worked at Novartis. He worked on the cutting-edge biochemistry projects, and he said that everyone else in the lab would do this procedure where you'd approximate the answer by trail and error. Usually it would take between 1-2 weeks until they actually got the answer. My dad however was different. He'd familiarise himself with the problem, do a few tests to get the hang of what he was dealing with, and then he'd just go home and do something completely different (he was addicted to Doom back then, and liked to go for long forest walks). After a few days of him doing nothing, he'd suddenly get an idea on how to solve it. Going back to the lab, he'd perform the tests that popped up in his mind and 7 times out of 10 the answer would immediately be there. It used to drive his colleagues nuts.

TheComet

Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 14th May 2012 16:25
Well, it's necessary in problem solving, so yeah. As when we program, we're just mapping the logic/maths in order to provide some desired outcome.

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th May 2012 17:06 Edited at: 14th May 2012 17:07
Quote: "How many times have you actually solved a really hard problem while smashing your head against the computer monitor? I myself can say that this almost never occurs. The answer comes to you when you're doing something completely different, like taking a walk, or eating a bagle (like a BOSS)"


I suppose it's something to do with breaking a fixed unproductive pattern of thought. Like when you're doing a crossword and have a word S_L_ to complete then think of options like SALT, SILT, SULK, etc, and get completely stuck because you'd overlooked the possibility of LL at the end. Look at the same problem the following day and you may see the LL option straightaway.

Perhaps we should all actively practice that whenever we get stuck - actively go and do something completely different for a few minutes. Makes you wonder what the optimal strategy/timescale is. Food for thought.
Agent Dink
21
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 14th May 2012 17:36
Some of my best programming, or at least the problem solving portion of the process is done AFK, like Jerico said. I'll have my biggest break-throughs when I'm cooking, driving, or working on something else.

http://lossofanonymity.wordpress.com
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th May 2012 17:48 Edited at: 14th May 2012 17:56
Quote: "Did you study technical drawing Pincho?"


I did algebra, but forgot all about it by the time I was programming. I probably spent 2 days on Algebra when I was 10, and programmed when I was 17.

When it comes to games design (a separate subject) I had all of the framework from Super 8 animation, and film making when I was 11, Fictional writing when I was 11, art when I was 4, inventing games when I was about 7, making a monopoly board game when I was 11, playing the keyboard when I was 8.

I think though that actually writing the code is better than copy/pasting the code even from a magazine. When you copy from a magazine you have to read what you are typing, but copy/paste is almost invisible coding. I remember copying a Pacman game from a magazine, and the joystick controls didn't work properly for diagonal.. the Pacman just stopped, and joysticks weren't accurate enough not to accidentally hit a diagonal. So I improved the joystick code, and remembered all of the Pacman code that I typed in. Now Pacman code was what I used for Minecraft in the OP, but I visualised a way to correct the diagonal misbehaviour of free movement. Minecraft is basically 3D Pacman with free roaming.

The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 14th May 2012 18:29
Quote: "I was also thinking too that programming might actually be easier to learn than say learning another language, but I got myself confused at that point trying to figure out why."


For me it's because a regular language has set rules, just like programing, but in a language the rules have exeptions. And in a language you have to learn thousands of words, in programming you just have to learn how to utilise the words, (If statments, loops, functions ect) Then you just need to put the "words" in there. And if there is a "word" that you don't know, you can just look it up.

Programming is based on logic, languages are not
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th May 2012 18:38 Edited at: 14th May 2012 18:41
Quote: "Programming is based on logic, languages are not."


I convert English language into code as well, mainly when I am working on a science project. Like what came first chicken, or egg? I naturally convert it into a program with images. I do it a lot. I get something that look like...

Do
Egg = 1
Chicken = 100
Chicken > Egg
Chicken lays egg
Loop

It loops, but egg always comes before chicken. You may disagree, but I am just doing the same as writing a game, and the code is correct. Whatever you add to that program, like Chicken lays an egg, still comes after egg. The program is perfect, but paradoxically is confusing. You can add weird things.. duck lays a chicken egg. But Duck will not turn into a chicken.

heyufool1
16
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 14th May 2012 21:05
I think in pseudocode. When I go to program things I don't consciously think about datatypes and stuff of that nature, it's natural enough that it just sort of types itself. Because the simple things generally type themselves I only think without that stuff, so mostly pseudocode. However, I find it really hard to simulate recursion and sometimes nested loops in my head.

"So hold your head up high and know, it's not the end of the road"

nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 14th May 2012 21:37
Quote: "I don't think the modern education system is doing very much to nurture and improve the actual thought processes"

...If anything at all, *sigh*.

When I was still a hatchling, I taught myself most of what I knew back then about computers. I picked up Qbasic by analyzing the example code. The first few programs I wrote, I was speaking BASIC. I actually didn't know all the technical details like what a data structure was, etc. I visualized things instead and actually had to think in computer terms.

Today, many moons later, I still think in computer terms when problem solving.

And yes, I know the "solving it" syndrome well. It seems like the minute I go and tend the orchids, clean the bird baths, etc. - or try and get some sleep - is always when the "that's how it's done" thought drifts into my mind. Sometimes I even get these crazy ideas for inventions and I actually see the 3D view of the components in my mind...

Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th May 2012 23:41
I often wake up with a solution, and I figured it out in my sleep.

Travis Gatlin
16
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 15th May 2012 01:46
I often look at average everyday processes and psuedocode my way through it, then convert over certain code functions over to Basic. Though, when I actually go to do it, my concentration goes to crap and I never actually end up doing it. Oh and yes, If I have a problem, I almost NEVER figure it out sitting at the computer screen. I always solve it away from the computer.

http://www.talenthouse.com/travisgatlin
You can find my latest work here. Please comment on my work and tell me what you think!
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 15th May 2012 01:58
Same here; I almost neer figure something out at the comp. When i have issues i have found it works best to go somewere else and not come back until you have found a potential solution.
Daniel wright 2311
User Banned
Posted: 15th May 2012 02:03
late at night,when I am going to sleep,I will go over code in my head and then know how to fix something,then I have to wait to get up to do what it was I need done.

my signature keeps being erased by a mod So this is my new signature.
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 15th May 2012 03:21
Tonight I had to dump a load of old code (backed up this time online) because I had to re-write it to work with GDK. In my mind it was all there. "PSEUDO CODE" was my start, then "yEd", then coding the darn thing.

But yeah, "PSEUDO CODE" is the first step just before anything else unless it's mega complicated like my stuff tonight. Had to think it all through first before I even got to making any attempt at "PSEUDO CODE"...

PSEUDO CODE - Putting your thought's in plain English as to what you want your program or function to achieve. Usually written out as a list of commands with comments line by line.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 15th May 2012 04:11
Hmm, the only real problems I have with coding now are using APIs that are either badly documented, or are just generaly bad and the only alternative is writing my own version of the API. In the first case I end up having to try lots of different possiblities which gets tiresome very quickly. In the second case I either find out that it's impractical to rewrite said API, or spend so long writing all the supporting code that by the time I'm done I've lost interest in the original project.

The much more interesting projects I've found have been to do with algorithms and maths, for example calculating the position of a camera based on what it can see. DBPro is perfect for this because it's very easy to display the results without having tons of boilerplate code.

[b]
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th May 2012 08:15
This phenomena just happened again. A friend from work gave me a call late at night just after he got out of the shower and told me I should double check a certain part of our circuit (it's pretty complex), he said there's an error there but he's not sure what. Sure enough there was

TheComet

Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 15th May 2012 10:06
I often experience a layer overlaid reality. It is coding and modeling, texturing and bump mapping, the sound element is so engrained that it has become background noise (which is still correct and relevant just not focus capturing.)

everything i look at these days seems to be a study for a programming challenge. I often like sitting down the pier and looking at the ocean waves and working out a related pattern to apply to a matrix. I look at surfaces and imagine the basic texture, i envision the bump map. I try to reduce the polys for optimised performance. i reduce human behaviours down into patterns which have variables for normal bounds (unpredictable creatures we be) i think of trigger points and switching variables in story points.

programming is such a large part of my life now that at any time I will try to take reference and information to use in my projects.

quite often i am staring into space and people ask me what I am thinking about. to explain it would take time and bore them as i am essentially explaining what they see, just how I would program it.

as time goes on my viewpoint more and more resembles a programming project.

Sometimes I like to use words out of contents
Travis Gatlin
16
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 15th May 2012 14:23
Quote: " the sound element is so engrained that it has become background noise"

Yeah, when making a game, you never really think about the element of sound. You just sorta imagine professionally made sounds in your head lol. When in actuality, getting good sound is probably one of the hardest aspects of making games.

Quote: "I often like sitting down the pier and looking at the ocean waves and working out a related pattern to apply to a matrix. I look at surfaces and imagine the basic texture, i envision the bump map. I try to reduce the polys for optimised performance. i reduce human behaviours down into patterns which have variables for normal bounds"

Wow, that's pretty awesome. I might want to try that sometime. It sounds like it could help me a lot in the future.

http://www.talenthouse.com/travisgatlin
You can find my latest work here. Please comment on my work and tell me what you think!
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th May 2012 14:34
Quote: "Hmm, the only real problems I have with coding now are using APIs that are either badly documented, or are just generaly bad and the only alternative is writing my own version of the API. In the first case I end up having to try lots of different possiblities which gets tiresome very quickly. In the second case I either find out that it's impractical to rewrite said API, or spend so long writing all the supporting code that by the time I'm done I've lost interest in the original project."


All too true here as well I'm afraid - except I'm so old I forget what the original project was.

Quote: "I often like sitting down the pier and looking at the ocean waves and working out a related pattern to apply to a matrix. I look at surfaces and imagine the basic texture, i envision the bump map."


Same here. I often take photos of natural rock reatures for much the same reason. My wife thinks I'm weird.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th May 2012 15:27
Quote: "Same here. I often take photos of natural rock reatures for much the same reason. My wife thinks I'm weird."


Pah, she just doesn't know how difficult it can be to get a good rock texture... I always wish that people would take texture photos alongside their normal stuff, might encourage me to look through someones holiday snaps if I thought there would be some useful images to steal . Also, I wish someone would make a camera based on Kinect, so you can take a picture and grab an accurate height map at the same time. Has to happen soon, surely!

Health, Ammo, and bacon and eggs!
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 16th May 2012 03:36
Quote: "Also, I wish someone would make a camera based on Kinect, so you can take a picture and grab an accurate height map at the same time. Has to happen soon, surely!"

that would be awesome!

I was thinking a while back that it would be cool to have a hologram camera. just point and click and and would use lasers to take a snapshot of the light space at a designated resolution. if only holograms could be created in a split second. then you could take height map pictures around corners.

Sometimes I like to use words out of contents
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 16th May 2012 05:01 Edited at: 16th May 2012 05:06
Quote: "as time goes on my viewpoint more and more resembles a programming project."
Same here.

I often tell people that I see things in the opposite way that the matrix is viewed by the programmers in the Matrix. Like when watching a video game or even when mentioned above about seeing real life things. I don't see the code and interpret it as the world, I see the world and interpret it into code.

A lot of times, it feels like second nature, as well. I think it might be in line with the question of whether a person's primary language is what they think in, or do they think in a different language they may be speaking.

I tend to look more at behavioral things among animals and people and the patterns therein.

Them: I got too close to that bird. It flew away...
Us: if(me.dist <= bird.AIsafeDist) flyAway();



Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Yodaman Jer
User Banned
Posted: 16th May 2012 05:21
I can think a bit in computer code but probably not as well as most here. I can step through a program for sure, but I often find that I don't always get the same results as the one in my head (generally because when I'm thinking in code it has to do with a new function/command I've learned about but haven't had enough time to memorize properly).

I have solved a lot of bugs in the shower though, that's for sure! It's like the warm, humid air in the shower provides a good environment for thinking things through.

CumQuaT
AGK Master
15
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th May 2012 08:46
It's funny. I often will sit and think about code on a long bus ride or the like, and I will write up pages of code and compile it in my head to see if it works. By the time I get home, I just can type it out and I know that it works.

That might have something to do with my OCD and Asperger Syndrome, however... O_o


kamac
14
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 17th May 2012 10:10
Uhm,

Quote: "Sure, I think all programmers who are actually programmers visualize a problem, break into it's steps and code it out. Sometimes in 3 steps or sometimes all at once."


This is the answer.



Follow me on twitter! @kamac496
Nateholio
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: I\'ve Been Everywhere
Posted: 17th May 2012 10:34
Quote: "I don't think the modern education system is doing very much to nurture and improve the actual thought processes"

Indeed.

Quote: "When I was still a hatchling, I taught myself most of what I knew back then about computers"

Not just computers, but just about everything useful.

Quote: "I often wake up with a solution, and I figured it out in my sleep"

Haha. I've done that too. The "worst" was a multiplier circuit I'd been trying to figure out for weeks. It was supposed to only have a single control signal, which was also the "load" signal. Wouldn't be hard if you do it with mux/adders but I needed to reduce package count so it was state-based. Woke up one morning with the entire circuit in my head, laid it out, and tested perfect.


You know your brain has gone off the deep end when you're at work and start counting or doing math in hex without even intending to. Of course, then you have the occasional smart@$$-ery of telling someone the dimensions of a conference table in frequency rather than feet/inches. I think it was something like 120MHz by 240Mhz.

In Development: K96 - Combat Simulation
Keep your Hope and Change, I choose individual Liberty!
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 17th May 2012 15:47
Quote: "That might have something to do with my OCD and Asperger Syndrome, however... O_o"


That doesn't show up in your video, and I can recognise it usually.

CumQuaT
AGK Master
15
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th May 2012 16:24
Quote: "That doesn't show up in your video"


Yeah, 9 years of psychotherapy will do that hahaha I manage it quite well now and can control/focus it most of the time, but I used to be much worse. And even now, when I start getting stressed or worked up, it comes back in a big way. Generally when I record the videos I'm in quite a good mood because so many people like my game


Login to post a reply

Server time is: 2025-05-21 19:33:54
Your offset time is: 2025-05-21 19:33:54