Live data from Hacker News

Ask HN: What language do you think in?

news.ycombinator.com

31–40 of 68 posts

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

#31
I've been coding long enough that most problems don't need thinking about. I just 'know'.

However, I've been alive long enough that if I don't 'know' the solution I need a whiteboard. I can't think without a whiteboard.

Age brings wisdom and experience but it certainly has dulled my brain quite a bit :(

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

#32
I focus on the semantics first: I try to capture the essence of what I really mean to "say". Then I try to imagine the most idealized language that would let me specify as exactly and easily as possible what I really mean, unambiguously.

If I have access to such a language, I use it. If I don't, but know how to implement it, I might do just that if I think it's worth it in terms of time and effort. Otherwise, I try to think of the next best language that could represent what I mean and that I can use or implement more easily. At some point I get to "really low-level" abstractions like Common Lisp objects, closures and macros...

It's a surprisingly high-quality and slow way to program. I figure at some point I'll have accreted so much language implementation knowledge and infrastructure that I'll be unstoppable because I'll almost always be able to make a good approximation of the best tool for the job quickly.

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

#33
I think in whatever language I'm writing unless I've just started it. Then I think about what I'd imagine they'd call it and google around for it.

Translation from one language to another is just another layer of indirection and makes you slower. It's easiest and best just to learn languages from scratch or near-scratch, IMHO. If you get used to learning in that way, it's easy to keep doing it.

Caveat: I think in C when I'm coding C++.

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

#34
post #6

I think in English. Whenever I'm thinking about a problem, my solutions are immediately described in my head at a high level. This allows me to rapidly iterate over the solution space without having to venture down into the pseudocode or code level until I've found something I'm convinced will actually work.

I think in English about programming stuff too. I think in either Italian or English depending on the context, but mostly English as that's my native language. Italian is more for things or events that happened in Italy or with Italian speakers (so... actually I do think in it a fair bit, because I live in Italy).

This can make it weird working on programming stuff with Italians, as English really is where my brain wants to be for programming. It's not about knowing the terminology (I do), it's just that English is really what I want to use to reason about programming.

Incidentally, trying to think in another language about what's going on is a great way of practicing it if you're learning it.

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

#36
If the problem requires science, I think in English because most of my relevant university education and R&D was/is in English and thus most of the terminology I know. If it's business-related, I think most the time in German. I draw causal diagrams and sketch in Haskellesque pseudo code.

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

#37
Am I the only one who doesn't think in any language at all? I just see little flashes and sort of feel ideas. I realize this is a very sucky explanation, but I've never heard it described. When I think about a program it is again a combination of images and feeling how a given algorithm I am designing will work. I only ever think about words when I sit down to write words, and then it is almost like I am transcribing for a voice in my head that feeds me one word at a time. I very often can't think of a name or the correct word for something, but can describe around it (like I might forget the word 'well' but I can just say in frustration "hole you drill to get water out of").

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

#38
Depends what I'm looking at.

If I'm looking at a website, I think in SQL (cf. dude I can write SO in like 4 minutes ;)

If I'm looking at stats/ML stuff, I try to think in pictures (usually of probability densities being transformed in various ways), and sometimes slip into "pseudomath," which is basically English that sounds like "argmax integral x filtered by f times hessian of g".

If I'm doing information theory I tend to think geometrically or graphically, seeing distributions as points/nodes and then reasoning about what the picture looks like as distances/edges between them grow and shrink.

If I'm looking at an attractive member of the opposite sex, a good bottle of wine, or someone that needs cursing at, I think in French.

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

#39
post #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 wo…

It's perfectly possible to express solutions at a high level without much regard for formal semantics. Knuth's The Art of Computer Programming expresses most of its algorithms in a combination of informal English and ad-hoc pseudocode. It's usually not difficult to translate them into languages with semantics varying from machine code to Haskell.

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

#40
I used to think in terms of methods and data structures, say about 5 years ago. I was thinking bottom up. I learned (slowly) that I could not sufficiently communicate to the business folks what was happening. Their eyes would just glaze over. They also rejected 90% of my work by the time they got to see it. We were simply out of phase with our communication.

Today I have learned to think in work flows and the visualizations of the UI. This is how the users of the program view it. To users the UI is the program. Now the users accept my work 90% of the time. I seldom think about the methods or data structures anymore until I am actually sitting there typing it in.

Post reply on HN