/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1555874712906.png (543x700, 331K)

Other urls found in this thread:

pastebin.com/0VbBCdhb
github.com/danistefanovic/build-your-own-x
alligator.io/js/async-functions/
twitter.com/SFWRedditImages

profunctors lenses monad comonads permanent unemployment contravariant distributive decidable
i love haskell

dumb rat poster

Attached: 1554676044847.png (433x713, 557K)

>wait for a new thread to make my post
>forget what I wanted to post

Attached: 1544909608264.jpg (161x110, 6K)

fuck opengl

It seems unit testing and test driven development can only really be used for things that are trivial anyway. Like, how would you test an OS? How would you test a path finding algorithm?

thanks for the tip

BURRITOS

Attached: 1546705720987.png (850x850, 388K)

are anime posters doing it ironically ?

Pair programming JavaScript with my gf.
Pic related

Attached: Do-jScrU0AAAQlf.jpg orig.jpg (1546x2300, 403K)

un post ironically

Struggling with Haskell brick. My list isn't scrolling for some reason.

you're cute user

Yes, I hate anime

Attached: 1554840773157.jpg (500x514, 27K)

any more details?

Not really. This is what I've got so far:
pastebin.com/0VbBCdhb

by exercising the code obviously. how would you test an operating system? by writing a program that hammers syscalls in every which way, and then compares the the program's standard output with the expected output. path finding? by giving it some obstacles and seeing if it finds its way to the destination.

well do you know which part isn't working? like if the event isn't firing, or if the state change isn't been propogated as intended, or if selection doesn't work?

With a brain like that it was probably about C++

getting a bit pissed off with vscode hitching and lagging behind my typing to be very honest with you, chaps. webshit "technology" has no place on the desktop.

Agreed, but OpenGL 1.2 was ok.

Has no place on the web either tbhdesufampai

true

All events are triggered. I suspect either one of these:
- This code doesn't scroll the list: _ -> handleListEventVi handleListEvent e l >>= continue
- The list elements have to be wrapped in some kind of container

>getting a bit pissed off with vscode hitching and lagging behind my typing to be very honest with you, chaps.
Any time I dare to type into the urlbar the entire browser comes to a crawl as it runs analytics and predictive searches on every character. Nobody knows how to program.

>hitching and lagging behind
literally every IDE ever

Stop using Chrome.

Geany doesn't do that.

Should've used Vim or Emacs. I hope you learn from your mistakes.

hell yeah

i like when i open a fresh tab and then firefox decides it's not going to take any input for the next second. i think this issue started with quantum. you used to be able to hit ctrl+t and tab over to the search box immediately. not anymore.

The book on top seems to be unreasonably thick.

Attached: javascript_the_good_parts.jpg (1023x612, 157K)

i used vim for years and learned from my mistake

This is under Firefox, although Chrome is even worse.

Internet browsers are getting so bad I'm having to use programs like netsurf and dillo. Two random fucks in Argentina can write better software than thousands of "software engineers" at Google/Mozilla. It's pathetic really.

Attached: 1559143686978.jpg (400x400, 35K)

Why are you even using the search box?

it's less laggy than typing in the urlbar. i only use the urlbar that for typing urls.

k-meleon and falcon and otter are quite good too

Calling geany an IDE is really stretching it. If you use VSCode with basically everything but syntax highlighting turned off it's also not going to run nearly as sluggish.
Emacs is even worse. A perfect example of Wirth's law.

Whoa, I never saw the browser lag in either of those, even on not-so-good machines. I guess you have way too many extensions installed.
Enjoy your Javascript!

*falkon

Yeah, Emacs is pretty laggy if your're running it on some 80s terminal.

desu i think my history might be too large

What I do is use a text file with links in it, since even the bookmark manager is so slow.

It's also nice just to be able to use standard programs like grep on your bookmarks and pipe them to your browser, instead of them being held hostage in a sqlite database.

Attached: 1558947709608.png (240x240, 19K)

Sounds pretty neat, user.

Attached: gscript.jpg (1152x1559, 1.44M)

going one level deeper:
newtype ComposeT f g h a =
ComposeT (f (g (h a))) deriving (Show, Eq)

-- Functor is basically the same ...

instance (Applicative f, Applicative g, Applicative h) =>
Applicative (ComposeT f g h) where
ComposeT f ComposeT x = ComposeT $ whut f x
where whut = () . () ()

for regular compose, you're basically doing liftA2 (). this is basically liftA2 (liftA2 ())

>tfw no big tiddie gf to take care of me for a couple of years while I program The Next Big Thing
life is pain

Hol up, why is C runtime library for Android written in C++?

You know too much

Do you think SQLite is trivial with its millions of unit tests?

i never know when i'm doing too much in a yacc file, especially when dealing with ad hoc domain-specific languages

whats the best way to go from babby tier string and list manipulation, endless if else and for loops etc to the next level, whatever that is?

and why does everyone hate noobs so much in these threads? had a guy foaming at the mouth earlier cos i posted my shitty code, dont you remember when you started

real /dpt/ posters do not bully newfriends

there isn't really a next level, there is only pomp and circumstance and indian-tier code

DOOT DOOT DOOT, ALL RISE FOR THE GRAND PROCESSION OF THE DELEGATE PROXY STRATEGY PROVIDER IMPLEMENTATION CLASS DOOT DOOT DOOT DOOT DOOT DOOT DOOT BELLS RINGING CANNON FIRING DOOT DOOT DOOT DOOT DOOT HORSES NEIGH AS THE CARRIAGE SPEEDS ALONG DOOT DOOT DOOT DOOT

>whats the best way to go from babby tier string and list manipulation, endless if else and for loops etc to the next level, whatever that is?
Oh no, that's high IQ, actual programming
Next level is OOP bullshit, and UI that sends an SQL query 500 times per second

>whats the best way to go from babby tier string and list manipulation
build yourself some shit. engine, database, whatever floats your boat

github.com/danistefanovic/build-your-own-x

I'm retarded. My code actually does work. It starts scrolling when the next item is not within the viewport. I thought it scrolled the entire list instead.

>the next level

are there any working compilers for this language?

Suppose I have a B* = &A. And I want to do A = C by allocating new memory for A so that the value B* points to doesn't change. How should I make A know what's pointing to it? (C++)

imo its b's responsibility to make a defensive copy to prevent other things from messing with it

add a list of dependents to A

I don't think so, haven't checked though.

Attached: bärenbande.webm (394x222, 284K)

Anyone tried making money online off programming (maybe freelancing or something)?
How much do you think you can make?
I live in a poor balkan country and if I its around the same an office job pays well might aswell work from home I guess.
What is the most required language/framework, Im guess since web dev js shit right?

Attached: 1539777538368.png (520x520, 261K)

parallel?
more like,
parallol

I guess you want std::exchange

javascript.

This. You don't actually want B* to be a pointer, you want it to be a copy.

I know you're used to reddit, but you don't need to press enter twice here.

using namespace std;

do
Not
USE
that
FUCKING shitty FEATURE! EVER!

if satan hates it, it must be good
use namespace std in every file

I think it is a time we make a compiler for pseudocode!

I bet your code is full of std, just like your mom

C++ is the language that gets defaults wrong by default, which is the wrong default.

NLP is still an unsolved problem

here's my pseudocompiler for pseudocode in pseudocode:
get code()
result

freelancing is impossible, you're in competition with the entire world so the jobs are like "write my entire phd thesis for $2"

should i code my own graph or use external library like networkx?

Attached: 80AA9CA9-2227-4AC5-8C21-3427AF7503BC.jpg (1024x1024, 128K)

shut up you cargo cult faggot

anti cargo culting is a form of cargo culting

>nooooo what if I want to write functions that have same signature as STL stuff for some reason or what if I want to use variables startibg with three underscores?!

How do I wait until an async function finishes inside a code block and then run the rest of the code, inside a synchronous function? i.e. how to turn a bullshit async function into a synchronous one that makes sense

Who are you quoting?

await

...

can't work if not inside an async function
>

C doesn't have async functions, fucking retard.

Is there a point in the year of our lord 2019 of creating a GUI application that is native instead of just a webpage?

Attached: 1543570837891.jpg (749x710, 62K)

Drag and drop that works

I am a retarded beginner, whats the point of async/await, doesnt code run line after line waiting for the statement of the line before to finish?

Attached: 1553445605590.jpg (1024x762, 144K)

...

async code doesn't that's why it's async
dumb frogposter

Fuck off dumb frogposter

>C
nobody said anything about C, faggot

if its a video game sure

what code is async?

not really, no
making a web site is literally better than trying to access a device's internal library to make a GUI

Every async function is a new thread that runs in the background while continuing to run the rest of the code after it

I was given the freedom to assume C, fucking retard.
If you didn't want that then maybe you should've fucking specified what shit fucking language you're using.
Commit suicide.

All thanks to the C garbage it inherited.
Thanks Cniles, fucking boomer niggers!

here is a js example
alligator.io/js/async-functions/
what language do you use?