/dpt/ - Daily Programming Thread

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

Attached: 1558632133383.jpg (1920x1034, 363K)

Other urls found in this thread:

youtube.com/watch?v=VSdnJDO-xdg
m.hitorino.moe/@yashi/media?max_id=101931494009761403
twitter.com/kagurazakayashi
github.com/kagurazakayashi
twitter.com/SFWRedditGifs

Attached: DISGUSTING.png (374x303, 156K)

I'm reading Java: A Beginner's Guide, 6th Edition and I'm currently on the IO chapter. It says that the ways to handle IO described within the chapter are only there for completeness' sake and that 'Real World Programs' handle IO in different ways.

In what kind of ways do 'Real World Programs' handle IO?

nice socks

good to know faggot

>In what kind of ways do 'Real World Programs' handle IO?
Using Monads :)))

What ways are they describing in the book?

What is wrong with people today

Can I stick it in his boipussy?

I have a major boner for Kizuna Ai, shame this is a guy. Also that's some horrible code.

> Monads
fuck off tranny

They use streams for console IO and file streams for file IO, and it briefly explains random access files, scanners and type wrappers

Quit your job
Make video games

Attached: a career in game development.jpg (610x537, 103K)

Don't tell me this is a man. Please.

Legs SHAVED
Buttplug IN
Programming socks ON
Yeah, it's time to program!

Also who's the cute Kizuna AI girl(male), OP?

Why am i such a brainlet lads? after almost a year of trying to learn to program i can barely do a simple hangman game. Is it time to kms?

I/O could mean file or console streams, but it could also mean named pipes and network streams, making calls to store things in a database or remote service, using one or more libraries to format your data (like to JSON or XML), or who knows what. It’s just showing you how to read and write simple text files, but how often does more complex software do that?

Okay.

that better be a boy

Reminder that OOP is a wageslave paradigm and they are designed to be used in a large corporate environment. It's the assembly line mode of shipping software
There is no reason to use OOP outside of your work

>Encapsulation
Programmers are only allowed to use the module produced by other programmers in the way that the company wants you to do, to provide stability by preventing one programmer compromise the whole software
>Inheritance
Programmers are required to reuse the existing code because it reduces the training cost for each programmer and makes them easily replaceable just like assembly line workers
>Polymorphism
Programmers are required to extend the meaning of the existing functions instead of creating their own. Again, it reduces the training cost for each programmer and makes them easily replaceable

Attached: w.png (960x720, 1018K)

>java
>in concatenate_these(changeThisToAString(20), changeThisToAString(19), separator = "No Separator")

Learn Lisp.

Don't feel bad for looking at and studying examples of what you're trying to do.
The important thing is you actually learn from and understand how to build it, and not just blindly copy it.

>It's the assembly line mode of shipping software
No, it's just plain bad. If it were assembly line this would indicate that it creates software that is easy to understand, which it doesn't.

hello im new and i made new trip i hope u like it.

any cpp programmers around? :-)

no need for OOP at work either
youtube.com/watch?v=VSdnJDO-xdg

Attached: studydefects.jpg (350x537, 25K)

>that skin, hands, nails
If that is a man he got lucky as fuck.

Who is this?
Is this a dude? If so does he have a twitter/xtube/xhamster/pornhub/kik or something???????

You can achieve the same skin, nails and hand if you actually care. Watch beauty youtubers to learn some tips

nope, just lisp and haskell shitposters

it is.

these are meme languages.

>tripfag and cpp programmer

Attached: bomb.gif (148x111, 264K)

I'm trying to better understand pointers in C++, I think I understand this well enough:
char const* s2 = "My Name";
char s1[80];
strcpy(s1, s2);
This works by having a buffer of 80 characters available and s1 is a pointer to that first character, right? And if I put a number too low in, like initially declare char s1[2], I rightly get an error when I try to run it.

However, if I have:
char const* s2 = "My Name";
char* s1 = new char;
strcpy(s1, s2);
This also works, but I don't exactly understand why. s1 isn't declared as an array so the appropriate amount of memory isn't reserved, so is this undefined behavior that just happens to give the expected output for this example? Or is this defined behavior and I'm just not understanding how pointers work in this scenario? Or yet still, is my compiler (VS2017) being smart and looking at compile time to allocate the array with the appropriate amount of space?

>is this undefined behavior that just happens to give the expected output for this example?
yes
try it with a longer s2

Hold on, this is a real grill.

who allowed her to program???

This is blatantly a real doll, good job outing yourselves as never being close to a woman (or girl(male)) virgins

A new thread means a new chance to show your excellent skills at JavaScript!

Attached: 6d29d415ce1ab3bb031bd3c6296d5114.jpg (740x1024, 114K)

I see, I got it to break, thank you.

(defun girl()
"This function returns a girl."
(interactive)
(funcall male))

>watermark in bottom left
kys OP

What does that have to do with socks

m.hitorino.moe/@yashi/media?max_id=101931494009761403

kys

God.

Why aren't you making software, user? I want you writing software right now.

Attached: Vigne_holds_Concepts_of_Programming_Languages_by_Sebesta.png (1163x943, 620K)

Wow a link to a site with that same picture and a bunch of anime pictures, you really showed me

I'm working on it right now vigne.

what if i am a girl (male)
checkmate libtard

Not only you never had sex, you can't even read. That's his social media profiles.

Here is his twitter twitter.com/kagurazakayashi and pic related his feet and manly face (since he's a male crossdresser)

Remember to kys yourself

Attached: 113f5f871b537d6b.jpg (1062x1543, 256K)

Want to be my girl (male) friend?

I'm working on a memory model that includes speculative execution and side channel leakage. I'm currently researching branch prediction and have concluded that direct, unconditional jumps do not cause transient executions even though they may be mispredicted due to BTB collisions. The idea is to use this memory model to verify that a compiler for my language preserves memory safety and secure information flow even in the presence of Spectre vulnerabilities.

You seem to have a brain cell deficiency user. The pic you posted is also, very clearly, a real doll. I understand it might be difficult to make the distinction without a bank of reference material (I.e. interaction with human beings) but anyone with a brain and social skills can see that that is a picture of a doll

Post code, larper. I don’t think you’re working on anything.

It's undefined behaviour.
Dynamic allocation of memory has a minimum size on most platforms, therefore that code may or may not work with such a short string.
If you try a longer string it should crash.

>memory model
>code

depends on how big your benor is

@71123680
You're not even trying anymore.

Ah, so you admit that you aren’t actually working on anything. Thanks, imagination man

...

>Guido is a weird retard
What else is new senpai?

Look at the nails retard
That's a real girl(male)

Look at how the skin slightly bunches up at the finger joints, a fuckdoll doesn't do that.

Holy shit c++11 is a fucking MESS to set up in vs code on Mac. So much for intellisense.

>chink
>mentally ill
checks out

Can't spell Chad without C

Attached: chad.png (226x307, 59K)

>using minimap in an ide
disgusting.

why arent you using c++17?

Who cares, the default seems to be 98 and I can't change it

please clean your keyboard op

You can't spell incel without C

I have kind of a stupid question.
If I wanted to try building a window manager in prolog, which libraries should I use? Are there Xlib bindings for prolog? I know SWI has XPCE but I don't know if that's what I'd need.

so i've been reading about garbage collection, and i think i understand the tracing/mark-and-sweep methods, but i still don't understand *when* it actually happens, especially in JS

i feel like it would be most logical to run the GC logic every time you pop a frame off the stack, because unreachable variables might be in that frame.

i also learned that you can do go to about:memory in firefox (as a url) and manually trigger garbage collection. apparently most browsers do have an api for it, but they all don't recommend using it manually.

You can't spell cuck without C

one of the main ways a garbage collector manages not to perform like shit is by amortising collection cycles.
What that means is that since any garbage collection cycle takes roughly the same time to execute (since the duration of a full cycle is predominantly a function of the size of the live heap, not the amount of garbage produced) then throughput is much greater if you just delay the collection cycle as late as possible. The live heap will be the same size so it'll take the same amount of time but you're collecting way more garbage if you do this.
This is the reason shit like Java just scales in performance by adding more RAM, because you really can simply delay garbage collection cycles with more memory and it'll get you more performance.
Generally the garbage collector is an unknown, you don't program around it and you don't expect it to preempt your program at any particular moment. All you need to know is that it's there and doing its job sooner or later.

>In what kind of ways do 'Real World Programs' handle IO?
by not using java

Yo can't spell fuck without C

Use Xcode

Can't spell faggot without Go :^)

Everything you wrote is a plus. I don't want to write a function that someone else already wrote. It's a waste of time.

>but i still don't understand *when* it actually happens, especially in JS
Implementation defined but typically you do it on memory allocation failure.

>i feel like it would be most logical to run the GC logic every time you pop a frame off the stack, because unreachable variables might be in that frame.
That would be insane and performance would grind to a halt.

The same could be said about types and (higher order) functions.

>Everything you wrote is a plus. I don't want to write a function that someone else already wrote. It's a waste of time.

So you could just... call the function without fucking about with objects and other nonsense

github.com/kagurazakayashi

It is said that GC does faster allocation because they can simply work as linear allocators vs. maintaining some heap data structure, but the question is: Shouldn't this mean worse cache performance?

It's the opposite actually. Over long term use a manually managed heap will have lots of little chunks scattered across memory to allocate from. On the other hand, memory allocated with a GC is almost always consecutive in memory. Since memory allocated close together is likely to be used close together, that bodes well for performance. A GC also has the liberty to compact the heap for better locality while manually managed languages generally can't relocate objects in memory behind your back.

I’m learning C as my first and favorite language. Can someone please explain why my 66 on the heap isn’t printing? Thanks frens
printf(“%d”, malloc(66));

Attached: 86EB26AC-5C02-4F7A-95B9-D38481368B27.png (1078x1073, 448K)

You're invoking undefined behaviour. When the %d format specifier is used printf expects an int, but you passed it a void*. Your compiler should issue a warning. Also, you're leaking memory.

Can’t spell cuck without two C’s.

dumb frogposter

if you want cache performance, you are allocating a large buffer. GC or not.

>two C's
so... C++?

>I’m learning C as my first and favorite language.

Attached: 1558395280795.jpg (483x461, 31K)

> What are you working on, Jow Forums?
Writing a new UI library for Inferno OS. The best OS ever conceived.

You're not giving it a 66.
You're giving it a pointer to memory you just allocated using malloc.

Attached: 1352274410845.jpg (332x298, 15K)

user don't bother with C, learn Dart

That’s C + 1 not C * 2 dumb ctard.

>imblying C != 1

I think this user has it. C is the unit of programming languages.

>having a favourite language before even knowing one
This board ruined you.

>I’m learning C as my first and favorite language.
mein gott

Attached: anon idiot.png (1679x943, 806K)

Coding is hard
Am I retarded