/dpt/ - Daily Programming Thread

Haskell is the future edition

>Object-oriented programming is eliminated entirely from the introductory curriculum, because it is both anti-modular and anti-parallel by its very nature.
-CMU professor, upon realizing OOP is unsuitable for modern computer science

existentialtype.wordpress.com/2011/03/15/teaching-fp-to-freshmen/

Old thread: (but who cares? we're looking at the future now!)

How will Pajeet manage in a post-Java world? I don't know, but myself, I can hardly wait for it.

learnyouahaskell.com/chapters

book.realworldhaskell.org/read/

chimera.labs.oreilly.com/books/1230000000929/index.html

Training wheels: docs.python.org/3/howto/functional.html (note that this is not even nearly as good as using a proper functional language like Haskell)

Other urls found in this thread:

talk.maemo.org/showpost.php?p=1047008&postcount=1655
csd.cs.cmu.edu/academics/undergraduate/requirements
cs.cmu.edu/~112/schedule.html
youtu.be/qlnU73a3Cw0
twitter.com/SFWRedditGifs

Why the fuck do I need math for programming?

encapsulation is good for necessary state

You don't as long as you're happy being a code monkey

ok so working on nis. i have set my install to main server, but i see in the vids that people setup another host when they do this. so should i setup another host to handle client server interaction or will it be ok with my install being the master server?

5th for Go

I don't get the need for all the books on performance. Just add a simple caching layer and you are good 95% of the time.

if you're no good at math, you think you don't need it because you don't know what you're missing and how crippled you are

if you know math well, you can recognize the situations where you need to use specific math knowledge to come up with an elegant solution for a particular problem

shig

kys

What languages does android natively run. Is there a way I can compile java code to run on an android console?

C

>What languages does android natively run
android has different java VMs, so it can run ARM code and java bytecode.

>tfw code monkeys try to convince me prolog is useless

what are you using prolog for

I signed an NDA. That's why that question is so annoying.

Control of effects through linearity, monads, etc. is better. Encapsulation to prevent the user meddling and leading to "invalid state" is BTFO by dependent types.

It's only useful for hiding implementation details and maintaining an ABI. In that case, just use PIMPL or a closure, you don't need a special public/private/whatever language feature.

so maybe it's useful for some le sekrit club stuff but it's probably not useful for general-purpose programming

talk.maemo.org/showpost.php?p=1047008&postcount=1655

>nokia
lol

>your opinion
lol

>java bytecode
are those not class files?

kys sperg every language except c and java is a meme and only used by retarded trap fags

...

Was it a good impression?

You don't. You need very very limited math. And if you need math it's because it's domain specific (if you're doing graphics you'd need the graphics related math).

>every language except c is a meme
Fix'd.

>kys sperg
>java

:^)

>is eliminated entirely from the introductory curriculum
>entirely

csd.cs.cmu.edu/academics/undergraduate/requirements
>**Students with no prior programming experience take 15-112: Fundamentals of Programming before 15-122.

cs.cmu.edu/~112/schedule.html
>Week #9 Object-Oriented Programming (OOP) (part 1)
>Week #11 Object-Oriented Programming (OOP) (part 2)

lel, debunked dat shit.

it's C++ and java, C is mostly irrelevant in this day and age, Ctards only like it because they're too stupid to understand OOP and use features that transcend fizzbuzz-tier babby programs

>what is embedded development

I'm learning assembly and I bet I'll someday be better than you could ever be with your Java shit.

You know, you can understand OOP and dislike it. Actually, I'd say liking OOP stems from a misunderstanding of how useless and harmful it is as a paradigm.

...

Question for those of you still studying: who do you bitch to about your grades when all your friends have worse ones that you do? I feel like every time I complain they just think I'm a prick because I had much more than them, but I need to talk about it to someone.

Bitch to /dpt/, but show us your tits first you pathetic little girl.

Just smoke a joint man

No one cares about grades anyway

What's your favorite paradigm?

Procedural and pure functional. Imperative can be modeled in pure functional using linearity/monads.

I care about my grades to an unhealthy point. I didn't choose to be like this and I can't just turn it off.

>Procedural and pure functional.

How did I know this would be your response? How did I know?

What's your point?

...

C++

std::vector points_list;
// ...

bool matrix = new bool[number_of_points];

for (size_t i = 0; i < points_list.size(); i++) {
if ( is_point_in_list(points_list[i], global_list) ) {
matrix[i] = true;
}
}


gives this error
error: invalid types ‘bool[int]’ for array subscript


i can't use int because points_list.size() is a size_t


what do?

>OSGTP
>expecting an argument
I'm sorry for you.

cast to int or use a better language

I'm trying to find a talk that was from some old guy at MIT (I think) where he basically gives a rundown of what computer science is, has been and should be and how the current aims in academia are far to short sighted.

I remember it being a very nice talk/lecture with tons of good ideas but I can't remember who it was.

Functional and procedural fags are utterly full of themselves and hopelessly delusional.

use size_t, you dumbass

>assigning an array to a bool variable

>bool matrix = new bool[];
That shouldn't compile.

...

>posting steban bobydeux

Not an argument

>matrix translation values are M[3][0],M[3][1],M[3][2]
>not M[0][3],M[1][3],M[2][3]

Fucking why do people do this?

I've never programmed before (besides some light bash and python scripting) and I'm going to try and force myself into Haskell.

Wish me luck, and I hope I don't hit a brick wall.

It's an old af convention

this

Not him but I really like the Steban meme. Less pointless discussion where opinions pose as arguments.

>use size_t, you dumbass
what part of
error: invalid types ‘bool[int]’ for array subscript
you don't understand?
>That shouldn't compile.
you wot
>assigning an array to a bool variable

what

Good luck user.
What's your plan of attack btw?

bool[] matrix = new bool[number_of_points];
new bool[] returns an array, not a bool.

you're just another brick in the wall.

row major is best major

new bool[number_of_points];

Returns a bool*.
You're declaring a bool.
Yet you're saying "error: invalid types ‘bool[int]’ for array subscript". As if the type mismatch wasn't an issue.
Fix that first.

Use:

bool *matrix = new bool[number_of_points];


or

bool matrix[number_of_points];


or

std::vector matrix(number_of_points);

...

>Not him but I really like the Steban meme.

I've come to like it, too, actually. It made me realize that very few statements are really arguments.

youtu.be/qlnU73a3Cw0

yeah my bad it should be bool *matrix

what about the other error?

Instead of trying to use an array of bools, why don't you use an int array with 1s and 0s instead?
It might be a bit more code, but it's less likely you'll fuck that up.

Well.. You can index your array now.
bool*[int] is ok.

if you have a translation vector at mno why wouldn't you store it contiguously in memory

c++, java, even python now

If Haskell is so good, why do Haskell programmers use git instead of something written in Haskell?

Your question is retarded. Please go be retarded somewhere else.

indeed, haskell is not good

He should be using an int for every 32 slots in the array. Just
unsigned int* boolReplacement=new unsigned int[(numberofBools/33)+1];
for(int i=0;i

I have no experience with Haskell, nor do I give a shit about Haskell, but your question is still retarded. You're fishing for an argument which makes you part of the problem of these threads.

So again:

Should have used sizeof and not assumed int is 4 bytes. Also missed the i++. Clumsy me.

If Python is so good, why do Python programmers use libraries written in C?

If Python is so good for prototyping, why do Python programmers go out of their way to use 3rd party libraries, rather than writing stuff themselves?

because bool is 1 byte and int 4 bytes. so , less memory consumption

i don't want to optimize that bad. thanks tho

does gcc 5+ default to c99? since when?

You can store 32 bools in 1 int

These are good questions. The only thing I use python for is scripting because I'm on windows frequently and batch sucks ass.

Seems a bit arbitrary to just be 4x as good when you could be 32x as good.
But whatever. Do what you like. It's not like the performance of this code matters right? Nobody would write it like that if they cared lol.

>If Python is so good for prototyping
>why do Python programmers go out of their way to use 3rd party libraries, rather than writing stuff themselves?
because that's exactly what makes it so good for prototyping

>Seems a bit arbitrary to just be 4x as good when you could be 32x as good.
>But whatever. Do what you like. It's not like the performance of this code matters right? Nobody would write it like that if they cared lol.

yeah it doesn't matter. it's just a simple graph problem

thanks

>it's good because someone's already done the work for me, fuck optimising or coming up with solutions better suited to _my_ code
This is why everyone hates Python kids.

...

self.kill = True

>You can store 32 bools in 1 int

>you can store 1 byte in 1 bit

It's made me come to realize that arguments do not actually exist

a bool only stores 1 bit of information

>He fell for the functional programming meme

There doesn't exist an optimal programming methodology for all problems, Boris. OOP won't die off.

wat

>the operator . is not defined

Well. That's the Stephan 'philosophy'.
Disagreements exist. Arguments are just a sophist word for disagreement.
Given perfect information we'd have all the answers through philosophy. But we don't have that.

Stephan is rather dishonest in all this because he's making major leaps just like everyone else. Except he's taking smaller leaps than most.

>Given perfect information we'd have all the answers through philosophy.
1) Not necessarily
2) Wouldn't perfect information already include the answers?

3) Pretty poor philosophy on your part.

I mean, I was having a giggle, but we could roll with that too

Not an argument.