/dpt/ - Daily Programming Thread

Haskell edition. What are you working on, Jow Forums?

Previous thread:

Attached: 1537420328335.jpg (1033x1458, 471K)

Other urls found in this thread:

seas.upenn.edu/~cis194/spring13/lectures.html
github.com/dlang/druntime/pull/2286
hackage.haskell.org/package/mtl-2.2.2/docs/Control-Monad-Cont.html
twitter.com/NSFWRedditImage

I'm interested in learning a high level functional language. Should I look up Haskell or Lisp? Why?

Post some code of yours

Attached: 1541734627486.png (1507x941, 210K)

Rust is amazing

Attached: 1532754783476.png (652x624, 248K)

Haskell

javafx

from itertools import cycle
cycle(["bure >", "rumba >", "ringo >"])
Reminder that Python is an acceptable Haskell.

Haskell is actual FP. Lisp's may have FP elements but almost always prioritize flexibility over committing to any particular paradigm.

I've seen Haskell code that might as well just be C, it was so imperative. Why do people do that

What like?

>tfw you have to work in a group with a bunch of idiots who can't do basic shit but you have to work as a group and pretend contributed equally
Currently I've been taking some of my changes, emailing them to the other participants, and telling them to commit them. I know it's super retarded but what else can I do? If they did stuff on their own they either wouldn't get it done, or worse, do it in a way that is horribly broken and probably break the production server.

Why pretend? Either you fucked up early on by not delegating work, or they fucked up by not doing the work.

yeah I don't understand. I get that your teacher or whatever want you to work as a group, but if you really do your best to make it work and it doesn't then surely that must be fine?

Haskell is the premier functional language most other functional languages just derive a few features from haskell and make concessions for practicality's sake. Learning haskell is a good place to start and should make learning the less functional functional-languages easier. Try this course seas.upenn.edu/~cis194/spring13/lectures.html
It's an intro to haskell for experienced developers. It's the one everyone recommends. I'm almost finished with it and I'd say its pretty good.

I agree with table user from the previous thread. Who's with me?

>i agree with myself
Notice how nobody else gives a fuck.

I'm from a SysAdmin/DevOps background, and feel it is holding me back. I can hack around any DSL and Python/Ruby, but I can't create full fledge applications from scratch. It also takes me a long time to get up to date with other peoples codebases. We just hired a 21 year old chick who within an hour was submitted pull requests, which blows my mind. I've read it's best to focus less on the syntax of languages, and more of the overall concepts and "big picture". Where does one begin to read about this? I guess they are called patterns?

>I have to use python to plot data from multiple data files
>Script is done
>Need an easy way to clean old plots and make the new ones
What's the best automation tool to do the job? Make?

Did you ever go to college for programming?

Eh, the impressiveness of that depends on the complexity and content of the pull requests.One person has hundreds of contributions to the Linux kernel which are just putting "const" everywhere which while nice isn't that amazing.

>We just hired a 21 year old chick who within an hour was submitted pull requests
>chick
I can pretty much guarantee all of them were renaming local variables, adding misleading comments and introducing new bugs.

Hah, yeah. Looking at the PR right now, it's just a few if statements and some exceptions. Still impressive to me though. I didn't go to school. I've been so anti school for so long, and am now at the age of regret. I could have gone to 1 class a quarter and be done by now. Oh well.

What's the best way to plot clustered geographical data, in Python? Already tried Basemap.

Attached: 15404958954950.png (860x758, 12K)

dumb frogposter

C# dotnet winfag reporting in

Attached: 1541743475115.jpg (1102x735, 186K)

>writing applications in docker
>don't have a way to sync code or remote debug to a docker container
WAKE ME UP INSIDE

git gud, dumb frogposter

why not

Attached: 1541790167935s.jpg (197x250, 5K)

because my workplace won't pay for IntelliJ

>not getting a student email (edu.uk w/e)
you don't need to pay for IntelijJ though

>doing something illegal at work

use volumes? docker exec -it container bash and vim?

I want her to sit on my face

I think i'm too brainlet for haskell
it has too many cryptic operators whos descriptions contain cat-theory

the good thing is that all those operators are just functions that can be defined the same way as any other

what specific problems are you having?

Remember: C++ gets easier to read and write every new standards release.

C++??:
struct(json) Foo {
int x;
float y;
std::string asdf;
Bar b;
};

int main() {
JsonStream js(/* ... */);
Foo f;
js > f;
}


C++17:
struct Foo {
int x;
float y;
std::string asdf;
Bar b;
};

void operator(const JsonStream &js, const Foo &f) {
// deserialization code here
}

int main() {
JsonStream js(/* ... */);
Foo f;
js > f;
}

>struct(json)
i've never seen parenthesis after the struct keyword, what does that mean?

What is this syntax?
struct(json)
Metaclass shit?

>illegal
useful idiot

metaclasses
json is a metaclass and you're applying it to Foo to auto generate serialization and deserialization methods.

yes

Is this coming to C++20?

Probably not.

I am new to git.
I started using github and obviously I want to jerk off over contribution count.
I made a testing branch of the project I am currently working on, my commits there don't get counted.
Will each commit get counted when I merge the changes to master?

>C++ gets easier to read and write every new standards release.
I'm sure it will become marginally usable one day. Too bad there will be at least 20 superior alternatives to it by then.

Like javascript?

Phew
#include

int main() {
std::string(JUST){({JUST;})};
}


Guess what this means.

>Like javascript?
This, but unironically. Even JS is becoming usable faster than C++.

(it actually compiles)

>Guess what this means.
It means your life took a wrong turn at some point.

You have to be pretty damn retarded for C++ not to be usable for you.
My condolences. Lmao

github.com/dlang/druntime/pull/2286

...

You have to be pretty damn retarded for C++ to be usable for you.
My condolences. Lmao

It doesn't work like that, sorry.
But nice try though.

>It doesn't work like that
[citation needed]

Gotta get home from work first

I already use volumes and exec but you expect me to hook pdb into everything?
Total shit.
also volumes aren't for code

Lmao, poor little babby can't write in a language as simple as C++
LOL
Maybe Python or Javascript would be more your speed

Funny you should mention JS. It's a good analogy to C++: fucktards swear by it, while intelligent programmers understand how unusable it is and avoid it.

Imagine not being able to handle a scripting language

lisp (scheme) is better, you have so much freedom to do whatever the fuck you want. you're not tied to specific bullshit concepts that nobody really understands, and would take weeks if no months to kind of get the hang of it.
For example, if you want to do some complex IO, tough fucking luck in Haskell, but in Scheme, IO isn't a black sheep, it's just another tool, and so you can easily use it wheever you want.
I recommend Guile Scheme since it's easier to use than Racket

>he finds haskell IO difficult

Imagine using a programming language full of the most retarded design flaws and gotchas when you don't have to. Imagine being so fucking stupid and having such bad taste that you never stop to question the merits of such a programming language. Imagine being a Javascript/C++ programmer.

What's wrong with C++?

it is over-engineered

under engineered*
Needs more metaprogramming

I tried to write an email validator in python after learning the basics.
Its probably retarded in every way possible and could be done in like one line, tell me what i did wrong.

Attached: Untitled.png (872x987, 57K)

Yeah, I personally prefer just inscribing 1s and 0s on stone tablets, but C++ is okay when I want to just bang something out.

>What's wrong with C++?
Only 1 in 1000 C++ programmers actually knows more than 20% of the C++ standard, yet every one of them will claim to "know C++". If that doesn't invalidate the concept of C++ and a C++ "programmer" in your mind, you are not a programmer.

Now that the dust has settled, was call/cc a mistake?

>was call/cc a mistake?
Definitely. It should've been delimited continuations instead. They have much nicer properties.

>Look at me spout memes

hackage.haskell.org/package/mtl-2.2.2/docs/Control-Monad-Cont.html

Attached: anime.png (1000x1300, 786K)

Do you know more than 20% of the C++ standard, user? Any of them later than C++98.

That doesn't work quite like call/cc in terms of usage.

It's not that difficult m8 if you actually use the language for some time.
You've fallen for the "nobody can learn C++" meme.

learn one of each kind of FP language

Python already has functions for all of this. Checking if a substring is in string is just “@“ in email, counting them is just email.count(“@“), finding the position is just email.find(“@“).

>:(

Attached: 1476811327277.jpg (640x480, 38K)

That's not the same as Scheme's call/cc. They're quite clearly delimited continuations.

Lads when do I actually become a good programmer?

I've had 3 courses of C including algorithms and data structures and I still need google to find ideas how to solve most coding exercises

Do you, or do you not? Have you ever actually read it?

>You've fallen for the "nobody can learn C++" meme.
You mean anyone can learn to churn out shitty code from a subset of C++. I'm talking to you about actually knowing the language. Do C++ "programmers" even have a concept of actually knowing something?

Atfinder can be replaced simply with a built-in string function: my_string.find("@")

same with AtNumber - it can be replaced with my_string.count("@"

you don't need to put conditions in brackets like in line 19, in fact it is discouraged

try not to use comments like "self explanatory" - if it is then it doesn't need a comment at all, it's just cluttering

the for x in email block could be replaced with just if " " in email, because strings are basically just lists of characters in python

more superfluous brackets on lines 28, 34, 36, 40, etc. can be removed

functions in python are encouraged to use this format: my_function instead of camelcase, but some people swear by camelcase. however, in any case, functions should generally start with a lower case character like this: myFunction, ones that start with upper case aretypically used for class definitions like this: MyClass

it's clear that you're not familiar with python but to be honest your code is lot more readable than some of the junk i've come across.

desu the worst python scripts are those written by "pros" who love to jack themselves off by overwriting default functions, shoving lambdas anywhere they can, doing weird shit with decorators, etc. not to say these things are always wrong but it's always so obvious when someone is just trying to code-masturbate when they could have just made something readable.

You don't need to read the standard to learn a language, you just need experience in the language and a reference.
Yes, I know C++, I know quite a large portion of it, definitely more than 20%. And it's only shitty code if you're a shitty programmer.
Now shoo shoo with your dumb memes.

How so?

That seems like a programmer problem, not a language problem.

Attached: you can't learn c++.png (229x173, 67K)

>i never read the standard
>i don't know how much there is to know
>but i know some of C++, so i know C++
>and it's definitely more than 20% because i just feel that way
Imbecile. You disgust me.

I'm doing Dijkstra's in java with an adjecency list and its hard not to look up the answer to cheat

Lmao ok senpai.
Enjoy not knowing the most powerful programming language on Earth then.

You seriously and unironically don't even understand how a C++ int works.

Prove it

Thanks for the help user, I'll keep the default functions in mind.

You just admitted that you're incapable of judging how much of C++ you know. That invalidates everything you say.

>Prove it
I could do so easily if you were one of the "experienced" C++ fucktards I interview on a regular basis, but as it stands, you're just going to google how an int works and pretend you knew it, even though I know from experience 99% of C++ fucktards don't.

Have you read the entire standard of your programming language?
Do you know more than 20% of it?

In other words you have no argument.

It's just a memory reference right? What's not to know?

By the way, the sand thing is that we still accept C++ fucktards who don't know how an int works, as does any other company that uses C++... that's literally how sad and depressing it is in C++ world.

His programming language is either C, or it doesn't have a standard.

Keep coming up with non arguments are pretending you interview people.
Post your int related interview question or I don't believe you.

>Have you read the entire standard of your programming language?
Several of them, and I actually have read the entire standard of C++11 (not that I remember all of it, because that's not humanly possible).

>you have no argument.
You just ignore the argument, because you can't address it, because you've already admitted that you don't even know how much of C++ there is to know.