3 ms·
> Haskell has the C preprocessor I'm not sure what you mean by that. Are you saying you can use #ifdef, #include etc. in Haskell code? > No offense but this j
by yakubin 6y ago
> Haskell has the C preprocessor
I'm not sure what you mean by that. Are you saying you can use #ifdef, #include etc. in Haskell code?
> No offense but this just sounds like bad design.
I agree. However that's just one way you get multiple definitions for the same struct. I think a language should detect such an error. It will detect it for functions. If linkers did not detect multiple function definitions, would you shrug it off by saying "having multiple function definitions is bad design"? (I'm asking in a non-accusatory way. I'm not sure how to word the question more gently.)
Many of us don't have the luxury of choosing the quality of code we're employed to debug. It would be nice if languages had some rudimentary sanity-checks to, well, preserve our sanity.
- logicchains 6y ago>I'm not sure what you mean by that. Are you saying you can use #ifdef, #include etc. in Haskell code? Yep: https://guide.aelve.com/haskell/cpp-vww0qd72 https://guide.aelve.com/haskell/cpp-vww0qd72. >Many of us don't have the luxury of choosing the quality of code we're employed to debug. It would be nice if languages had some rudimentary sanity-checks to, well, preserve our sanity. I agree, I don't think C++ is especially bad in this regard. If people are going to write bad code, they can write it just as well in Java, C#, Python etc., they'll just use different language features to bring about the horrors. No language (apart from maybe Go, in its extreme simplicity) can save us from having to debug bad code.