3 ms·
Haskell and friends (Elm, ..) are fantastic, and perhaps the absolute best programming languages for software engineering. Except there's a small problem: Hask
by cryptonector 9y ago
Haskell and friends (Elm, ..) are fantastic, and perhaps the absolute best programming languages for software engineering. Except there's a small problem: Haskell is either write-only or read-only, depending on what you're looking at. That is, beautiful Haskell code is easy enough to read, but very very difficult to write, while working code you might write may not be very readable at all. Of course, that can happen in any language, but it seems to me that Haskell leads to that sort of situation very easily. On the other hand, the nice thing about Haskell is that once your code compiles it also probably does what you want it to :)
I would stay away from dynamically-typed languages (e.g., the Lisp and Scheme families) for software engineering. Dynamic typing means more run-time errors, which means a higher support burden, which is very much what you want to lower when you're a software engineer. And this is why I like Haskell: it's statically-typed. (The main appeal of Lisp is its macro system, really. Haskell gives you the sort of power that the Lisp macro system gives you anyways, though at the cost of more compile-time processing.)
If you can't use Haskell, then your best bets are Rust and C/C++.
In any case, a software engineer almost necessarily has to be familiar with all of these, and able to use any of them. You really want a strong foundation at the lowest layers (C, and even ASM) in order to work the full stack (libraries, applications, compilers, OS). You don't have to be a full stack engineer, naturally, but it sure helps to be able to adapt to working at different layers, and for this you need a strong conceptual foundation. A lot of layers in a full stack are written in C/C++, but web front-ends involve JavaScript, which is dynamically-typed, so you'll really need to be familiar with all of these, and that's just to get started.
- SomeHacker44 9y agoMy opinion: If you can't use Haskell, you should definitely use a null-free language for safety in this day and age, which means Rust and definitely not C/C++.
- cryptonector 9y agoYes, but that doesn't mean that you shouldn't be able to use C/C++ as needed -- sometimes you have no choice.
- SomeHacker44 9y agoAs always, pragmatism is good. If you are good at C/C++, use it and be happy and productive. I presumed the context of this discussion, however, was wanting to use Haskell for its particular benefits, and in my opinion the null-free nature is a key benefit, which would not be achieved by using C/C++.
- pjmlp 9y agoLet me know when I can use Rust in Android, iOS and UWP with the same level of tooling and libraries support as C++. I want to eventually use it, but not at the price of my productivity.
- tytytytytytytyt 9y agoHow do you know if someone likes Rust/is a vegan/does Crossfit?
- zeveb 9y ago> I would stay away from dynamically-typed languages (e.g., the Lisp and Scheme families) for software engineering. Dynamic typing means more run-time errors Note that Common Lisp has type declarations, which can move type errors from run-time to compile-time. ML is a nice language family if you want something which is typed and participates in the Lisp mindset.
- dreamcompiler 9y ago> Note that Common Lisp has type declarations, which can move type errors from run-time to compile-time. This is a dangerous assumption. The standard does not require that Common Lisp type declarations cause the compiler to detect type inconsistencies (although some implementations might be smart enough to do so in some cases). CL type declarations tell the compiler it can remove runtime checks. They are performance optimizations. If anything they decrease type safety.
- yorwba 9y agoApparently the solution is to check the type before you declare it: https://stackoverflow.com/questions/32321054/using-declare-type-but-still-have-safe-functions/32325488#32325488 https://stackoverflow.com/questions/32321054/using-declare-t... I assume that most CL compilers are smart enough to optimize calls to such checking functions when they occur in a context where the type has already been declared. And you can probably write a macro to make it more convenient ...
- dreamcompiler 9y agoThere's no guarantee any given CL compiler will optimize such calls away. It would probably be considered wrong for the compiler to optimize them away. Remember that type declarations mean "don't check the type, ever." They do not mean "check the type at compile time" because CL never checks types at compile time.[1] The technique in the example can defeat the purpose in simple cases (like the example) because type declarations removed runtime type checking and then you manually added it back in. But it's a useful technique in cases such as an inner loop from which you remove type checking inside the loop, but move it out of the loop. This is an advanced CL technique. You have to be very careful about such things as adding 1 to a fixnum in the loop and possibly overflowing it, which is exactly what you have to care about in C. [1] modulo certain compiler quirks and the use of compiler macros, which are an advanced technique.