/dpt/ - Daily Programming Thread:
Previous thread: What are you working on, Jow Forums?
/dpt/ - Daily Programming Thread:
Other urls found in this thread:
underhanded-c.org
puzzling.stackexchange.com
twitter.com
first
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
>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!
>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.
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
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*
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...
Is MFC bad?
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.
*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).
>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?
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
puzzling.stackexchange.com
>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
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
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
???
This is Rust
>::
My archnemesis
Rust version of my shitty code.
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
>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
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.
>muh feels
christ cucks are SJWs with a different mental delusion
>HORSHOE THEORY YOU DA REEL SJWUHS
Imagine being a fucking atheist. Pathetic.