blind7125 1924 Report post Posted December 13, 2015 (edited) -snip- Understand that these are community college professors. I'll have to find the earlier thread where I posted their code, but some of them I'm not sure even know how to program past a basic level. One professor absolutely loved to use try/catch blocks for almost everything. Lol, she docked me for not catching an InputMismatch on a Scanner object that read input into a string. That exception was never going to be thrown, and when I confronted her on it she responded "What you did was most efficient and best practice, but the point of the class isn't best practice." That was my wtf moment. Edited December 13, 2015 by blind7125 Share this post Link to post
Dewey 638 Report post Posted December 14, 2015 ... Well that's just plain stupid. Try/Catch statements are okay when done monadically, but when done imperatively as they are in Java... it just seems like a bandaid was added to the language. I've really grown to hate Java by the way. Share this post Link to post
Sirenfal 4034 Report post Posted January 1, 2016 For what it's worth, functional programming is horribly inefficient except for a very niche subset of very particular kinds of problems (which also are the only problems it's any good at representing). Using functional techniques is a great way to destroy half the ways modern CPUs can make your code run faster, nevermind the cost of calling a function in the first place (which can't ever be fully negated by definition because that will always involve more data than just storing an EIP pointer and one return path). Imperative/OOP is the status quo for a lot of very good technical reasons. 1 Share this post Link to post
Dewey 638 Report post Posted January 8, 2016 For what it's worth, functional programming is horribly inefficient except for a very niche subset of very particular kinds of problems (which also are the only problems it's any good at representing). Using functional techniques is a great way to destroy half the ways modern CPUs can make your code run faster, nevermind the cost of calling a function in the first place (which can't ever be fully negated by definition because that will always involve more data than just storing an EIP pointer and one return path). Imperative/OOP is the status quo for a lot of very good technical reasons. FP and OOP are not mutually exclusive; the two can work well together. Granted, functional languages are admittedly way less efficient on single core/thread CPUs, but by nature they are extremely parallelizable (not a word BTW). This means that although desktop applications may not see the benefit of FP yet, massive data-driven systems do and have. Besides, compilers for several major functional languages have gotten significantly more intelligent over the years. Programming in a functional style does not mean that the bytecode (for JVM languages) works in a functional manner. The compiler gets to pick and choose optimal traversal strategies, search, etc, and in the end have an imperative program. But as you said, imperative is generally more efficient than functional, but I will add in thoery to that statement. C is clearly an extremely fast language, unless it is written an in inefficient way (which is very very doable). Although still possible, it's pretty hard to write bad code in a functional language, especially one that's type-safe. So yes, a perfectly written C program will be very efficient, but that rarely exists in the wild. Functional, on the other hand, is more consistent. Share this post Link to post
Sirenfal 4034 Report post Posted January 14, 2016 FP and OOP are not mutually exclusive; the two can work well together. Granted, functional languages are admittedly way less efficient on single core/thread CPUs, but by nature they are extremely parallelizable (not a word BTW). This means that although desktop applications may not see the benefit of FP yet, massive data-driven systems do and have. Besides, compilers for several major functional languages have gotten significantly more intelligent over the years. Programming in a functional style does not mean that the bytecode (for JVM languages) works in a functional manner. The compiler gets to pick and choose optimal traversal strategies, search, etc, and in the end have an imperative program. But as you said, imperative is generally more efficient than functional, but I will add in thoery to that statement. C is clearly an extremely fast language, unless it is written an in inefficient way (which is very very doable). Although still possible, it's pretty hard to write bad code in a functional language, especially one that's type-safe. So yes, a perfectly written C program will be very efficient, but that rarely exists in the wild. Functional, on the other hand, is more consistent. Show me an easy way to model something of larger complexity (e.g. a Diablo 2 esque item generator) in a functional language that's clear and intuitive to read and maybe I'll change my mind. It's too bad at structuring applications to be a general solution, whereas OOP/imperative/dynamic (which can also work as a functional language) can pretty much approach any problem (#python). Parallelism is a point, but writing safe concurrent code isn't terribly hard for most problems with modern approaches. As for the compiler point... transposing functional to more traditional assembly certainly isn't *impossible* but I would imagine that's a fairly difficult problem as far as compiler problems go. This is pretty much where Python is stuck too, in theory with an appropriate JIT compiler Python should be able to approach C in speed, but no one has managed to do it yet because it's non-trivial (though PyPy is slowly getting there). Cython, on the other hand, can be pretty fucking fast Share this post Link to post
m1enkrafft_man 142 Report post Posted January 15, 2016 Show me an easy way to model something of larger complexity (e.g. a Diablo 2 esque item generator) in a functional language that's clear and intuitive to read and maybe I'll change my mind. While I wholeheartedly disagree with you on this issue, RELEVANT. Share this post Link to post
Sirenfal 4034 Report post Posted January 16, 2016 While I wholeheartedly disagree with you on this issue, RELEVANT. I said 'show me a basic example implementation that's as clear as an OOP implementation is'. I'm not sure how you can disagree with a request for opinions Share this post Link to post
rakiru 2713 Report post Posted January 17, 2016 I said 'show me a basic example implementation that's as clear as an OOP implementation is'. I'm not sure how you can disagree with a request for opinions I think they just thought you'd found that link interesting/funny and it's relevant to that line, but disagree with your above posts in general. Share this post Link to post
aspens 3 Report post Posted January 11, 2017 I would say C or c# .. i started with flash AS2 and i regret it =( 1 Share this post Link to post
dejordzta 1688 Report post Posted January 15, 2017 Please make sure to check the last post date before posting. At this point the conversation is dead, and you're not adding any meaningful value to it. FAQ & Rules Share this post Link to post