but still along the same lines as "safer". the stresses are different, "safer" has the stress as "SAY-fer" and "secure" has the stress as "sih-KYOOR". the latter sounds more similar (and rhymes better) with "more", the originator of the phrase "less is more"
I was hoping this article would be a little more concrete, but it seems that it largely is talking about the takeaways about functional programming in a philosophical, effort-in vs value-out kind of way. This is valuable, but for people unfamiliar with functional programming I'm not sure that it gives much context for understanding.
I agree with the high-level, though. I find that people (with respect to programming languages) focus far too much on the specific, nitpicky details (whether I use the `let` keyword, whether I have explicit type annotations or type inference). I find the global, project-level benefits to be far more tangible.
It's a shame that this is not the link that was submitted because that (long) article was a really interesting read that gave me some food for thought and also articulated a bunch of things rather clearly that I've been thinking in a similar form for a while. I'm not sure that I agree with all of it, though (I still prefer maps, folds etc. over explicit loops in many cases, but do agree that this is less important than the overall code architecture).
Context: I posted my functional programming lectures to HackerNews some time ago (this thread: https://news.ycombinator.com/item?id=38351195) and finally got around to writing a blog post about my experience teaching functional programming. You can read about my experiences here.
There's no reason this couldn't be done. Indeed, in OCaml (which I am more familiar with), you could easily define:
```ocaml
type 'a nonempty = Single of 'a | Cons of 'a * 'a nonempty
```
This would be the type of lists that contain one or more elements of the type parameter.
I think it's just convention that typically, when we talk about lists, we are interested in the empty case as well. Finding "all X that satisfy P in Y", as a general computational problem, is _very_ common (consider: filtering a list, querying for a predicate in a collection, finding sequences of moves in a search space), and generally could result in an empty list as a possible output.
In a non-practical sense, if you want the type theory, another reason is you can think of `[a]` as the free monoid on the collection of `a`. In other words, strings of elements of `a`, joined via concatenation. This monoid requires a unit, which is the empty list.
This one makes sense to me, since lists are way more canonically used than arrays in functional languages. I rarely find myself constructing array literals -- I'm far more likely to simply convert from a list.
Though, I agree the semicolon delimiting is regrettable.
This is Haskell-specific, it sounds like. I agree, the IO monad is really quite inconvenient sometimes.
I work in OCaml, which is also a functional language, but prints can be added in single lines. I address this point in Lecture 19 (Imperative Programming), actually, but my perspective is -- we invented immutability and purity to serve us, but we need not be fanatically beholden to it. In my opinion, I think Haskell goes in that direction, when every usage of IO now needs the IO monad to get involved.
A little mutability is OK. Functional programming is about the avoidance of side effects, more than simply forbidding it.
Unfortunately, it does not. These lectures are "mine", in the sense that I developed all of them myself, but the homeworks and lab exercises are the combined efforts of generations of TAs and instructors from the past. It wouldn't be right for me to give them away. (they are also reused from time to time, so there are academic integrity concerns with that also)
(but I have thought of developing my own exercises independently to go with the lectures, to post on my website. This is generally a lot of work, though, so this might take some time, depending on how much people would benefit from it.)
TIL. Given that 15-213 has been widely available for years I naively assumed this would also hold true for other undergrad CS courses, but apparently not.
Being a cranky shithead and scrolling through HN. Name a more iconic duo. Seriously though, if your first reaction to a neat source of information is to shit on it with snark and thinly veiled assholerry, please leave the internet for a week. There are better ways to give constructive feedback
In some ways I can only agree, having criticised others for apparently doing the same thing. I guess the difference is that it was completely bloody unnecessary to waste enormous amounts of bandwidth for the cost of just a little bit of basic checking. For me individually, bandwidth is virtually free, for others it is metered (not everywhere has Western-levels of Internetz). But bandwidth is not free – multiply up 49.2 MB by a number of expected page visits.
So, as a matter of principle we need to stop acting as if resources are free. Also if the author couldn't even get that simple HTML detail right then it potentially says something about the quality of his site's information. Perhaps.
> Also if the author couldn't even get that simple HTML detail right then it potentially says something about the quality of his site's information. Perhaps.
Perhaps is doing some heavy lifting here. I take it from the fact that the lectures are on Functional Programming that OP might not be a front-end developer and might not have the level of care needed for front end to compress the images in a way that renders nicely. So,
Perhaps you ought not judge someone releasing their free teaching materials for a backend class on their front end development, when the site is a centered <div> with purely static elements.
Perhaps you ought to slow down and do some critical thinking before being critical of others.
I'm a back-end dev (inc. FP) and RDBMS guy and even I'd know not to do this; instead to pre-shrink images presented as decorative thumbnails. But let's be constructive, what form should my critical thinking have taken, how should I have done better (edit: or criticised more carefully)? Serious question. Thanks.
As a matter of principle, those in bandwidth-constrained situations should be browsing via proxies or browsers that automatically compress, such as Opera Mobile back in the day, or Google’s more modern compression baked in to Android/Chrome. (If it still exists, it’s been awhile…) That said… yeah, it couldn’t hurt to put a free CloudFlare CDN in front with automatic image optimization, for example.
> "it was completely bloody unnecessary to waste enormous amounts of bandwidth"
Thats not enough. It was completely bloody unnecessary to waste enormous amounts of co2.
And critical thinking should lead to the realization that not many people have to solve the - albeit small - mistake of an individual via Cloudflare or similar, but rather someone should do it correctly right away. And if he has no knowledge of frontend, he should not do things he has no knowledge of.