/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

cacm.acm.org/blogs/blog-cacm/176450-python-is-now-the-most-popular-introductory-teaching-language-at-top-u-s-universities/fulltext
cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
composingprograms.com
twitter.com/SFWRedditGifs

Stop rewriting shit in JS

Has Haskell gone too far?

No

>rub out

>strike up conversation with random couple at festival
>turns out he's a programmer too
>immediately proceeds to turn the conversation into a penis contest to impress his girlfriend or wife

Him
>What do you work with?

Me
>Java currently

Him
>Ha!
>I used to program IBM AS/400
>You type in just code, real coding! no GUI!

I didn't stoop to his level even though I used to program embedded devices in C for a living.
Lesson learned: Don't even bother talking to programmers.

Worse than all these esoteric Haskell "features" is the cruel C++ retards trying to ape them in C++2034 or whatever they're on now.

If your languages C interface can't declare variadic function, pass struct by value to C function and receive struct by value from C function then your language is SHIT.

It's a library, the real feature is RankNTypes
C++ will never (probably never?) have RankNTypes, same as D and other languages that are married to templates versus generics
Rust has some existential-esque stuff that might deal with this, dunno. Rust is a meme lang.

If C added generics in the style of void* with types (i.e. the same code, rather than templates that are copy/pasted code) then they could do this too

Women ruin everything, including programming.

i don't want this shite

>>Java currently
I'd give you some shit too tbqhwu

t. 1st year CompSci student

Yeah, I used to think everyone should be written in Assembly and/or C too
Then after the 2nd semester everything should be LISP or Haskell.
Then you get your first real job.

then stop programming

>t. 1st year CompSci student

Everything *should* be written in Lisp or Haskell, but sadly it isn't.

Too many companies fell for Java marketing.

stop infecting programming with esoteric mind-wank you thought up while on psychedelic research chemicals

what's wrong with rank n types? it just lets you treat generics in a more first class fashion

Most universities start teaching programming through Java though. Most 1st year CompSci students actually think Java is god and whatnot.

We were taught C and two Assembly languages in the first semester. You had to translate C programs to Assembly and vice versa in the exam, on paper.
2nd semester was functional programming.

keep your anti-intellectualism out of programming please

it's just another not-really-useful language concept i can't be bothered to grok, probably crapped out by a category theorist

just like write program

>not-really-useful language concept i can't be bothered to grok
Perhaps you don't think it's useful because you don't understand it

Generics are good.
Do you agree?

cacm.acm.org/blogs/blog-cacm/176450-python-is-now-the-most-popular-introductory-teaching-language-at-top-u-s-universities/fulltext

Yeah, programmers tend to be pretentious, snobby assholes osure
Especially younglings, ugh. It's kinda weird, other engineers or science people I met are normal people

Don't be like that anons

How depressing.

Given the attitude of most modern developers toward learning new languages, the future will be Python and JS.

>t. 1st year CompSci student
t. can't take a joke because he hates his job

Is it always fine to represent a binary number in two's complement form and just add, in order to solve a subtraction problem?

It should be fine, right?

>OO language conference telling people that computers aren't magical

i look forward to your paper on Rank 7 Collapsed Whistling Dickhole Cyclic Type Graph Topology Accessors. it's gonna be a killer pattern/language feature.

it's probably not very useful if i have not hitherto had occasion for it.

they have their uses sometimes. i don't reach for generics enough for their absence from a language (or a crap implementation of them) to be a deal breaker, though.

You got me, lol

Yes, best to avoid the topic with most programmers IRL

>it's probably not very useful if i have not hitherto had occasion for it.
You've been reimplementing it ad-hoc countless times. It's just like monads or any other FP concept, in a way. But it doesn't matter, I'm sure writing the same code over and over again is more pragmatic, at least until Java or C# adds it at which point it will suddenly become indispensable.

kek

RankNTypes basically means you can deal with generics in an almost first class way, i.e you can take, as a parameter, a generic function

>the future will be Python and JS.
I don't really think that's fair. Python is nice as a learning language since it borders on executable pseudocode and makes itself very apparent that it's a layer of abstraction; learners eventually realize that they have more to learn after they figure out the language.

>You've been reimplementing it ad-hoc countless times.
do you have an example, in concept or in code, of what would be considered a reimplementation of RankNTypes?

>at least until Java or C# adds it
i never use either of those.

>almost first class
>almost
wtf i thought this was supposed to be a silver bullet of a sort.

why doesn't it have a less esoteric name when used in the practical implementation of language features? why not "almost first class generics"?

>let's settle this bitch right now faggot
>winner takes the hoe
>fire up hackerrank on your think pad
>nothing personnel, just programming

>Python is nice as a learning language since it borders on executable pseudocode and makes itself very apparent that it's a layer of abstraction; learners eventually realize that they have more to learn after they figure out the language.
I've met way too many people who've become dependent on Python and its quirks. They struggle to use any other language that doesn't behave and look exactly the same way.

...

Any interesting python realted things I could work on? Had to learn it in first year comp sci, so no bully.

>do you have an example, in concept or in code, of what would be considered a reimplementation of RankNTypes?
Yes.

it's not a silver bullet because of complicated reasons

it's called rank-n-types because it means the types can have arbitrary "rank"
i forget the exact details

but anyway, it seems like you might want to be able to pass around generic functions as parameters, and manipulate them at runtime

cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html

if you want a silver bullet you basically want either dependent types or non-HM polymorphism

not really.

sounds like more bollocks.

at last i truly see.

So bollocks means things you don't understand? Got it.

>They struggle to use any other language that doesn't behave and look exactly the same way.
So?
If they learnt some other (powerful) language they would behave the similar way.

The guy who gives that talk is the antitheses of everything oop stands for. The entire talk is about abandoning oop for speed. He basically writes pure C, and regularly rips on people for using OOP.

can you stop responding for me?

It seems to happen at a much higher rate when the language taught is Python, in my experience.

It is regrettable that we do not start students off with Scheme and (Haskell or a dialect of ML).

why not?

>They struggle to use any other language that doesn't behave and look exactly the same way.
Being close minded is language independent, user. There are still people who unironically develop modern software in raw x86 assembly because they're used to it.
Python is also harmless if it's used as a frontend to libraries written in a better language, so they can just go back to it when they know better, anyway.

I'm only responding for myself.

>Scheme
there's no need anymore
composingprograms.com

>Python is also harmless if it's used as a frontend to libraries written in a better language, so they can just go back to it when they know better, anyway.
This just makes it worse. "Why should I learn any other language, if somebody else will just write a Python wrapper for the stuff I need?"

>teaching freshmen haskell
that should be f u n

can you at least tell him that you aren't speaking for me when you call him a fag for asking questions or being suspicious?

I feel ill.

It is commonplace at many universities.

>"Why should I learn any other language, if somebody else will just write a Python wrapper for the stuff I need?"

Well, that is a pretty good pragmatically-minded question. Why should they?

I'm a webdev and I got constantly technical questions in python and java during job interviews

what the fuck

I'm saying that his dismissal of concepts using various vulgar terms appears to be far more related to his unwillingness to grapple with them than to their utility.

you could be a bit more diplomatic

>he doesn't boof ETH-LAD and write Idris code during his ego deaths

>Why should they?
Because Python is an extremely difficult language in which to create reusable abstractions and use them correctly, with very limited tool support, that leads to unnecessarily bloated and repetitive codebases, and has a tendency to produce many more bugs than other languages.

Indeed I could.

Whats the difference between web developpers and programmers?

What fucking utility do they have?

You're missing the point. They have to *want* to know more, you can't just force it.
>somebody else will just write a Python wrapper for the stuff I need
Well... that IS a pretty good question. Do you really want more wheel reinventors?

Programmers don't get upset when asked to write code in interviews.

The difference between electricians and physicists I suppose

>in this itt we trigger /dpt/ to tits

No difference.

just say you write lisp compilers for fun on the weekend


i mean, you do do that right user?

They enable you to write generic, reusable code and reduce the number of unit tests needed in your codebase.

>be in job interview for frontend position
>first question on paper is about binary tree
>wat

I once had to implement Huffman compression in a JavaScript frontend
You should know basic data structures in any case

>generic, reusable code
ah yes, that meme ideal. in practice, no one tends to reuse code.

Build a x64_86 assembly ide in python

>no one tends to reuse code
Because most code written in popular languages is not actually reusable.

How difficult could it be? Just answer ln(n) on each questions

popular languages are obsessed with genericness

They ruin it by not having referential transparency.

Also, first-order generics only get you so far.

hahaha

define "reuse code"
I use man of the same Haskell functions all the time, especially fmap, map, filter, (.)

Julia lacks referential transparency, but it still does a pretty good job of getting code reuse out of its generics (better in practice, if not in theory, than most of the Haskell code I've looked at).

If anybody can help me with this
please, here is a cute cat.

The idea is that I can insert a new name any time I want, it's not a single stream of data I'm inserting once only.

>Huffman compression

Even by technical interview standards, that's a bit of a weird choice of question to be asked.

priviet tovarish, moi drug

I love the cat.

too real...

He's also retarded.

I'm didn't do one year of programming yet.


What is all this Assembly vs LISP/Haskell about?
And what does it have to do with a programmer job?

C++ is a shitheap

Reminder to not reply to this


Variations of this "phonebook problem" are common in interviews to weed out the retards (i.e. literal drooling mongs)

Why?

t. 3rd year comp sci student

>sperg languages like Java are now okay because I'm forced to work with them (at low pay)

why didn't you just apply to real programming jobs, like C and C++?

C++ is worse than java though

t. bitter helpdesk support "programmer"

sure