/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: EO.jpg (1200x500, 137K)

Other urls found in this thread:

theregister.co.uk/2017/03/29/drupal_dev_banished/
github.com/opal/opal/issues/941
twitter.com/SFWRedditImages

Imagine being this childish, narcissistic and antisocial.

Why can't I post when using tags wtf

second for Programming as a subset of Anime

Imagined. Feels good.
I'll continue to imagine that.

>imagine having your feefees hurt so badly on the internet that you actually move your perpetual outrage to a new thread just to let everybody know about it

if (a == b)
{ doSomething();
doShit(); } else if (a != b)
{ doThat();
finishShit(); } else
throw new RuntimeException("Error happened"); }

What error messages do you get?

I'm always happy when stuff like this is at the top of the thread. Makes recursive hiding so effective and efficient. Only one click to not have to see off-topic retarded shitposting, priceless.

What book is this? I'd like to know more about this radical declarative approach.

boolean operator==(&int a, &int b) {
a=b;
return true;
}

I want to make a check in C that evaluates to true if a pointer is NULL or a member of the struct it points to is false
I thought something like
>if (p == NULL ? true : p->member == false)
would work and would avoid dereferencing if p is NULL but it segfaults occasionally

Expanding this with proper if elses works, am I using the ternary operator incorrectly here?

what's the best data-structure for looking up all elements that match a given prefix?
filter (foo `isPrefixOf`) list

I'm thinking of doing a radix-tree with path compression, but collecting all the children at a given point into a list doesn't sound optimal

I'm guessing it's Elegant Objects by Yegor.

This usage of the ternary operator should be fine, if a bit roundabout -- it would be shorter to write
>if (p == NULL || p->member == false)
or even
>if (!p || !p->member)
but your existing code should not cause segfaults.

Look into tries

>imagine not being able to contribute to any major open source software projects because your coding abilities are dogshit and as a result your PR got rejected and you reacted by freaking out and calling everyone a nigger because you're too emotionally immature to handle constructive criticism like an adult, all while knowing all too well that that term has extremely racist connotations, and then acting dumbfounded at being banned from sending new PRs and getting earmarked around the community "just for saying a harmless word lol", and then going on an unholy crusade against universally accepted codes of conduct on an online Sichuan noodle making imageboard

Attached: laughing_sluts_eating_watermelon.jpg (2121x1414, 1.38M)

i'm actually retarded, I was too focused on the code in Game I didn't realize that the object calling update() was using an uninitialized Game* pointer. But how could other functions work if I hadn't even created the object ..

theregister.co.uk/2017/03/29/drupal_dev_banished/
>man removed from project because being into BDSM is "inconsistent" with "the project's goals"
>zero allegations of actual wrongdoing

github.com/opal/opal/issues/941
>maintainer and contributor says nothing inappropriate on the projects github
>never called the maintainer a nigger for rejecting his PR
>says something controversial on Twitter
>author of the Linux code of conduct shows up to demand he be removed in case any hypothetical transgender contributors feel uncomfortable with the fact he is a contributor

Don't worry friends. Everything is fine. Ignore all complaints. They are just shitposting trolls.

Attached: 1507359348752.png (599x898, 393K)

I might be a brainlet, but how is declarative more optimal?
Just because you only say SELECT whatever, doesn't mean the program in the background doesn't have to do sorting, filtering, copying etc

It's the compiler's job to optimize and catch mistakes.
Wasting a coders time on that is stupid.

>the try-hard who's against codes of conduct also is an animuposter
Like pottery.

You snowflake needs to be sent to a fee-fee hurt camp in Alaska, to learn some unthinking

if(!p || p->member)

is dereferencing a possible null pointer, no?

OH BOY IS SOLVING 23789428947892748923 CAPCHAS FUN! THANKS JEWGLE!

And if you disagree, code in Assembly

codes of conduct only exist because programmers are embarassingly autistic in the first place

Anime website. Better get off of here before people start think you're associated with it.

>cherrypick a couple of unusual and extreme cases
>think that invalidates codes of conduct as a whole
>throw the baby out along with the bathwater
Abusus non tollit usum, you fucking retard.

>toxic
>incel
>animes fan

yikes

It's a bunch of hooey
In fact, it's classic OOP dogma
>OOP isn't working for you? No, you're doing it wrong. Here are a dozen more vague rules to follow.

Attached: paul-blart-nice-meme-57e5862a2c104.jpg (1802x1250, 118K)

|| - only solves righthandside if lefthandside is false
| - always solves both sides

No. The || operator is short-circuiting, which means that the right hand part never gets evaluated if the left hand part is true.

Oh, thanks. :3

>these examples demonstrate why people are worried about codes of conducts
>oh they're just unusual and extreme examples, despite the fact one of them involves one of the authors and main pushers of the most popular code of conduct

>you fucking retard.
You better make sure no one finds out you're comfortable using this ablelist language. We do not want to make any disabled contributors feel unwelcome. Please review the code of conduct.

If it only ever applies to unusual and extreme cases, it's not worth keeping as a policy.

*snuggles yous wumpus*

In theory, imperative programming imposes a strict order on statements. It's non-trivial for a compiler to reorder statements, or insert barriers for concurrency. Whereas with a declarative style (particularly with linear types), the flow of data is explicit. The compiler knows precisely what should happen before something else, and it can insert barriers optimally without too much effort.

>You better make sure no one finds out you're comfortable using this ablelist language. We do not want to make any disabled contributors feel unwelcome. Please review the code of conduct.
You're obviously too new to this whole "interacting with other people" thing, you've evidently spent most of your life alone in a damp basement and hence can't tell that there're proper times and places for everything, hence why you used "nigger" on Github and got banned and then think you're making any actual point here by pointing out how I called you a retard (which you actually are).

Attached: embarrassing_really.jpg (900x600, 430K)

I have never used "nigger" on Github. I have never been banned from Github or any project on Github. I don't know why you're so hung up on this.

I don't see how my point isn't valid. The code of conduct is there to ensure that contributors do not make people feel unwelcome. This is extended to their actions outside of the project. Using ableist language is an example of something that will make people feel unwelcome. Do you have any serious problem with that line of thinking, or are you just going to continue beating the "b-but you just want to say nigger!!!" horse to death?

>if we always need to bathe the baby and all this water gets dirty, then it's not worth keeping this baby as a child

>I don't know why you're so hung up on this.

Toxic behavior will not be tolerated anywhere.
Whine, complain, spam twitter or whatever, it doesn't matter.
The world is moving on and you are getting left behind.

>something that needs to be done daily
versus
>something that may or may not ever actually occur

Gotta have that policy in case somebody stubs their toe on a tuesday while passing under that old ash tree at the corner of Main and 3rd.

Could there be a way to transfer this to imperative programming?
Even if it triples compile time, if it gains a 20% speed boost people would do it

This site is the very definition of toxic and the very association with it will damage you in the eyes of the people you're defending. Please leave while you still can.

>Could there be a way to transfer this to imperative programming?
Of course, you just do it by hand yourself
the whole idea behind this stupid declarative, functional movement is that humans are too stupid to write their own programs so the compiler should be doing it all for them, which is just false

>why vaccinate the baby against such rare diseases that may or may not ever actually occur?

Especially if everybody else is already vaccinated. These are good questions you ask.

>Find project filled with coc
>Contribute
>Work so hard that most of the code is due to you
>Sneak in code that is hard for them to understand (considering the types of people involved, any advanced language feature should work)
>Start saying nigger publicly
>Watch them freak out
>get removed
>Pretend to be other people telling them they need to also remove the code you wrote due to inherent toxicity in the code
>They can't maintain it anymore
>Fork report and remove coc
>Everyone uses yours
Is there anything more fun as a long term project?

You could say that there is no ordering on statements except for syntactic dependencies and then get the programmer to add barriers, even outside of concurrency scenarios.

Do you write your programs in assembly?

I was vaccinated and I'm highly autistic
Just saying

You don't vaccinate for the rarest diseases wtf, you vaccinate for things where the risk is great enough to offset the cost

>I'm highly autistic
We already knew that.

you dont need to write programs in assembly to get the most out of concurrency

Attached: tetanus.png (597x220, 30K)

That's not the issue, it's that you're against the language and compiler making it easier, so in that case you should be using assembly, ideally machine code so that you can write opcodes and branch targets directly instead of having an assembler do it for you.

Thanks, turns out the problem wasn't that, I was using
>(x && y ? true : stuff)
assuming it'd work the same as
>(x && (y ? true : stuff))

>if people are vaccinated for an otherwise common disease it becomes uncommon
Whoa...

the issue with declarative programming is it only makes it easier in some cases, in some cases it makes it harder because you're not in control, the compiler is

It's a matter of specialization. Some focus on the internals of database systems, others use SQL to take advantage of the improvements made by the first group.
Declarative DSLs are the way to keep systems sane as hardware and infrastructure changes.

How do you reckon?

>The beliefs at issue involve participation in the BDSM and Gorean (NSFW) communities, the latter involving people interested in recreating the culture of male dominance and female sexual servitude depicted in John Norman's poorly regarded Gor sci-fi novels.
fucking based

And so your original point () falls flat. Thanks for playing.

I don't know how to explain it any further
declarative programs makes a whole lot of decisions for you
which can be fine, but other times it isn't, and the idea that you NEED delcarative programming to do concurrency (or anything) is blatantly wrong

>Even if it triples compile time, if it gains a 20% speed boost people would do it
not really, one of the main complaints I see from Java/C#/Poo devs on C++ are the long compile times.

I'm not that user. And I agree with you.

Like what decisions? I didn't say you needed it, I said it was better for that specific reason involving compilation to an out of order CPU.

the issue with programming languages is it only makes it easier in some cases, in some cases it makes it harder because you're not in control, the compiler or assembler is

This. I really like rust in theory, but cannot deal with the slow compile times, and the fact that incremental compilation is a joke.

>declarative programs makes a whole lot of decisions for you
and imperative programs don't?

like how to order your program execution or where to insert barriers or whatever
a person can do that by hand, and it isn't neccessarily difficult to do so

why don't you add this sort of thing to codes of conduct then

it's relative, obviously

How convenient

what does that even mean

seems like a waste of your time

Attached: 1549309864687.gif (360x263, 37K)

the rarer, the slower it'll mutate, the longer it will stay rare

If it's not difficult then surely a compiler can do it just fine, leaving the programmer to worry about more important things.

some people just love to suck cock, don't give it much more thought user

>If it's not difficult then surely a compiler can do it just fine
that's not how programming works
compiles aren't magical dream machines that know what you want before you tell them

Which is why declarative programming is good, it tells the compiler exactly what you want.

>compiles aren't magical dream machines that know what you want before you tell them
guess what tells them exactly what you want

No, you tell the compiler the result you want and it decides on the implementation
Sometimes you want to tell it what implementation you want to
Infact most of the time you do if you're a halfway decent programmer

if you think feelings matter, fuck off and kill yourself
"society" and "social things" are fundamentally worthless and serve no real purpose to humanity as a species

after which waifu should I name my next project

Who says declarative programming lacks implementation details?

that's what declarative programming means, genius

Attached: 1528803217473.png (800x729, 59K)

I think you need to take a quick look at the dictionary, or wikipedia

it depends on the project obviously

Is Visual Studio comfy bros?
Is it hard to learn how to make web applications with asp.net and model view controller

Attached: 1545416224504.jpg (216x234, 8K)

>Is Visual Studio comfy bros?
Among all the IDEs it's probably the comfiest. It's not perfect tho.
>is it hard
not really, it mostly depends on where you come from and how much experience you already have

>Is Visual Studio comfy bros?
I think it's pretty comfy yeah.

it's bloated as fuck and 99% of it is useless
but fuck me that 1% is fucking USEFUL

Being able to insult people with any word I like is an essential part of software development.

software developers are people you fucking asshole they don't exist solely to develop software

i don't think i'm people

>software developers are people
And?

It is really comfy for JS/TS, C++ and C#. The startup time decreased noticeably in 2019 and now the only thing to hate is the installer.