News for hackers. Stuff that matters.
Re:Signs that you are a bad programmer by edw519 on Wednesday October 19, 2011 @05:11PM (#3132113)
I found the "Alternative careers" hilarious.

My version:

  Your code sucks.
  Alternative careers: "Do you want fries with that?"
OP's version:

  1. Inability to determine the order of program execution
  Alternative careers: Electrician, Plumber, Architect, Civil engineer
  
  2. Insufficient ability to think abstractly
  Alternative careers: Contract negotiator, Method actor
  
  3. Collyer Brothers syndrome
  Alternative careers: Antique dealer, Bag lady
  
  4. Dysfunctional sense of causality
  Alternative careers: Playing the slot machines in Vegas
  
  5. Indifference to outcomes
  Alternative careers: Debt collection, Telemarketing
So the real test of a good programmer is one who can write a routine that crawls the source code of a bad programmer and tells them what they should really be doing.
Re:Signs that you are a bad programmer by Sniffnoy on Wednesday October 19, 2011 @07:30PM (#3132631)
I have to wonder if someone who can't determine order of execution should be an electrician or plumber either -- those aren't static systems!
Re:Signs that you are a bad programmer by JonnieCache on Wednesday October 19, 2011 @08:20PM (#3132783)
I guess the point is that there's no "privileged" position in these systems which changes with time, like the point of execution in programming.

What is the proper name for the bit of code that's currently being executed? I've suddenly realised that its a concept you think about constantly when coding, but its so much a part of the scenery so to speak that you never consciously consider it.

Re:Signs that you are a bad programmer by Androsynth on Wednesday October 19, 2011 @08:55PM (#3132870)
At the hardware level it's called the program counter, which is a register containing the address of the current operation the processor is running. After the operation is finished, it increments itself and moves to the next step in the program.

Edit: just realized I didn't really answer the question, I believe what your actually talking about is a statement.

I usually jump at the chance to talk about stuff from my old EE days :)

Re:Signs that you are a bad programmer by Zaak on Wednesday October 19, 2011 @10:15PM (#3133100)
The program counter isn't the only element of that "what the program is doing now" state though. The context in which the current instruction is being executed makes a world of difference.
Re:Signs that you are a bad programmer by jpendry on Thursday October 20, 2011 @10:29AM (#3134966)
And the ability to save all of that into a variable so that you can pass it around to other parts of your program means that your programming language supports Continuations.
Re:Signs that you are a bad programmer by vogonj on Thursday October 20, 2011 @12:00AM (#3133393)
inclusive of that, the best term is probably "machine state" or similar.
Re:Signs that you are a bad programmer by calloc on Thursday October 20, 2011 @05:05AM (#3134056)
I consider the "context" the scope. What is the scope in which the current statement is being executed...
Re:Signs that you are a bad programmer by sounds on Wednesday October 19, 2011 @09:18PM (#3132945)
Current instruction or active instruction (at the processor level)

Currrent statement or active statement at the code level

Re:Signs that you are a bad programmer by mrb on Wednesday October 19, 2011 @11:05PM (#3133241)
On the amd64/i386 platforms, the Instruction Pointer CPU register points to the executed instruction. Its name is IP for 16-bit code, EIP (extended) for 32-bit code, or RIP (register) for 64-bit code.
Re:Signs that you are a bad programmer by 5hoom on Wednesday October 19, 2011 @10:10PM (#3133085)
That's an interesting point.

I know that when I'm in the flow coding, there is a sort of Tick:the-program-does-this, Tock:the-program-does-that stepwise execution of the code in my head.

There are many answers as to what the hardware is actually doing with the instructions, but more generally what exactly is the name of an imaginary discrete state of a program that currently only exists in a coders head?

Re:Signs that you are a bad programmer by JonnieCache on Thursday October 20, 2011 @06:49AM (#3134253)
>but more generally what exactly is the name of an imaginary discrete state of a program that currently only exists in a coders head?

This is what I'm trying to get at. There isn't one is there? It's weird.

Re:Signs that you are a bad programmer by sambeau on Wednesday October 19, 2011 @10:57PM (#3133224)
What is the proper name for the bit of code that's currently being executed?

I would have used 'Cursor' or 'Program Cursor'. But I'm now convincing myself that that a database term.

Re:Signs that you are a bad programmer by kennywinker on Wednesday October 19, 2011 @08:33PM (#3132815)
Top of the stack?
Re:Signs that you are a bad programmer by Zaak on Wednesday October 19, 2011 @10:16PM (#3133109)
Re:Signs that you are a bad programmer by Sniffnoy on Wednesday October 19, 2011 @08:42PM (#3132837)
Program counter?
Re:Signs that you are a bad programmer by eru on Wednesday October 19, 2011 @06:06PM (#3132326)
I'm glad that as a purely functional programmer I don't have to worry about order of program execution so much.
Re:Signs that you are a bad programmer by jrockway on Wednesday October 19, 2011 @06:28PM (#3132409)
Unless you are using a magical computer, you still have to worry; there are resources you must manage that depend on the underlying OS and von Neumann architecture.

An example that bites Haskell programmers are space leaks due to too much partial evaluation and not enough full evaluation. Other problems include keeping a file open for too long and leaking the fd. An ideal computer has infinite space and no files. A real one... nope :)

The advantage of functional programming languages is that you get to write part of your program as though you have an ideal lambda calculus evaluator. But at some point, you still have to realize that there's a grey box under your desk that doesn't know what a lambda or fixed point is. (But this is better than programming languages that say "hey, you've got a heap, a stack, and some registers! well, so long!")

Re:Signs that you are a bad programmer by eru on Wednesday October 19, 2011 @08:07PM (#3132739)
Yes. Notice my choice of words. "Not so much" vs "not at all."
Re:Signs that you are a bad programmer by Xurinos on Thursday October 20, 2011 @08:42AM (#3134529)
In fairness, "so much" fits the "weasel words" category (https://en.wikipedia.org/wiki/Weasel_word). You and jrockway placed different values on the phrase because it is a "numerically vague expression". I admit to making similar expressions. :)