/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1435608639080.jpg (1129x1500, 893K)

Other urls found in this thread:

youtube.com/watch?v=xx7Lfh5SKUQ
twitter.com/NSFWRedditImage

>what does FP have to do with lambda calculus
fuck tripfags

Attached: 1548615028483.gif (640x360, 354K)

Lisp is the most powerful programming language.

Laughing at this haskell fag who thinks his abstractions are only allowed in FP languages.

>mfw people think pedantic type systems are "functional programming"

D is the best programming language I know. It's not the best possible language, but it's the best there is. Let's see how Nim turns out to be.

>D
>Nim
Come on, this is just sad. Deadlang and deadlang 2.

What exactly does pattern matching have to do anything with FP?

Didn't you know, Dependently typed langauges are only allowed in FP!

>do literally all of the things associated with functional programming
>it isn't FP because my favourite "OOP" language has recently added this feature (it needed it to suck less)
FPlets btfo yet again

>mfw there are people who think non-lazy languages with side-effects can be considered functional

Arduino Wifi robots using wiring instead of motor controller

Attached: 15FDB022-24A0-4C55-9FFA-C18662BFECEB.jpg (220x139, 9K)

Erlang has built in pattern matching so all the purity fags thing it's a landmark of FP.

>mfw programs without side effects cant actually do anything

DELET THIS

This really does annoy me, honestly. Erlang is not functional. It is nowhere near functional. It's the same with JavaScript. Closures do not a functional language make.

>Erlang is not functional.

Attached: 1544938358663.jpg (500x375, 92K)

FP does a lot of things that linear proc/OOP do too, I don't see anyone moaning about it like you are. Why is that?

Is it better practice to use Properties.Resource.XResource rather than
FromFile("file.jpg") ?

AHAHAAHAH
No
Come back when you have 0 side-effects.

It is csharp btw

Still working on chicken scheme bindings for wlroots. After fighting with the gc for a while, I am finally able to render application windows.

Attached: gahahaha.jpg (540x400, 50K)

Shouldn't you ask microsoft java specific questions in their shitcord channel or something?

Why are you so fucking retarded? Did you fall on your head as a baby?

It's not. Sorry but it isn't functional and you're not doing FP when you write code in it.

Not an argument. Sorry if I hurt your feels.

A while, I'd realised that we haven't had any resident tripfags in these threads for ages. The last I can remember was Ruby and that /o/ fag.
Now that there is another one here, I can't say that I miss having them.

Attached: 1543088326562.jpg (168x58, 5K)

>shitcord

I would rather cut my balls off with a hot spoon than using that abominable thing.
Why do you have to shit up /dpt/ ? i just want to discuss programming good practices.

I get it now, you're just braindead.

It is increasingly obvious that the people hating on FP right now (not necessarily in general) are retarded, and have no idea what FP actually is.

t. Erlang isn't FP.

I said this because that's a microshaft java specific question and you should ask for the best practices to your fellow pajeets in shitcord.
Am I clear?

>using anything other than Java 2k19

u fuckin hipsters " ooooh look at me i use rubyyyyy derppp heprppp i use python herppppppppppppppppp

Idris is not FP.

Most people who advocate for FP have no idea what FP is because they think things like DRY and type systems are FP

Too bad you can't even realistically use Java 11 until all of your dependencies or libraries you use update past Java 9/10 due to functionality removed from the JVM.

Obviously if you can.

Having lambdas, pi types, lazy parameters and pattern matching doesn't mean a language is magically FP.

DRY isn't FP, it's just that FP languages are almost always much easier to avoid repeating yourself in. FP languages mostly come from the same PLT crowd as (good) type systems.

If your language has IO it's not FP.

Based and redpilled.

No, but if those are the main features then it is FP.

projects that will help me learn linear algebra?

Anything graphics related. Draw some random shit with OpenGL.

The Apollo Guidance Computer is a whack ass piece of design
youtube.com/watch?v=xx7Lfh5SKUQ

haha, so you discovered DRY doesn't mean FP or vice versa. There's your redpill of the day. Shove it up your ass.

dont learn linear algebra its useless

any language with sufficiently powerful abstractions is very easy to avoid repeating yourself in
FP abstractions are as much a curse as a gift and their super-complex type systems only exist to try and offset that fact, not because they're actually good

Wrong. If your language has IO and allows modification to memory after assignment then it is not FP. Stop trying to pretend your FP-lite languages are FP. They aren't and have nothing to do with FP.

Learn Lisp.

>pattern matching is related to FP in any way

Attached: 0cbpdjii3pa11.png (645x729, 105K)

what makes you think we want FP? it's a fad.

Fucking hell. Look up the mathematical definition of a function. Then infer from that what a functional language is.

import matrix

How can someone so retarded be this egotistical
>inb4 because he's a trip

>the mathematical definition of a function
Which one?

>In computer science, functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. It is a declarative programming paradigm, which means programming is done with expressions or declarations[1] instead of statements. In functional code, the output value of a function depends only on the arguments that are passed to the function, so calling a function f twice with the same value for an argument x produces the same result f(x) each time; this is in contrast to procedures depending on a local or global state, which may produce different results at different times when called with the same arguments but a different program state. Eliminating side effects, i.e., changes in state that do not depend on the function inputs, can make it much easier to understand and predict the behavior of a program, which is one of the key motivations for the development of functional programming.

IO is a side effect
"FP" with IO is not FP.

do something with 3d graphics as it involves vector matrix math

>no mutability
how retarded. Especially when you realize these FP language creates binaries that sits on RAM, not ROM. hahah

Ultimately FP is useless.

whether you like it or not, pattern matching is associated with FP for largely historical (but still incidental) reasons
anyway, i said when those are the main features, not just having a single one of those

final Integer[] empIds = { 1, 2, 3, 4 };

final List employees = Stream.of(empIds)
.map(employeeRepository::findById)
.filter(e -> e != null)
.filter(e -> e.getSalary() > 200000)
.collect(Collectors.toList());


You may not like it, but this is what peak functionality programming looks like.

Benefits of haskell?

You're just stroking my ego.

Programming isn't a fucking cultural phenomneon you idiot it's science
Pattern matching has nothing to do with FP. You can do it with any language

Is this true?

Today I learned that FP doesn't actually exist. But also Haskell (a non-FP language which has nothing to do with FP, and all of its features are actually non-FP) is exactly why FP sucks. Only an ivory tower academic (btw, everything ivory tower academics do is actually NOT FP) could like FP

You get to shitpost about it on /dpt/ if you learn it.

It can't possibly be true.
Nobody uses Linux.

>Stream.of(...)
>.collect(Collectors.toList())
what did gosling mean by this?

Why the fuck is OOP still a thing? OOP language features are just poor man's modules. If your language has a decent module system (ideally similar to StandardML), OOP is worthless.

And OOP as a way of modelling the reality is wrong and broken. Do not ever do it.

Attached: q5OL30E.jpg (600x315, 16K)

This and the last thread prove that you get to shitpost about it on /dpt/ even if you don't learn it

Can you imagine that this entire argument started all because the Idris shill posted a bar graph he made in MS paint to shill Idris some more.

polymorphism is the benefit of OOP

Mostly yes.

Attached: 1539157047860.gif (800x450, 3.49M)

>employeeRepository::findById
Is this new syntax? Is this Java? What the fuck

dumb frogposter
>programming is science
only if you're using the old usage of science before spiritual IFLS redditors took over (well before the creation of reddit)
>muh new organ
>muh scientific method
bacon was a fucking retard

Method Reference. It has been a thing since Java 8.

what?

>And OOP as a way of modelling the reality is wrong and broken. Do not ever do it.
Well, that's just wrong. Objects really do always fall under one type or another. For example, an animal can be a dog, or a cat. Not both.

Programming is an art. Haskell CODE ARTISANS are the brush and your computer is the paper.

>OOP language features are just poor man's modules
What features?
>And OOP as a way of modelling the reality is wrong and broken.
It's more practical than no I/O and pointless allocation just for the sake of avoid mutability.

Learn CLOS.

fixed the OP

Attached: itt.png (542x287, 151K)

It's the canvas, you peasant.

Haskell is the closest thing you can get to FP. In the early days of Haskell IO was actually not a thing and only came back when they discovered monads. There's an interesting talk by its creator about this. Also funny enough the creator of Haskell is actually a really nice guy that is happy to see "non-FP" languages getting features from "FP" languages that they've been missing for a long time, unlike Jow Forums that has autistic meltdowns over "non-FP" languages getting new features.

Attached: 1548742766233.png (661x716, 74K)

>funny
That wasn't funny.

People aren't complaining about languages getting FP features, they're complaining about the total lack of recognition for FP despite this. Saying a language that isn't 100% pure isn't FP is totally ridiculous, how can you say this while also saying non-FP languages are getting FP features?

why do you fucking care

Could it be... that there's more than 2 people in this thread?

You're a disgrace.

I have a favorite programming language.

I want to spend by valuable time for it. Is it worthy?
I spent my time with scheme lisp mostly and want to upgrade myself :)

why does it matter what is considered functional programming or not? it's just a word

Attached: 1496260498328.jpg (549x516, 150K)

There's a lot of stuff in Haskell you won't see in e.g. C++. It's quite interesting to learn, and has a decent type system.

Was this post really needed?

> decent type system
> decent

what more do you want?

Idris has a better type system. Honestly Idris is what Haskell should have been.