/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

pastebin.com/vsUiJ31k
pastebin.com/9EN0Y4Z3
guyrutenberg.com/2014/05/03/c-mt19937-example/
twitter.com/NSFWRedditVideo

the second one is a meme that will never catch on

Outdated pic.
Pic related is also a standard for top.tier programmers

Java brainlets without value types are butthurt

C# > Java

yet another stupid meme that will never catch on
do something original faggot, the meme already exists and it isn't changing

GC brainlets without RAII are butthurt

C++ > C#

Reminder that Rust is the only acceptable option.

Agda
Idris

Reminder that Rust doesn't even have guaranteed TCO or real HKTs

Reminder that Rust claims to be a systems language but doesn't even have non-blocking IO functions in its standard library

>C++ > C#

I never said otherwise. Even if C++ is bad in some ways, it's still most powerful lang and C# doesn't come close

Idris and Agda are brainlet-tier languages for babby programmers who need the compiler to babysit them and make sure their toy program to reverse a list is correct.

>Reminder that Rust claims to be a systems language but doesn't even have non-blocking IO functions in its standard library
Neither does C or C++.

>can only imagine toy programs in those languages
sounds like you're the brainlet, user

I can imagine (painfully) writing non-toy programs in these meme languages, but clearly, Idris and Agda fans are never up for the task. This is evidenced by the non-existence of real programs written in Idris or Agda.

Guys, I want to attempt to write a software that will involve a lot of 2D drawing. Think side-scrolling game or Photoshop. It's imperative for this software to run on as many desktop platforms as possible. What kind of drawing library should I use? I have little use for widgets. Would be too bothersome to go as low as Vulkan?

can you guys post one of those "which language should I learn" charts? I'm currently in the process of picking one

Javascript. Anyone who tells you otherwise is a brainlet who doesn't understand prototypal inheritance.

sdl has some 2d drawing functions.
There's also cairo and other that level of libraries that do 2d graphics with multiple backends.
No point going for vulkan/opengl/directx for 2d stuff.

Porting Webkit to EGL for tty shitposting

You will not be accepted in /dpt/ unless you are willing to learn at least two programming languages

Rust has higher kinded polymorphism, it's not an apocalypse. But Agda or Idris is an academic (useless) language. Don't compare useless languages to languages of real wold

I am not looking for vector drawing though. I want bitmap, i.e. a canvas of arbitrary size where I can paint a pixel however I want.

SDL2 is for you then.

Don't agonize too much over it. You can't go wrong with any of the top 5 languages on GitHub.

If you learn one of them well, you already know 90% of each of the others.

>If you learn one of them well, you already know 90% of each of the others.
And that's what's wrong with programming today.

>unless you are willing to learn at least two programming languages
I know about a dozen, including Common Lisp, Haskell, Idris, C, Lua, C++, and I am telling you that Javascript is objectively the best. If you think otherwise, come back once you've mastered a dozen languages and maybe then you'll be in a position to argue with me about the virtues of JS.

>Javascript is objectively the best
This tells me that all of the other languages you tried were too difficult for you.

>were too difficult for you
Than how come I am so damn good at them?

You're not.

Whatever you choose, be sure to go with hardware acceleration, even for a purely 2D game.

If you base a game on plotting pixels on screen today, your 4k or even just 1080 strategy will be shitty screen scaling.

Meanwhile, people going with Vulkan, OpenGL or any wrapper thereof will have 4k 144fps at

>if you disagree with me you must be bad at other languages
Brainlet-tier argument from a babby brogrammer. I accept your concession. Have a good day, kid.

>4k
>2d side scroller
oh I am laffin

I want to start making a Minecraft clone. The whole point of it is to just learn to code better.

But, where do I start? Graphics work with OpenGL? Or work on the basic classes?
I'm pretty overwhelmed, it's a huge task which eventually will be good.

This is just a big thing to learn for me.

Just as I don't take seriously people who claim 2 + 2 = 6, I don't take seriously people who claim to know Common Lisp and say that Javascript is better than it.

Do you think that people with 4k screens don't play 2d side scrollers? Or do you think they're ok with changing resolution to 800x600 when your game starts?

Do you know linear algebra

progressing should be from right one to left one, it's just common sense

>muh lisp is too complex for you
Then how come I'm a better lisp programmer than you are?

Nope.

>le epic trollface. problem?!
Fuck off with your shit tier brand of noob trolling

you're fucked

>Then how come I'm a better lisp programmer than you are?
You're not, because you think JavaScript is better than CL.

>it's another episode of GL coders pretending to know linear algebra
Reminder that knowing how to multiply vectors and 4x4 transformation matrices =/= knowing linear algebra. Quit trying to make it sound complicated and putting people off.

>Don't know x
>Can never ever learn again

>You're not
But I literally am. Prove me wrong.

you got so butthurt you replied to me too along with that fag LMAO

The burden of proof is on you.

Employed Haskell programmer here

Problem?

For an employed person you sure seem to spend a lot of time posting in /dpt/ instead of working.

>Saturday

>The burden of proof is on you.
Do you want to scroll back and see who claimed first that I must be bad at CL?

Reposting a question from last thread since nobody could really tell me what might be wrong.

Anyone want to tell me if I have the right idea for doing something with Java concurrency? I threw this together real quick in pastebin as an example of what I'm trying to do - basically, I want a thread (Collector) that adds some item to a queue, a bunch of other threads (Actors) that want that item, and a manager (PopulationManager) that distributes that item to those threads. I'm trying to accomplish this with BlockingQueue, but in my real implementation, it's not working. Is my approach fundamentally flawed, or am I just introducing a dumb bug somewhere in my real code?

pastebin.com/vsUiJ31k

The exact problem: when I do this -
public static void main(String[] args) {
for(int i = 0; i < 1000; i++) {
populationManager.runGeneration();
}
}

It fails with a NullPointerException at line 42, where the ActorThread does items.take(). Any help would be appreciated!

>being this new

You claimed to know CL in . Prove it.

>playing 2d side scrollers in fullscreen on a 4k monitor
gaymers everyone

How do I pluck a random object from a random array in C++?

Just use Unity.

You asked this question before I went to sleep last night
Since then I have slept, looked at a bunch of furry porn, rubbed my dick, taken a shower, and fixed a bug in my own code
You probably could have googled "get random item from array C" in that time

He wants it in C++, not C.

I didn't say I wanted to make games. I just want to learn.

Game programming is a very specific niche.

>You probably could have googled "get random item from array C++" in that time

Fixed

Yes an I looked. And yes I'm still retarded. I'll probably have to ask a board off Sup Forums that isn't filled with similar retards like myself since it's such a hard question to be answered.

>looked at a bunch of furry porn
Kill yourself.

>Prove it.
I know lisp enough to have my own lisp compiler written in my own lisp dialect which compiles itself, and it has its own standard lisp library written in lisp. Do you know what it compiles down to? Asm.JS. Anti-JS shills B-T-F-O.

Here's a chunk of the standard library which implements most of the basic constructs that you take for granted in CL.
pastebin.com/9EN0Y4Z3

use random() or if you feel adventurous then research the new C++11 random shit that's much better

Triggered, user?

modern C++ is much better!

It is. And I'm not thinking I'm about to create the replacement game engine for the world or anything.

My work has taken me away from real coding and more standards/procedures. In my spare time I'd like to have little projects to work on. This will be something I can step into, learn a lot and be happy with that.

What's the C++11? I've used random() but it's picking from a single array 60% more often than the other two arrays.

Why?

How many languages should programmer learn until he's 30?

this

>compiler outputs js
>therefore js is the best language
w e w

C++ is only essential for embedded, kernel and driver development. Anywhere you can fit a dotnet or jvm runtime you're better off doing so. Anywhere you're not directly accessing hardware you should really consider not using C++.

That's not the point. The point is that I clearly do know lisp.

learn how to draw a triangle using opengl and then go from there

But C# and Java are inferior languages.

Not really. C++ is not good for this, it's C. C++ is widely used in large software beyond low levels.

Recently i was getting C++ errors when visiting MS website, apparently it's entirely coded in C++ lol.

>C++
>essential for embedded
Never change, Sup Forums.

...

C++ does just fine at embedded and kernel development.
Don't fall for the memes.

>inferior language
that depend on where it is run. C++ is powerfully yes but i will say the bar of entrance is high. I've watch my friend struggle through the pointer stuff and then frustrated and go to other language.

why should i not write c++ if i can

>C++
>Pointer stuff

Are you fucking KIDDING me? Pointers are least "hard" feature in C++. Ffs.

I use pointers with C and feel very comfortable with them, but i still can't fucking learn C++ on non-Helloworld levels. It's simply because C++ is just too big for me. I can't do it.

you can doesn't mean you should ?

>i will say the bar of entrance is high. I've watch my friend struggle through the pointer stuff and then frustrated and go to other language.
Are you saying that this is a bad thing?
If you can't even grasp something like pointers, you probably don't have the right mindset to even do programming in the first place.

so you actually have no good reason

guyrutenberg.com/2014/05/03/c-mt19937-example/

just talking about being lazy man. i just want to be a brainlet and write simple code that doesn't involve advance c++ template and shit.

Lmao brainlet.

that's pretty cool user

I'm dicking around with urwid. I have a script that converts anime back to 8bit and am building a TUI file picker for it. Just wish I had a reliable way to check if it was 10bit already.

>I have a script that converts anime back to 8bit
Why?
Do you watch anime on your toaster or something?

>brainlet

Well, i am working as C# dev and coding in C for fun, i'd have to keep too much information in my head for both work related stuff and stuff i do in free time.

I just can't get C++ in my head because its too fucking large, though i tried.

Yeah i'm not very smart desu, but it has nothing to do with my intelligence. C++ is just hard and that's it.

>It's simply because C++ is just too big for me. I can't do it.
newfags should take this warning seriously

C++ is an insane commitment, you'll struggle for years before anyone takes you seriously

it's like becoming a scientist in some science except all you will know is writing slower programs than in C and use a very lacking library

it's 2017, when are we going to get multithreaded emacs?

Yeah it's insane that language itself without standard library is harder than anything out there and takes years to learn properly. Now imagine learning BOOST and such additional libraries for coding anything meaningful (what the fuck can you do with bare C++? Nothing, lel).

How the FUCK is that better than coding everything from scratch in C? what does C++ give you in advance of losing so much time that C doesn't? I'd better waste my time coding features in C than learning C++.

>Inb4 MUH OOP!!!

Fuck OOP, i can use C# when i feel like it

there is oop in c if you want to use it. what is an object if not a struct with a bunch of function pointer tied with it?

the oop in c# actually make sense. wtf is friend class and multi inheritance??