Live data from Hacker News

Ask HN: What language do you think in?

news.ycombinator.com

21–30 of 68 posts

Re: Ask HN: What language do you think in?

#21
It depends on the problem. If it's something algorithmic that fits into a given data structure, I go through a bunch of mental visual representations; graphs, trees, etc. If the model fits, I usually imagine the code in the language I used the structure the most in.

If it's about something I don't know much, I'll go through pseudo-code and/or a list of tasks the code has to perform and then imagine it in the best-suited language for it.

If it's more about organizing concerns or how should a larger problem be split up, I'll take a sheet of paper and draw components and tasks, then linking them with arrows until it makes sense and it's clean. I then try to fit that in the language best suited for it; usually for that kind of splitting, actor-based languages do the best job. It's probably why I like Erlang/OTP so much; they provided actual design patterns for higher-level representations such as Client-Server relationships, Finite State Machines, Event handlers (such as loggers and whatnot) that make it really easy to turn a visual representation into an actual application with minimal boilerplate code.

Re: Ask HN: What language do you think in?

#22
post #5

I think in pseudo-code, then figure out what language is best suited for the task.

When you say "I think in pseudo-code", what are the semantics of this pseudo-code?

'cause it's actually a bit of a non-answer, when you think about it. Saying 'pseudo code' means that the language you think in has some informality in its syntax - but presumably you still have some fixed understanding of what it does?

If it has no fixed syntax and no fixed semantics, then is it actually helpful as a mental model? I would argue that it is not.

(Note: I'm not just being antagonistic here, I'm genuinely curious. I don't think in terms of "syntax", so this is all a bit alien to me).

Re: Ask HN: What language do you think in?

#23
I used to think in pseudocode, but once I learned Ruby, it turns out I had been thinking in Ruby all along. Ruby just matches up really well with the way my brain already solved programming problems, then I had to translate it to C or Java or whatever else.

Re: Ask HN: What language do you think in?

#25
post #7

Earlier quoted context omitted.

Well, I think it's reasonably intuitive to think that way. It basically involves asking yourself the questions - "what types of values am I interested in?" "what types of results do I expect?" and finally "how do I get from input to output?" I think most programmers probably think it reasonably similar terms - it's just that having working in STLC or a high-level functional language gives you some mental machinery th…

having worked in... a high-level functional language gives you some mental machinery that doesn't rely on decomposing this thought process into some concrete syntax This is what we are really talking about when we claim that reading, e.g., SICP will make you a better programmer even if you don't work in Lisp. SICP is not a book about Scheme. It's a book about computation that happens to use Scheme. And it is resolute…

I kinda skipped SICP (I had already been programming for a long time before it even occurred to me that there might be texts available that attempted to teach "computational thinking" rather than just individual languages), but having browsed it since, I always recommend it to anyone who wants to learn programming (or HtDP, which also seems to cover similar ground).

Re: Ask HN: What language do you think in?

#26
post #5

I think in pseudo-code, then figure out what language is best suited for the task.

I take a slightly more abstract approach: I first think of the problem from the user's perspective (and their expectations), then I map out a work flow before diving into pseudo-code and wire-frames.

Overall, I agree with the parent because before you can dive into coding, you have to think of the problem and solution abstractly.

But which language is used for writing out the solution? Whichever is the best tool for that particular problem.

Re: Ask HN: What language do you think in?

#28
I tend to think in terms of workflow.

  1. How would user interaction occur?
  2. What systems are necessary?
  3. How can the problem(s) involved be solved? (what languages/tools/infrastructure)
  4. Pseudo-code
  5. Get crackin' on code
It's a pretty high level list, so I am probably missing some key points.

I tend to spend a fair amount of time just thinking and pondering the problem; once I reached some indeterminate threshold, I start typing up point-form notes. As I think more to gain more definition of the problem and potential solutions I add new, revise existing and remove obsolete notes.

And to actually answer the question "Which language do I think in?", it depends on my answers to #3.

Re: Ask HN: What language do you think in?

#29
post #26
post #5

I think in pseudo-code, then figure out what language is best suited for the task.

I take a slightly more abstract approach: I first think of the problem from the user's perspective (and their expectations), then I map out a work flow before diving into pseudo-code and wire-frames. Overall, I agree with the parent because before you can dive into coding, you have to think of the problem and solution abstractly. But which language is used for writing out the solution? Whichever is the best tool for…

I still don't think it adequately answers the question. Maybe the question should be rephrased as "What programming paradigm do you think in?"

Re: Ask HN: What language do you think in?

#30

I tend to think in terms of workflow. 1. How would user interaction occur? 2. What systems are necessary? 3. How can the problem(s) involved be solved? (what languages/tools/infrastructure) 4. Pseudo-code 5. Get crackin' on code It's a pretty high level list, so I am probably missing some key points. I tend to spend a fair amount of time just thinking and pondering the problem; once I reached some indeterminate thres…

[deleted]
Post reply on HN