/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1568944567253.jpg (1080x1199, 222K)

What's the fastest way to read a file? Like the FASTEST way?
The file isn't in the ramdisk

mmap the file.

kill yourself anime degenerate

What's the best language (Besides perhaps C) To write a compression algorithm? I know we can achieve smaller compression rates without loss or artifacts.

>you type exactly like a schizophrenic person

Touchtyping is a sign of schizophrenia now?

It is so interesting, the fever dreams of low IQ white "men".

_

Lisp is the most powerful programming language.

Any language that allows for bit manipulation. Preferably mutable too unless you're insane.

the language is irrelevant

>What's the best language (Besides perhaps C) To write a compression algorithm? I know we can achieve smaller compression rates without loss or artifacts.

QuakeC.

You can write a compression algorithm in any turning complete language, idiot.

The answer to your question, however, is assembly.

god i wish that were me

the best language besides C is one that's just as easily used as a library as C, which (due to GC popularity) is not many.
Zig is aiming to fill this category well but it doesn't even have documentation yet. Stick with C.

Marvelous anime image, chap.

Attached: 1568826545367.jpg (1920x1080, 211K)

Does Shamiko know what sex is?

Zig will never fill any category.

>the language is irrelevant
Stupid anti-child bride white fucks don't know that.
All they know is "how to get job, get pittanance from bossman, waste life for bossman, pay for white whore, get tattoos, get tattoos for white whore, kill chomos"

Rust

where are the fucking mods?

With std::priority_queue both the pop and insert are logarithmic. Is there anyway to do a pop+insert to avoid fixing the heap twice?

>What are you working on, Jow Forums?

This:
www
moddb.com/games/chaosesqueanthology


>Stallman did nothing wrong, he's just clueless. Leave him alone. But you're just a shitposter, so it doesn't matter.

Stallman did nothing wrong. He is right about paedophillia, as are the old religions. White men are enemies and are wrong.

Stallman probably likes cute young girls, white men do not. White men are _NOT_ human beings: they are constructively golems of white women: they choose to give over their agency to "MUH WHOITE WUUHMAN" (themselves rejecting their own humanity: their choice)

Attached: xontemp20160405153509-00.jpg (1600x900, 486K)

Mods allowed satania to remain in the sticky alongside actual, real heros. Jow Forums's moderation is dead.

i don't like Jow Forums, but how have you avoided them?

Satania is the only hero in the Jow Forums sticky

why would anyone learn C in 2019? Is it even enjoyable?

Zig is the first actual c-like language that could actually replace C, for C programmers.
Every other C-killer eventually drifts too far from C and then competes with C++ and other langs.
It still has a long way to go yet though.

To be fair satania is pretty based.

what's your experience been with using Rust libraries from another language?

>Zig is the first actual c-like language that could actually replace C
just needs to get over the "more compilers than users" bump and it'll be smooth sailing

>Zig is the first actual c-like language that could actually replace C, for C programmers.
Jesus christ the delusion from this Zig-shill

Just stick with C, it'll give you the best performance as long as you know what the fuck you're doing.

>the language is irrelevant

Ah yes, I can't wait for you to unveil your compression algorithm in Ruby or Dart. Masterful

Attached: 1507679402661.png (499x338, 38K)

Because its still the best language for the job it does, it's still the fastest general purpose language, and large amounts of C code already exist.

everyone knows C and C knowledge is assumed by the tutorials of every other language. It's also very popular in Unix, to the point that if you're not using C, you probably need to drop down to C to use all of the *actual* features of whatever part of Unix you're working with.
C is not a pleasant language, but manpages are better documentation than nearly any other language has.

const std = @import("std");

pub fn main() !void {
// If this program is run without stdout attached, exit with an error.
const stdout_file = try std.io.getStdOut();
// If this program encounters pipe failure when printing to stdout, exit
// with an error.
try stdout_file.write("Hello, world!\n");
}

This is horrific.

oddly enough, i don't even use Zig, but its appeal is pretty obvious.
yeah probably won't happen.
can't argue with you. I don't like the language myself.

Attached: 8nRqoXW.jpg.png (800x729, 48K)

it's one line and one keyword of boilerplate over C, with better functionality.

if I mostly program in C# and Javascript, and will probably be doing mostly web development stuff in the future, is it worth learning C? Will it make me a better C# programmer?

>pub fn
is "public function" really so fucking hard?

You can expose a C API from Rust AFAIK. Calling conventions are the same. You will just have to write a C header file and keep it up to date.

FULL MAST

>Will it make me a better C# programmer?
no

pub and fn are all the new hype in new fad languages.

chemo yourself cancerfag

t. java "programmer"

>he thinks you have to label functions as "functions" in java
Sorry but that verbosity came from pascal and other old languages.

Can you guys stop starting /dpt/ threads with anime pictures? It makes it hard to browse Jow Forums at a cafe when, at any moment, someone can look over my shoulder and think I'm a full on weeaboo.

Do I stand to gain anything?

>t. C-let

Stupid cunt can't understand the grace and beauty in Java, fucking kek. It's literally THE programming language of our age on par with Fortran and COBOL

no

inb4 hurr durr anime website muh anime safespace

Imagine thinking typing function instead of fn is "verbose"

Then stop browsing an Anime Image Board?

Attached: 1541487027149.gif (540x320, 1.14M)

Then why the fuck are you posting on some weaboo website, then?
If you weren't a dumb fuck, you'd disable all thumbnails for this place.

why do people go to a cafe to use their computers?

just use fun, it's more fun that way

Lol you caught it so quick. See:

Give me something I can program in like a few hours.

>What is 2 + 2
>inb4 4
>4
>HURR GOT U XDDD

Attached: 1377737033755.jpg (505x1212, 136K)

>Replying to yourself

Attached: disgust.png (937x534, 252K)

Because if I don't, then I play wow, nap, jack off, or fuck off and don't do shit.

Just block images.

Attached: 1568870409813.gif (640x640, 84K)

Imagine living with this little self control
What's the point, end it all

IRC bot

>mentally ill animetard who still deludes himself into thinking this is an anime website also deludes himself into thinking everyone that hates him is one person
typical

In leftpad what is the purpose of the second part of this if statement?
function leftpad (str, len, ch){
if (!ch && ch !==0) ch = ' ';
I don't know what its checking for since it returns true for every value I've tried

>still deludes himself into thinking this is an anime website
Take a good hard look at the different boards on this website

>function
shit lang

maybe it's the character to pad the string with?

>people actually browse Jow Forums non-text clients
??? Why would you ever browse Jow Forums on a GUI? Do you like seeing shitty wojak memes all over Jow Forums?

Ah, good point.
On that topic, would you prefer people around you to think you're a nazi for looking at frog pictures?

I meant the ch !==0 part

Why would you ever browse Jow Forums in public is the question I'm asking

(cast 'spell)

Attached: __nagato_yuki_suzumiya_haruhi_no_yuuutsu_drawn_by_asahana_jun__78d53647304dc68f3e272dde2e0a3111.jpg (424x600, 77K)

>every value I've tried
> ch = ' '; !ch && ch !== 0
false
> ch = '\0'; !ch && ch !== 0
false
> ch = 0; !ch && ch !== 0
false
> ch = false; !ch && ch !== 0
true
> ch = ''; !ch && ch !== 0
true
no idea. it's JS.

Well then I can't see other people's work or anything else. Half the fun is removed. It's a work around though.

Everyone has their vices, mine is my room. Environment matters a lot.

>would you prefer people around you to think you're a nazi for looking at frog pictures?
I actually know people in real life who have asked me why I use nazi symbolism when they saw frog pics.

what other symbols does CAST take?

You're weak willed
I sit in my room all day and jerk off when I want and program when I want
sometimes I do it at the same time
You need to build some character

I usually do that. Usually they are too.

give them a look of pity and suggest they stop watching so much news
as with tap water or city air, it's best not consuming it except after it's been filtered a few times.

/b/ random
Jow Forums guns
/out/ outside
/v/ videogames
/vg/ videogame generals
/tg/ text based games
/ck/ cooking
Jow Forums fitness and health
/sci/ science
/mu/ music
/x/ underage retards
/vr/ retro videogames
/lbgt/ safe spaace
Jow Forums business and finance
/fa/ fashion
/lit/ books
Jow Forums international random
Jow Forums politically incorrect
...

>/x/ underage retards
That describes a good number of the boards.

Do you also code in Haskell?

No I'm not gay

Look at all this exciting discussion about programming!

Attached: anime site.png (779x267, 82K)

Learn Lisp.

redpill me on binary trees vs hash tables

why bother with tree traversal autism when pointer indirection thrashes your cache, when you could use the chad array-backed hash table?

They need to ban all of these stupid redditors from here with their off-topic anti-anime garbage.

Jow Forums loves anime.

Attached: operator-chan.png (680x768, 432K)

Do people actual browse Jow Forums with ads on?

common wisdom suggests always using a hash table but for smaller sets and and keys which take a long time to hash (strings) binary trees are actually faster
and the part about pointer indirection is bullshit too because hash table traversal is never linear anyway and your tree nodes are likely to be close in memory if you use proper allocators

Array vs indirection argument doesn't really apply here because you aren't accessing the hash table entries sequentially. You are accessing them randomly.

stop stealing money.

>ads
Anonymous or not, you should be ashamed of your stupidity, newfag.

Please look up the definition of an advertisement before posting again, thanks!

kys hiro. Anyone that doesn't hide the header and footer ads is useful idiot. Probably also paid $20 for a pass.

I'm too busy to write any code today and tomorrow

I paid for a pass so I don't have to solve captchas for the google jew

>giving the most evil corporation in the world assistance with their AI
>not giving Hiro a mere $20 a year
at least you'll have something to say in your defense when your right to continue living is judged before a Google life extension jury.