Skip to main content
edited body
Source Link
Adam Lear
  • 32.1k
  • 8
  • 104
  • 126

It is similar to poetry, which is elegant language.

Poets can say in very few words what it would take others pages, and pages, to say and not as well. Elegant coders can do the same with code.

A typical example is comparing a typical implementation of quicksort in C with mergesortquicksort in Haskell:

quicksort :: Ord a => [a] -> [a] quicksort [] = [] quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) 

(lesser and greater can be inlined for a three line solution).

It is similar to poetry, which is elegant language.

Poets can say in very few words what it would take others pages, and pages, to say and not as well. Elegant coders can do the same with code.

A typical example is comparing a typical implementation of quicksort in C with mergesort in Haskell:

quicksort :: Ord a => [a] -> [a] quicksort [] = [] quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) 

(lesser and greater can be inlined for a three line solution).

It is similar to poetry, which is elegant language.

Poets can say in very few words what it would take others pages, and pages, to say and not as well. Elegant coders can do the same with code.

A typical example is comparing a typical implementation of quicksort in C with quicksort in Haskell:

quicksort :: Ord a => [a] -> [a] quicksort [] = [] quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) 

(lesser and greater can be inlined for a three line solution).

It is similar to poetry, which is elegant language.

Poets can say in very few words what it would take others pages, and pages, to say and not as well. Elegant coders can do the same with code.

A typical example is comparing a typical implementation of mergesortquicksort in C with mergesort in Haskell:

mergesortquicksort :: Ord a => [a] -> [a] mergesortquicksort [] = [] mergesortquicksort (p:xs) = (mergesortquicksort lesser) ++ [p] ++ (mergesortquicksort greater) where lesser = filter (< p) xs greater = filter (>= p) xs 

(lesser and greater can be inlined for a three line solution).

It is similar to poetry, which is elegant language.

Poets can say in very few words what it would take others pages, and pages, to say and not as well. Elegant coders can do the same with code.

A typical example is comparing a typical implementation of mergesort in C with mergesort in Haskell:

mergesort :: Ord a => [a] -> [a] mergesort [] = [] mergesort (p:xs) = (mergesort lesser) ++ [p] ++ (mergesort greater) where lesser = filter (< p) xs greater = filter (>= p) xs 

(lesser and greater can be inlined for a three line solution).

It is similar to poetry, which is elegant language.

Poets can say in very few words what it would take others pages, and pages, to say and not as well. Elegant coders can do the same with code.

A typical example is comparing a typical implementation of quicksort in C with mergesort in Haskell:

quicksort :: Ord a => [a] -> [a] quicksort [] = [] quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) 

(lesser and greater can be inlined for a three line solution).

Post Made Community Wiki by user33201
Source Link
user1249
user1249

It is similar to poetry, which is elegant language.

Poets can say in very few words what it would take others pages, and pages, to say and not as well. Elegant coders can do the same with code.

A typical example is comparing a typical implementation of mergesort in C with mergesort in Haskell:

mergesort :: Ord a => [a] -> [a] mergesort [] = [] mergesort (p:xs) = (mergesort lesser) ++ [p] ++ (mergesort greater) where lesser = filter (< p) xs greater = filter (>= p) xs 

(lesser and greater can be inlined for a three line solution).