/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: dpt.png (1000x793, 717K)

Other urls found in this thread:

github.com/adomokos/haskell-katas
twitter.com/bodil/status/1108775012457164800
vimuser.org/surgery/
developers.google.com/youtube/v3/docs/
twitter.com/NSFWRedditImage

Brainlet thread.

Any guide to website botting?
E.g. manipulating forms.
Preferably with perl.

github.com/adomokos/haskell-katas
UX is a bit clunky, as you're solving tests

Threed64ProgressBar

Attached: threed64progressbar.gif (366x90, 19K)

for(int i=(to_string(sum)).length()-1; i>=0; --i) {
int k = sum/(pow(10,i));
cout

>working on a project
>spend 10% of the time writing the code that solves the problem
>spend 90% of time obsessing over how to nicely structure the code and name things
Is this how autism feels like? How do I overcome this?

JavaScript rocks!

Attached: js-rocks.png (1000x494, 368K)

Watch handmade hero and his explanation of compression based programming. Maybe it will help you.

You make everything shitty in one or 2 projects.
Then you have tp rewrite everything.
Then you write everything clean and with nice names and stop cpmplaoning about programming being tedious

>convert the number to string just to get the length to extract the digits when you could have just looped over that string you threw away

clang-tidy is there exactly for this purpose
use the tools given to you retardo

Attached: the_c_programming_language.jpg (664x3432, 422K)

Now this is what I call RENT FREE

Attached: Screenshot_2019-03-01 g - 1 33 0 is out - Technology - 4chan.png (1066x809, 282K)

Is there a YouTube API that allows downloading a video?
Any language works.

progress bar slices *sips*

Attached: threed64progressbarslices.png (367x92, 929)

brb learning an entire language so I can get it into my stupid estrogen filled head that promises only resolve once
twitter.com/bodil/status/1108775012457164800

brb learning a dead and obsolete language so I can pretend to be a female by cutting my balls off
vimuser.org/surgery/

>not being java is somehow a bad thing
>thinking FP matters in cases where C is an appropriate language choice anyway
Rust is such a convoluted pile of webshit nonsense that it makes sepples seem decent in comparison.

>if text.parse().contains("OOP") {
assert(language == Java);
assert(OOP == BAD);
assert(FREE_FUNCTION == GOOD);
}

Attached: 1537975511081.png (211x239, 5K)

C tranny BTFO

Everything C can do C++ can do better

Attached: 1539544882684.gif (378x386, 132K)

>assert(language == Java);
No, but only Javatards think every language needs to be OOP.

oh yes

Attached: threed64progressmotion.gif (471x147, 20K)

?????
>baby's first GUI

Pardon me? These are new widgets.

im pretty sure hes implementing ui elements himself

needs moar progress bars

Attached: progressquest.png (595x386, 5K)

Why linux GUIs are so soulless?

If your language doesn't provide OOP provide proper polymorphism, traits, HKT or typeclasses
C has none. That's why C and Gotards don't understand DRY.

Attached: 1537771566378.png (1200x1400, 502K)

>These are new widgets.
wow epic

At work, I'm responsible for a 30+ year old Motif program, hundreds of thousands of lines.

It's demoralizing.

I write tests for network switch C API. I need to learn Perl soon, because the testing environment uses it heavily, about 50% of a test is written in Perl.

Attached: Perl-2.gif (643x326, 44K)

Convert me to Haskell

you.to!Haskal();

They aren't from mother Russia.

Attached: 1536050092522.gif (500x209, 1.94M)

friendly reminder there is not one non-autistic person who uses pointers or don't use garbage collections in this day and age.

Unit testing god awful OOP architected code. I spent more fucking time trying to get the god damn method to compile.

Are you retard?
The point is that these silly errors can be caught at compile time, which is great when you're implementing something you know too much about.

youtube-dl?

based

What makes pointers so confusing for brainlets? It’s literally just number, an index to the huge array that is memory.

This thing is a tranny, right?

Attached: bodil.png (314x318, 118K)

developers.google.com/youtube/v3/docs/

absolutely terrible pointer syntax in C helps

Reasonable ABI.
Libraries that can be used by any language.

>reference: &mything;
>dereference: *mypointer;

I fail to see the issue here

If I have a five byte structure (bit field) of eight five bit bytes (unsigned chars) that encode numbers 0-31, what sort of application/ project/ program would be suited to using this structure for memory saving, given that when, say, characters are cast from these five bit representations and stored onto disk they are converted back into 8 bit unsigned chars?

because it's hard to imagine the purpose completely useless concepts.

What anout the people who bring your meme language to the metal?
(I know you are baiting btw)

>placate the nymphs

But user, variable names are pointers to the value's location.

what?

Attached: 1530456105927.png (211x239, 6K)

* is used to declare a pointer, to deference a pointer, and for multiplication
& is used to declare a reference (reference as in a reference type, which isn't a pointer) and get the address of variable for pointers, and for bitwise and
yeah sounds simple enough

>what are spaces

yeah changing the behaviour of an operator by how it's spaced isn't confusing at all

yeah, it isnt

Whitespaces don't have any affect on shenanigans involving C's * operator?

Literally just keep track of what you assigned as an int, and what you assigned as an int pointer.

AKA don't be stupid.

Found his blog posts about compression based programming. Really enjoying them so far. Thanks user.

>& is used to declare a reference (reference as in a reference type, which isn't a pointer)
C++ is not C

Or you could not reuse operators for completely different common tasks

Suggest better alternatives

You've discovered the actual hard part of programming, software architecture, the things you need to worry about when you're a good enough programmer than the "how" isn't a challenge anymore

hows your game going

Attached: 1553213223525.webm (1280x720, 2.55M)

I wouldn't have a clue, you don't need to be so defensive about it

based.
at what level are you?

you need to provide the type of pointer you declare so dereferencing with * isn't confusing unless you somehow forget you're working in a statically typed language. Which, given that you're a moaning little brat, you probably do all the time.

Tidying up a 350 line function that generates navigation grids, running out of sane things to name variables

Which engine?

>I don't know how syntax works
Spacing has nothing to do with anything. Whitespace is literally only used to separate tokens in C.
If * appears in the position as a binary operator, it's multiplication, if it's in the position of a unary operator, it's a pointer dereference.

So things like *a * *b works perfectly well, and still would work if I wrote it like *a**b

what lang

I only use statically typed languages
why are C programmers so butthurt?

Plenty of languages have "+" mean 3 or 4 completley different things, so I don't really see anything unusual about that.

blitzmax

unless you've overloaded the operator, no they don't

>I only use statically typed languages
lol dumb haskelet

wrong again

>addition
>string concatenation

Just to name the more common ones.

dumb javajheet

Pretty much all languages have at least two:
integer addition
floating point addition
(and yes, they are very different, one of them may not be commutative for example)
Then there are several langs which use it for concatenation (strings, arrays, lists).
And then some with very weird cases like adding an event callback to a list.

comparing integer/float addition to multiplication or pointer dereference is hardly a fair comparsion

This isn't really the problem considering the grammar rules involved.
If anything, I'd say one of the biggest follies of C is that syntax parsing grammar isn't considered important enough to be parts of basic tutorials. Understanding the difference between lvalues and rvalues and their context on operators makes a huge difference in understanding and retain-ability. Clear and Concise documentation that lists and describes every different situation an operator can be in, how it functions in that situation, and why this situation is different from others should exist for every operator.

keep trying, you'll get there someday

Floating point shouldn't be a part of C like it is today, the syntax should be mulf(f1, f2) like for sqrt and pow and everything else

dumb virgin

You're looking at it from the perspective of someone who's already used to it
Anyone can get used to any form of shitty syntax so long as it's distinct, that doesn't make it any less obtuse for someone who isn't familiar with the language or programming in general

Okay I'm joining the action and adding a progress bar widget to Serenity. :)

Attached: progress.webm (400x240, 70K)

Complete with random jumping all over the place. Noice

you need to make the bar go backwards at least once

Woah, gradients? No fair.

nice

Attached: threed64progressgradient.png (191x91, 1K)

There you go, gradients everywhere!
That font is gorgeous too, just needs a little help with the kerning

>That font is gorgeous too, just needs a little help with the kerning

It does, but it reflects so much the aesthetic that I'm trying to capture that I don't think I want to fix it.

Attached: 693498-microsoft-windows-3-1-included-games-windows-3-x-screenshot.png (593x429, 14K)

literally hitler

can i make a game with haskell

Fuck. I remember those card backs

I don't think that's the angle I'm coming from. I've had to work primarily with Python for the past year, after all.
Languages are inherently obtuse until you become familiar with them. Syntax is just as important as semantics.
It's my opinion that it's much worse for an operator to be misperceived as having inconsistent usage (syntax) than it is to be misperceived as having inconsistent usage (semantic). If there were enough different symbols on a standard keyboard to have a different operator for all of the different use-cases, then it might be another story.