Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Functional Programming is shit

Name: Anonymous 2014-05-12 22:28

Go read any book about functional programming or even features functional programming in the book. You will hear endlessly about how terrible imperative programming is. They will tell you about how functions in imperative languages aren't even real functions and they are error prone and hard to read and all sorts of nonsense. Keep reading that book, not because it has any useful information in it, but because it won't take long before they write a program in an imperative way and even stop to say "oh, it looks like our last program was sort of imperative... i guess shit happens". What they didn't want to point out was the inherent limitations of functional programming.

SICP is especially guilty of this. What's worse is that they insist on comparing everything to C's syntax. Watch as the haskell weenie brags endlessly about being able to implement quicksort in 2 lines. He's too dumb to realize the C version is a few lines longer and an order of magnitude faster.

Stay mad faggots.

Name: Anonymous 2014-05-12 22:36

weenie
penis*

Name: XUL 2014-05-12 22:55

yeah just look at programming language IRCs, everyone whining about set-cdr! being evil and things. it's ridiculous

Name: Anonymous 2014-05-12 23:08

B-but I can only code in LOGO >>1-senpai

Name: Anonymous 2014-05-12 23:15


// From Apache Commons Lang, http://commons.apache.org/lang/
public static int indexOfAny(String str, char[] searchChars) {
if (isEmpty(str) || ArrayUtils.isEmpty(searchChars)) {
return -1;
}
for (int i = 0; i < str.length(); i++) {
char ch = str.charAt(i);
for (int j = 0; j < searchChars.length; j++) {
if (searchChars[j] == ch) {
return i;
}
}
}
return -1;
}



(defn indexed [coll] (map-indexed vector coll))

(defn index-filter [pred coll]
(when pred
(for [[idx elt] (indexed coll) :when (pred elt)] idx)))

(defn index-of-any [pred coll]
(first (index-filter pred coll)))


Where's my for loop? - Programming Clojure, 2nd edition

Name: Anonymous 2014-05-12 23:19

>>5
Nice javashit. Who cares anyway?

Name: Oxymoron Police 2014-05-13 0:16

>>6
Nice javashit
You're arrested.

Name: Anonymous 2014-05-13 22:23

How do I optimize this


(defn is-queen-attacking? [[other this]]
(or
(= (last other) (last this))
(= (Math/abs (- (last other) (last this))) (- (first this) (first other)))))

(defn is-queen-safe? [queen board]
(empty?
(filter
is-queen-attacking?
(partition 2
(interleave
(map-indexed vector board)
(repeat
(count board)
[(count board) queen]))))))

(defn find-queens-r [board n]
(apply concat
(for [col (range n)
:when (is-queen-safe? col board)]
(if (>= (inc (count board)) n)
[(conj board col)]
(find-queens-r (conj board col) n)))))

(defn find-queens [n]
(find-queens-r [] n))

Name: Anonymous 2014-05-13 23:44

>>8
Rewrite it in C89.

Name: Anonymous 2014-05-14 0:25

>>9
ha

Name: Anonymous 2014-05-14 2:57

>>10
he

Name: Anonymous 2014-05-14 3:18

Name: Anonymous 2014-05-14 3:20

>>12

GAAAH FUCK

>>8

Rewrite it in [url=http://www.dangermouse.net/esoteric/chef.html]Chef[/url]

Name: Anonymous 2014-05-14 3:21

>>12
>>13
going to suicide now

Name: Anonymous 2014-05-14 4:17

Suicide in MY ANUS

Name: Anonymous 2014-05-14 8:42

>>14
Optimize your quotes, cretin.

Name: Anonymous 2014-05-14 9:22

>>12-13
What's with the sudden influx of imageboarders as of lately? They don't even have the common sense to click the preview button.

Name: Anonymous 2014-05-14 15:40

>>1
Functional programming isn't non-imperative programming. Functional programming is imperative programming done right and with lots of bonuses on the top.

Name: Anonymous 2014-05-17 4:19

>>17
Most likely people disillusioned with trip-homosexuals, ricers, reposters, and inane comments on /g/.

Maybe newfriends who didn't know about imageless boards until /prog/ being flushed caused a stirr.

Name: Anonymous 2014-05-17 4:27

>>19
stirr my stirrups

Name: imageless boards 2014-05-17 17:35

imageless boardsimageless boards

Name: Anonymous 2016-07-19 21:21

check em

Name: Anonymous 2016-07-20 0:23

>>1
(((Lispniks))) think imperative programming means C. That's like saying white people means Indians.

Name: Anonymous 2016-07-20 2:30

>>23
implying C isn't imperative

Name: posting 2 fast 2016-07-20 3:49

imageless boards sleep furiously

Name: Anonymous 2016-07-20 18:09

>>24
implying Indians aren't Caucasoid Aryan Goyim

Name: Anonymous 2016-07-20 18:49

>>26
Who are you quoting?

Name: Anonymous 2016-07-20 18:50

>>26
The original "Aryans" were a group living in what is now India and Iran (in fact the word "Iran" is derived from "Aryan"), around three millennia ago. In the 19th century, "Aryan" became a general term for those people in who spoke languages in the Indo-European family, residing mainly in Europe and Asia, as opposed to the Semitic people who spoke Semitic languages, and resided mainly in north Africa, the Middle East, and in western Asia. The association of the term "Aryan" with scientific racism and the Third Reich in particular comes from a 19th century hypothesis that the "Aryans" (in the above sense, referring to Europeans and Indians/Iranians) were all descended from a superior "master race", and that northern Europeans, the upper classes in particular, had the strongest genetic link to this master race, on account of their ancestry not being diluted by breeding with supposedly "inferior" races. The Nazis were supporters of this theory, and this explains why a movement that viewed blue-eyed, blond-haired white northern Europeans as the superior race became associated with a term that today refers mainly to people in the region of India.

Don't change these.
Name: Email:
Entire Thread Thread List