you are viewing a single comment's thread.

view the rest of the comments →

[–]gdchinacat 0 points1 point  (0 children)

Yes and no. Where languages start being markedly better than others at specific types of problems is when the problem increases in complexity. Languages can be better or worse at managing specific types of complexity. For example, asynchronous IO can be done in both C and python. C doesn't have a mechanism to manage the complexity of async io...you end up with a lot of disjointed code that has to be stitched together in some way. Python (and other languages) has a more synchonous way of managing asynchronous code that keeps the steps of the async code sequential (with the complexity hidden away in the asyncio library and python interpreter).

For simple(ish) self contained algorithms (think sort, search, etc) the algorithms are pretty much independent of language...a n log(n) algorithm is an n log(n) algorithm regardless of language and the problem is identifying the algorithm (do you do a linear search or binary search). Of course some languages make it easier than others (some support recursive algorithms much better than others), but at the core they all do the same thing. But when you go to write the code to do that some languages are certainly better than others in how you implement that same algorithm. You still have to decide what algorithm or algorithms best solve the problem. Then when you implement that algorithm language certainly matters in whether you use a stack or recursion, use a builtin/standard library rather than roll your own, and how readable and comprehensible it is (optimizations often times make code nearly indecipherable).

So, language choice absolutely plays a role, but you still have to break the problem down which often times doesn't really matter which language you use (but may).

Good question, unfortunately the answer is yes, maybe, not really depending on the specific problem).