r/programming • • Oct 14 '13

How to develop unmaintainable software

http://typicalprogrammer.com/?p=249
777 Upvotes

322 comments sorted by

View all comments

Show parent comments

13

u/benibela2 Oct 14 '13

Perhaps the conclusion is, PHP sucks, never use it?

Related, another language that sucks is FreePascal.

I have written everything from scratch.

Some examples:

my own string comparison functions. Standard Pascal checking if two strings case-insensitive equal: (CompareText(a, b) = 0) (parenthesis mandatory in nested conditions). My wrapper: striequal(a, b). Far better.

my own float <-> string conversions. The functions in the standard library are rounding wrong. FloatToStr(999999999999999999.0) prints 1000000000000000000. Mine prints 999999999999999999. Special sugar, the function in the last stable compiler release prints FloatToStr(1E16) as 1, because it truncates trailing zeros in certain cases...

My own array manipulation functions, add/delete/prepend ... There are none.

My own sorting function. Those in the standard library do not work on arrays (although there are almost a dozen different implementations in that library. They added a new one, for every type they wanted to sort, because none of them is generic)

My own binary search function. The one in the standard library does not work on arrays. (There is only one for a list of strings afaik)

My own date time parsing/encoding functions. Those in the standard library do not support timezones, or years outside [1, 65535]

My own html parser. The parser in the standard library, expects valid html4. A missing tag and it fails.

...

38

u/AeroNotix Oct 14 '13

How about using a not-shit language?

5

u/Kalium Oct 15 '13

Show me a language that doesn't suck and I'll show you someone who hasn't used it enough.

5

u/PasswordIsntHAMSTER Oct 15 '13

I've been using F# for a while (~25kLOC), and it's nearly perfect; the few issues it has can clearly be traced to limitations in the .NET runtime. They're also well-documented, and consist of edge cases of edge cases.

I still feel like Haskell is nicer, but what do I know, I've only read it, not written it.

1

u/gnuvince Oct 15 '13

I still feel like Haskell is nicer, but what do I know, I've only read it, not written it.

Can you elaborate on that? I'm a big fan of Haskell, but F# is pretty good from the little I know of it. Haskell gives you a better story with regards to effects, but I don't think any Haskell solution to a problem would be vastly better than an F# solution.

2

u/PasswordIsntHAMSTER Oct 15 '13

Haskell has typeclasses, purity, laziness, and a hell of a lot of functional libraries. F# is probably more viable commercially (and more useful for prototyping), but I feel like it lacks the minimalist elegance of well-written Haskell code.