2 ms·
By "straightforward" to you mean "theoretically possible?" If that were the case, nearly everything would be written in Python. Maybe there is a specific ca
by Nelson69 17y ago
By "straightforward" to you mean "theoretically possible?" If that were the case, nearly everything would be written in Python. Maybe there is a specific case you're thinking of because in the general case it's non-trivial and possibly impossible. You're not getting near-C performance by simply dropping to C are you? That's not a terribly acceptable answer.
I don't know why these things come up all the time. Java is pretty fast for a managed language, certainly faster than a lot of people think but it's not C. Python, Ruby, etc? They're way far behind in performance, particularly tight loop number crunching type stuff. That doesn't make them bad choices for things though. There isn't a subjective answer, I think it was Top Gear 2 weeks ago that said "You don't buy a supercar with your mind because it doesn't make sense, you buy them with your heart because you love them." The same thing is true here. If you want to be subjective there are all sorts of other variables you'd have to factor in, tooling, libraries, dev time, availability of quality developers, maturity, likelihood of future support (you laugh, I wonder with Ruby and Python and Perl all going through these giant shifts, they may never be the same and as unified) Can you actually compile your code or do you distribute source code? All those things in play and it gives Java a fairly compelling story even though a lot of people want to hate it.
The better discussion, at least to me, is with so many compelling options that perform as well as they do, why does anyone bother with C? With various buffer overflows being so prevalent and it being so easy to have a bug that poses a real security risk, is it worth that?