/dpt/ - Daily Programming Thread:

/dpt/ - Daily Programming Thread:
Previous thread: What are you working on, Jow Forums?

Attached: rg.jpg (2000x1500, 794K)

Other urls found in this thread:

underhanded-c.org/
puzzling.stackexchange.com/questions/62953/highest-point-in-the-minesweeper
twitter.com/NSFWRedditGif

first

Attached: 1522372503692.jpg (1066x987, 99K)

Attached: 1522372629528.jpg (1143x680, 166K)

fuck opengl

Bump limit is 310. You're WAY too early.
Delete this thread and repost it later.

>Bump limit is 310. You're WAY too early.
>Delete this thread and repost it later.
No. This is the official thread.

Neat

thank you for using an anime image

Attached: haskell monad.png (300x225, 13K)

>plebduino

Java MAJOR version (Java 9 -> 10):
>type inference (aka 'var' lol)
>few GC enhancements (parallel GC and some hotspot fixes)
>shorter startup for REPL introduced in Java 9! finally LOL

.NET Core MINOR version update (.net core 2.0 -> 2.1):
>[CLI] Build-time performance improvements.
>[CLI] Global tools; replaces .NET CLI Tools (DotNetCliToolReference).
>[CoreCLR] Minor-version roll-forward.
>[CoreCLR] No-copy array slicing with Span.
>[CoreFX] HttpClient performance improvements.
>[CoreFX] Windows Compatibility Pack.
>[ASP.NET] SignalR is available for .NET Core.
>[ASP.NET] HTTPS is on by default for ASP.NET.
>[EF] Basic lazy loading support.
>[EF] Support for Azure Cosmos DB.
Span alone is worth a 'major' Java version update. KEK

when will C# get HKTs, RankNTypes and GADTs

>microshilling
>on my /dpt/

Hey /dpt/! I'm Steve Klabnik. Your friendly neighborhood Rust shill. AMA!

Attached: steve klabnik.jpg (1400x933, 384K)

>What are you working on, Jow Forums?
Added some commands to help with testing and to add some functionality. Now I should have a nice set of utilities to focus on shaders mostly now.

Attached: scrot.png (1920x1080, 141K)

I'm working on a super optimized FizzBuzz

>C MAJOR version update
vlas
stdint.h
restrict

>C++ MINOR version update
constexpr
return type inference
decltype(auto)
Variable templates
auto lambdas
user defined literals

C BTFO

>what is Haskell
constexprs are god sent.

>what is Haskell
better than C#

>C MAJOR version update
>not a whole lot; it already serves its intended purpose well enough

>C++ MINOR version update
>patch a bunch of design flaws
>introduce more design flaws to patch next time
>generate Stockholm-syndrome-induced excitement in inferior plusmonkeys

How can C ever recover?

OP kill yourself

Fuck off javalet. Most professional C# devs come from Haskell and Delphi background.

That's the joke.

>professional POO

What the fuck is that mouse grip?

>My POO is better than yours

Attached: 1483119195942.png (680x490, 266K)

haskell isn't POO

The fastest FizzBuzz in 100% safe Rust. Your turn C/C++ faggots.
use std::cmp::min;

#[derive(Debug)]
enum FizzBuzz {
FizzBuzz,
Fizz,
Buzz,
Number(usize),
}

fn main() {
fizzbuzz(|f| println!("{:?}", f), 1, 100);
}

fn fizzbuzz(f: F, mut start: usize, end: usize) {
const FNS: [fn(usize) -> FizzBuzz; 15] = [
fizzbuzz, number, number, fizz, number, buzz, fizz, number, number, fizz, buzz, number,
fizz, number, number,
];

fn fizzbuzz(n: usize) -> FizzBuzz {
debug_assert!(n % 3 == 0 && n % 5 == 0);
FizzBuzz::FizzBuzz
}

fn fizz(n: usize) -> FizzBuzz {
debug_assert!(n % 3 == 0 && n % 5 != 0);
FizzBuzz::Fizz
}

fn buzz(n: usize) -> FizzBuzz {
debug_assert!(n % 3 != 0 && n % 5 == 0);
FizzBuzz::Buzz
}

fn number(n: usize) -> FizzBuzz {
debug_assert!(n % 3 != 0 && n % 5 != 0);
FizzBuzz::Number(n)
}

if start >= end {
return;
}

let rem = start % 15;
if rem != 0 {
for i in rem..rem + min(15 - rem, end - start) {
f(FNS[i](start - rem + i));
}

start += 15 - rem;
}

while (end - start) >= 15 {
f(fizzbuzz(start));
f(number(start + 1));
f(number(start + 2));
f(fizz(start + 3));
f(number(start + 4));
f(buzz(start + 5));
f(fizz(start + 6));
f(number(start + 7));
f(number(start + 8));
f(fizz(start + 9));
f(buzz(start + 10));
f(number(start + 11));
f(fizz(start + 12));
f(number(start + 13));
f(number(start + 14));

start += 15;
}

for i in 0..end - start {
f(FNS[i](start + i));
}
}

Reminder that FP is just dumbed-down OOP.

>can't defend his general purpose shitlang
>hides behind the best FPL

Haskell is not a shitlang

*Crashes your program during run-time*

Attached: 6dfd4c031fd493c0dbe05e765a1196d8.jpg (236x221, 10K)

Hi /b/ros, what language should i learn to help my fat ass get my ex-model ex-wife back into my life along with my three kids whom I never see anymore since they walked out 4 years ago without saying a word?

I was thinking opengl

>opengl is a langauge
Learn esperanto

Why do only cherry boys use rust?

English

Because the real men have to debug C/C++ code.

>FP programs don't crash at runtime
This is what type fizzbuzzers actually believe...

Attached: d04.png (478x523, 14K)

Is MFC bad?

Attached: 49123049324123.gif (304x256, 1.82M)

No. 65316305
>>FP programs don't crash at runtime
They really don't.

Challenge: write a snippet of code, or explain a concept that would sabotage a program. Keep in mind that version control can roll back a simple infinite loop you tossed in and left.

underhanded-c.org/

*divides by zero*
*tries to access an out of bounds array index*
*any common io error*

*dereferences NULL pointer*
*frees statically allocated pointer*
*eats ass*

$65316366
Oh neat, you're the "C has dependent types" autist that was shitposting again yesterday.

I barely ever visit /dpt/
I only opened the thread to post Thanks for the (You).

Attached: file.png (623x100, 4K)

>he's not an ass MAN
wow GAY!

C# is hacky shit that has too much feature bloat. it's sepples without the performance benefits

Daily reminder to ignore faggots who can't even use the quote and post reference feature on Jow Forums.
They really should kill themselves.

體65316449
Ok

&65316449
but why?

Thoughts?

Attached: jsgod.jpg (1501x762, 104K)

MATLAB today for some computational photography. Every time I go back to it I'm reminder that the developers' sole goal was to make the world's slowest compiler.

Don't insult Christianity

Attached: baka.png (406x612, 139K)

puzzling.stackexchange.com/questions/62953/highest-point-in-the-minesweeper
>you dont need any computer algorithm to find the optimal, but be my guest anyway.
reeeeeeeee can someone explain how to logically deduct the solution. i want to know but i don't want to put effort into this useless shit

what does this code even do?
while (x --\
\
\
\
> 0)
printf("%d ", x);

The run-to and long-arrow is not so confusing, but what does this slide down do and how it works?
why the precompiler didn't remove the whitespace and generate this invalid code?
while(x--\\\\>0)

The \ escapes a line break. It's mainly useful when writing preprocessor macros.

>I-It is black magic!
>t-too many features
Ahahha! Coming up in Java 11:
>unsigned types
You should hope for properties in Java 9001

Attached: smug at (You).jpg (600x600, 55K)

Keep your sepples bloat to yourself.

Wrote a thread downloader in C.
It's slower than shell scripts.

Is it the job of the backend or frontend to do searching/filtering?
Let's say I have a java/spring backend with an endpoint that returns a full list of employees, something like /api/employees. Should I add additional paths so the user can specify a filter, like /api/employees/{employeeId} and filter it in the backend before sending the response? Or should I use search queries like /api/employees?employeeId=1234? Or should I just return the whole list and let the front end filter it? All are doable but I don't know what's the best

>his pure object oriented lang allows const params which does nothing but confuse the caller

a slightly incorrect math function /approximation. ain't nobody checking it for correctness

std::kek().unwrap()

That is IT. I am fucking DONE.

I declare FATWA on all C++ template metaprogramming abusers. Death will come to you and your families. You are not safe, and you will not be safe until you stop using these badly preprocessor emulated lisp macros. I declare holy war on you, and urge my brothers using sane languages to join me. Kill all C++ infidels.

Set Denmark ablaze. Make Bjarne Stroustrup pay for what he has done. FATWA NOW.

I'll set your mom's pussy ablaze

Gas the compiler fatwa now

Attached: 1520807254507.jpg (557x800, 193K)

You will be made into an example. I will hang you by your typename, infidel.

It's actually std::kek::().unwrap()

By Allah, shut your mouth. Otherwise I'll give you the test of my shoes.

Wbdev comes to reinvent the wheel once again.

If the whole list is massive and the user wants only a tiny portion of it there is a lot of wasteage.

Rust version next. Then we'll see who's laughing.

kek okay

Attached: Screen Shot 2018-03-30 at 10.01.26 AM.png (950x1568, 272K)

???
This is Rust

>::
My archnemesis

Rust version of my shitty code.

Attached: 1514981199329.jpg (1200x787, 69K)

Which code?

I will support you in your Holy War against C++.

The language wars may be over, but the religious conflicts in /dpt/ are not.
The C++ heretics, claiming to be concerned about their right to practice
their faith under the rule of Bjarne Stroustrup, have started to prepare for
what might very well be open revolt. Although they have not gone that far
yet, they have gathered in the city of Copenhagen and started to fortify its
defensive structures. Their exact intentions are not clear, but the more
rebellious among them claim that they will create an independent language,
breaking free from the rule of C.


>[PREPARE FOR WAR] If this continues, we may just turn out to be as ruthless as they claim us to be.

Sepples started as a great idea.
If only it moved on from being compatible with C..

C++ was an awful idea and trying to remain somewhat source-compatible with C is a large part of the reason why.

>religious conflicts
/dpt/ is and always has been a Christian thread on a Christian imageboard

Attached: 1511703982417.png (1000x1000, 345K)

>Sepples started as a great idea.
Sepples started out literally as just C+POO.

business idea: Algol `20

It is God's will that we use D to drive out the C++ infidels.

>Christian imageboard
I hope you don't ironically believe this

Get out, fedora cuck

Attached: Fedora.png (1067x800, 730K)

Not your safe space, jesus cuck.

>s-safe space
Imagine holding nothing sacred. What sort of subhuman would do such a thing? Only a lowly worm. This website is for humans, not for scum.

kys pedo

>This site is for degenerates
FTFY

>What sort of subhuman would do such a thing?
One that rely on space daddy to magically solve his life problems.

>/dpt/: when Jow Forums subhumans meet Jow Forumsrust subhumans
This thread really needs to be purged.

>t. imbecile

try!(std::no::()).unwrap()

>space daddy magic flat earth 6000year
Atheists are fucking retarded.

Attached: 1508088115338.png (876x649, 315K)

>muh feels
christ cucks are SJWs with a different mental delusion

>HORSHOE THEORY YOU DA REEL SJWUHS
Imagine being a fucking atheist. Pathetic.

Attached: the stepchild.png (223x440, 131K)