I am super surprised by the answers
I think in sets (groupings/state change of data) and graphs (paths of logic)
when i need to pseudocode it will be something in the line of ruby mixed with english expressions as placeholders
I'm kind of confused about this question because I don't think I "think" in any language. When I'm breaking down a problem I'm mentally working with fundamental units of work that need to be done and what data structures I need to represent it, which is different from what the code for it actually looks like. "Perform this function on each element of a collection and save the result" is the same work regardless of whether you write it with a map or a for loop or a list comprehension.
For lack of a better way to state it, I might say that I think in English :)
A more practical answer: for interviews I use python, because it's easy to write on a whiteboard and has lots of nice, concise ways of expressing the kinds of data structures and algorithms I usually need to exercise in a coding interview. Lists, dictionaries, tuples, list/generator comprehensions... a standard library that I can guess at functions existing and having a 95% chance of them really existing. I love python for interviews!
I tend to think in the language I’m most comfortable with, and the first one I’ve learnt: Python.
Python tends to be extremely close to pseudo code, and it’s a language that has lots of stuff built in. So it’s a very good choice for coding exercises - I can translate ideas in language constructs very naturally without having to reinvent the wheel! Proof is, most coding challenge solutions written in Python I’ve seen rarely exceed 4 or 5 lines.
C# is ❤️
This is interesting. I write a lot of Ruby and it's usually my go to if I wanted to represent the logic of a real-world thing. Simple if-else statements are pretty easy to represent in Ruby, it has a really basic OOP structure, so overall my mind goes there a lot.
But... when doing programming, Ruby doesn't really seem like the one I'd default think about as the language to relate things to because it's so high level, and translating to it kind of seems backwards in my mind. I'd say in this sense it's Java. It's the first language I truly learned in any deep sense (though it never stuck very well and I didn't really like it). So yeah, I'll often relate things back to Java in my mind even though I don't even really know it all that well.
I tend to think generically about how data will flow through my system using mostly map, filter, and reduce. I wouldn't say it's tied to a particular language, though it usually ends up being F# or Clojure when I write it out.
For years I've been thinking in C because:
But to be honest, I've been coding mostly in Ruby for quite some time now and I start thinking in "Ruby logic" also.
It also depends on the problem I'm trying to solve. If the problem is purely OOP, I might even think in Java, since it's the first OOP language I learned (thanks, college...).
Very interesting thread. My mind automatically defaults to the language I first learnt which was C. In interviews I tend to resort back to thinking in C but will tend to use other languages based on the scenario the employers has provided. A lot of the time I've found myself writing Python or Java in a interview, having a C mindset can be a bit weird in some cases as I'll sometimes find myself trying to write C syntax inside of a Python script.
So basically Kotlin. I think in Kotlin, my new heartthrob. The more I work in Kotlin, the more I find it to be exactly the way I want to think about Java code.
I tend to use Python for quick one-offs since that's what my schooling was more like, but knowing the versatility of JS makes me use it as a default and then translate from there.
It depends on what language I'm working in the most at that time. Back in college it was C#/C++ and now it's Java. When someone describes a problem to me that they've had in code I always imagine the Java setup for it even if its a python script.
Whenever I'm spitballing, or hashing something out on a white board it's usually to outline basic process flow. I always result in a hybrid markup that's a mix of Bash and Python. pure conditional trees are more Bash, while things are Python objects or class.
This doesn't stop at work related things. Personal decisions and planning in my head also use this type of flow as well.
For a job interview coding question, I'd choose Python. It seems to fit my brain best, even though I've used Java more professionally.
If I'm thinking through a problem (and probably writing it down) it's going to be a combination of English, Python (occasionally with Ruby-style blocks), and diagrams with boxes and arrows.
Kind of agree with any non-programming thinking first. Usually, I will start to ask myself "do we need a database for this?", and then build the hole UML around it (if needed). Then I will ask myself "do we need to access those data from multiple UI?", and if yes, I focus on thinking by APIs to tackle the problem. If not, I usually go down to my favorite tool, Laravel, because it is the moment it has something to offer to solve problems like Queues Jobs, Gates, Notifications, ... (basically opiniated tools, but useful tools that make you earn a lot of times, important enough on a project to consider it against another framework because as it is opiniated it will shape a little bit different your database if any was needed). I usually skip the "pseudo-code" step unless I need to explain a job oriented mecanism (if the problem we are trying to solve requires a lot of domain specific knowledge, in this case I do like a lot of you folks, mixed insert-favorite-language-here + pseudo code).
Kotlin. Android development with Kotlin is what I did the most for a long period of time and since Java is the first language I learnt for real (what a surprise given the rest of the answers) my mind goes right to it, with Kotlin syntax.
For me it's mainly PHP. As @tux0r
I don't have much experience in other languages tbh.
I definitely used to think in Java, but after so many slow programs it started to make me feel slow lol (I know I'm crazy).
Yeah, like I said I know I'm crazy lol.
My first programming language was the Commodore BASIC V2 :) I'd love to use it on an interview today but no one would appreciate the effort. Inclusion is an illusion ©®! 😂
Somehow I think statically typed, don't know why.
I would say Python! It allows a very flexible way of implementing various solution which goes pretty well with the liberty of exploring several aspects of a problem
Mostly in Python, but I always try to solve the problem in a language agnostic way. And btw, I think in English while coding (Spanish is my native language)
I think in pseudocode then write Golang or Ruby.
Really great question 💓
I always think in Python
Depends on the problem at hand. Mostly C, though.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.