/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

yosefk.com/c fqa/exceptions.html
warp.povusers.org/grrr/HateC.html
ti.com/lit/an/spra311/spra311.pdf
en.wikipedia.org/wiki/Vacuous_truth
twitter.com/NSFWRedditVideo

fuck opengl

First for renaming /dpt/ to /lgbtq/ - LanguaGe Bant Thread (Quarterly). "Quarterly" referring to quarter of a day.

>anime image
good job OP


reminder that all programmers should understand at least the basics of:
>algebraic data types (and generalised algebraic data types)
>higher kinded polymorphism
>constrained quantification
>rank n types
>dependent types

My language has those.

first for C++ web programming

>muh data structures are all that matters
That's what happens when you don't teach CS students anything about software design.

Good for you, but bad languages (for building data structures) don't.

Looks like you failed the data structure class.

OpenGL is fine. Vulkan came at the right point now, the issue with difference in vendor specs grows into a bigger problem with each iteration of the OpenGL standard. For novice use, people should stick with OpenGL. You're probably not going to run into vender spec problems as long as you're not using any new extensions where the problems are most relevant. However, I'm glad that big studios like Epic can finally get the API they want. Vulkan is soooo much better than AZDO hacks.

>Looks like you failed the data structure class.
Based on my observation that data structures are not the only thing that matters? Do they only teach boolean logic in your CS department?

>Do they only teach boolean logic in your CS department?
They are taught in year 10 maths. Are you an American by any chance?

Who's this semen daemon?

For some bizarre reason, high schools don't like teaching linear algebra. I remember taking Calc I and II college courses in high school but I have literally never taken a Linear Algebra course. I had to learn it myself when my programming projects required matrix math.

>Are you an American by any chance?
No, but your retarded statements and invalid inferences continue to pile up.

...

What other ``references`` did you see me post?

>``references`
Boy, you can't even read. You seem more retarded with every post.

Ah, my bad. Let me correct that for you:
What other ``inferences`` did you see me post?

Do you want me to quote for you all of your retarded statements and invalid inferences?

>try/catch
Why does sepples suck so badly? C can't decide whether it wants to use return values (complicating function interfaces), errno or just fucking aborting. Then C++ adds a broken exception model to the mix, complicating further. std::variant can't help because there's no quick way to destructure it.

If you are going to refer , that's neither invalid nor an inference.

Why is it broken, seems to work for me

>if you argue about languages, it means you don't care about data structures, so you're a bad programmer
>if you point out that data structures are not the only thing that matters, it means you failed the data structures class
>if you imply that boolean algebra is taught in university, that means they don't teach it any earlier in [some country]
>if they don't teach it earlier in [some country], [some country] must be the US
Please keep posting so I could extend my list.

yosefk.com/c fqa/exceptions.html

does anybody know why sdl would shit the bed if i draw a non-fill rect over existing elements?

warp.povusers.org/grrr/HateC.html

;)

>if you argue about languages, it means you don't care about data structures, so you're a bad programmer
one of the possible scenarios, yes. However if you actually care about languages, it just means that you lack problem solving skills. Good programmers have problem solving skills, unlike your type.
>if you point out that data structures are not the only thing that matters, it means you failed the data structures class
Was I wrong? You don't really need to lie here, user. Also you assumed that boolean logic is thought in graduate level, which is not only laughable but also, ironically the status quo in America --based on my personal encounter.
>if you imply that boolean algebra is taught in university, that means they don't teach it any earlier in [some country]
>if they don't teach it earlier in [some country], [some country] must be the US
See above, my child.

Why are you discussing languages? Are you a bad programmer?

Where was it said that I like C?

Another one for the list:
>if you actually care about languages, it just means that you lack problem solving skills
Keep posting.

Existence of value types is largely language agnostic
Be sure to note them down, that's how youngsters like you should learn.

>if you argue about languages, it means you don't care about data structures, so you're a bad programmer
>if you point out that data structures are not the only thing that matters, it means you failed the data structures class
>if you imply that boolean algebra is taught in university, that means they don't teach it any earlier in [some country]
>if they don't teach it earlier in [some country], [some country] must be the US
>if you actually care about languages, it just means that you lack problem solving skills
>if someone calls me out on my retardation, they must be young
Keep posting.

I just like posting that in response to the yosefk article I always see. I'm just taking the piss.

But you said your language has them. Why does it matter how language agnostic the feature is if you're talking about language?
It sounds to me that by your very own definition you're a bad programmer.
Which is fine. Its just not common for people to accept this so openly here.

Wow what a loser. He actually made that a main complaint.

Correct. Remember to read them out loudly before going to going to school everyday.
If I am pointing out a language agnostic feature, it means that I care not about the languages, my boy. Agnosticism is an indicator to indifference.

RAII is a good idiom. Rust is practically built around it. As a bonus, you don't even need to deal with exceptions or constructors!

>No RAII
Eww c is cancer

>Agnosticism is an indicator to indifference
It never stops with you, does it?

>I'm pointing out an agnostic feature
No you didn't. You asked what feature was required and in response to a very agnostic feature you brought up your language.
It doesn't matter though. You're admitting to being a bad programmer. It's settled. No need to make a fuss about this. It's wholly uninteresting.

>RAII is a good idiom.
It's a very expensive idiom. I won't go into it. But in C++ in particular it suffers. I can see a better argument for other languages.

ti.com/lit/an/spra311/spra311.pdf
I thought global variables were evil and whatever superlative CS people go by.
Global variables are actually quite common on motion control engineering / robotics / whatever engineering not CS nor numerical simulation related.
Are global variables acceptable as long as my program don't have functions accessing the value simultaneously?

Not only an indicator, I'd argue that it's a product of indifference, my child.
You see, my boy, I wasn't the one who brought up value types (which is, again, largely language agnostic) but the premise the topic was brought up was to ``challenge`` me for being language agnostic. Then someone pointed out value types and I only pointed out how language agnostic it is.

>he doesn't study 144d hyperplanes so he can destroy the internet

pathetic

>It's a very expensive idiom.
How so? Assuming your compiler doesn't fuck up with inlining, ctor/dtor calls aren't more expensive than manually calling init and close functions.

I really don't think the guy you're replying to said "fuck opengl" because it's too high-level for him.

>Not only an indicator, I'd argue that it's a product of indifference
>my child
>my boy
Imagine feeling compelled to spew this cringeshit non-stop, and without a hint of irony.

Would any one here recommend me this book?

Shouldn't you be doing your homework, my child?

Will Rust early adopters become millionaires in the near future?

>reference
Do you really require a recommendation if you want a language reference? You can inspect it's index or other helpful facilities. Read reviews on if it's accurate or not.

I'm writing a post-tonal musical analysis/composition software on Haskell.
I've never dealt with real projects before, I don't know nothing about structuring code and files, and right now it's beggining to get a little messy. Do you guys have any tips?

No but I can recommend you this one.

No.

Not the same user, but I just want to say that obnoxious condescension and namefagging are for reddit.

>post-tonal musical analysis
Good luck. Not even humans can make sense of it. But in all seriousness, that sounds like a cool project.

Take that non self hosted trash out of my sight.

>obnoxious condescension and namefagging are for reddit
Maybe, but his mental retardation is just up /dpt/'s alley, so I say he should stay.

Oh I saw this meme earlier today. Well made meme user.

>I won't go into it
Because you have absolutely no idea what you're talking about.

>condescension
How? I'm granting newfags with my valuable observations collected through decades of experiences so graciously.

Stay mad, stackunwindefficiencylet.

>stackunwindefficiencylet
Has got nothing to do with RAII.

I'm a mathfag and I'm basing most of it in Cook's analysis and Straus post-tonal theory books (and my own notes using more advanced maths that simplifies a lot of things on them) and I always wanted to do something with it.
But with almost no coding experience it'll probably be a very long time before I have anything worth showing.

>stack unwinding has nothing to do with RAII

user I can't argue better than other people with similar complaints. I accept this and leave you to become enlightened by your own means.
You can't expect everyone to just feed you. This is a boring topic for me.
You're clearly interested and I'm sorry. Hopefully you don't value my particular opinion that much.

We weren't talking about exceptions you fucking retard, we were talking about RAII.

>RAII is free, except when it isn't! we weren't talking about those cases!

What is inefficient about stack unwinding in C++?
I don't use exceptions so I don't know.

RAII implies lots of (semi-hidden) destructor calls. Cascading destructor calls can be deceptively expensive.
Exceptions are even slower.

Exception handling isn't as simple as a setjmp/longjump because there could be destructors that have to be called on the way, which is a result of RAII. That's one example.

>embedded autismos don't like exception
well no shit, they don't like anything. anxiety induced by constraints of the industry.
>forgot to delete
>people die

for everyone else C++ exceptions are completely fine

>RAII implies lots of (semi-hidden) destructor calls
No it doesn't.

>Cascading destructor calls can be deceptively expensive.
Not if inlined.

This is dependent on the object the destructor belongs to. The majority of destructors are pretty simple.

>Exception handling isn't as simple as a setjmp/longjump because there could be destructors that have to be called on the way
Well of course. that's the price of resource safety.
It's not even an issue, in C you'd have to do all that anyway, but manually.

>which is a result of RAII
Incorrect. This is a result of exceptions.
Rust for example, which has RAII but not exceptions, doesn't have the "problem" you describe.

>>forgot to delete
>>people die
Embedded people would love C++ then.
A lot of embedded people actually already use C++ though.

Programming is really messing with me head I tell ya
I cried in the bathroom at work today for literally no reason, fuck

It's the estrogens they put in the water taking effect.

>It's not even an issue, in C you'd have to do all that anyway, but manually.
In C you just wouldn't rely on RAII to release resources.

>language X doesn't have the problem you describe because it just doesn't let you do Y, so Z doesn't make Y more expensive
en.wikipedia.org/wiki/Vacuous_truth

Recoding c++ routine in Fortran. Stealing code because I can't program it from the implementation paper. The problem is I don't know c++.

Why isn't there a good systems programming language?

>In C you just wouldn't rely on RAII to release resources.
Yeah, as I said, manually.

>en.wikipedia.org/wiki/Vacuous_truth
Are you retarded? That link has absolutely no relevance to anything said.
You explicitly stated that it is a result of RAII. And I'm correcting you by saying that it's a result of exceptions because it fucking is.
If what you say is true, then by adding RAII to a language, you always gain the problem you described, which you don't, as proven by Rust.

>C++, Rust, D, Go

Because systems programming autists can't conceive of anything better than the trash available to them, and everyone else doesn't care.

You must be using C, because you forgot to null terminate that string.

>C++
We've gone over this a million times.
>Rust.
Abominable syntax, "safe" to a fault.
>D
GC disqualifies it.
>Go
Not a systems programming language.

What are Sup Forums's thoughts on Python?

>We've gone over this a million times.
And the outcome has always been that you have no idea what you're talking about.

Quick script and retard language.

>Yeah, as I said, manually.
You wouldn't implement RAII manually. You simply wouldn't use a RAII-like approach at all, so in a properly thought out C project, you could use setjmp/longjump to do exceptions without suffering from the deficiencies C++ exceptions suffer due to RAII.

>That link has absolutely no relevance to anything said.
Maybe you should read it again until you understand why it does.

>You explicitly stated that it is a result of RAII
It is a result of RAII. Maybe you should read my post again until you understand why it is.

>as proven by Rust
Nothing is "proven by Rust". Rust is irrelevant in this discussion.

Im gonna use "as proven by Rust" IRL with a smug face on every occasion

Why?

Dynamic typing and slow as fuck.

Daily reminder that static typing is shit. ;^)

Name my band /dpt/

Candidates for Garbage Collection.

The Curly Brackets.

>You simply wouldn't use a RAII-like approach at all, so in a properly thought out C project, you could use setjmp/longjump to do exceptions without suffering from the deficiencies C++ exceptions suffer due to RAII.
Fizzbuzzer spotted.
Or do C programs just not deal with memory or resources of any kind?

>Open a file handle or allocate memory
>longjump out of the function without freeing it
Yeah, enjoy your resource leak I guess, but at least it's efficient right?

>Maybe you should read my post again until you understand why it is.
Okay, lets do that.
>Exception handling
Exceptions
>setjmp/longjump
Alternative to exceptions
>destructors that have to be called on the way
On the way to where? oh that's right, to the catch block. And from where? oh, the throw statement.
That's right, exceptions.
>which is a result of RAII
Yet everything you've said has been about exceptions.
If anything, this shows how RAII is superior. You get efficient automatic resource safety for free.
That so called "properly thought out project" also applies to C++. So if you don't deal with resources, or somehow magically figured out how to not have to free them, you don't need to manage them (i.e. call destructors, or free/close/foo_destroy/whatever).

>Rust is irrelevant in this discussion.
It is relevant because it proves my point.


I think you're genuinely retarded.

The GC in D is optional.

The Systems

>Or do C programs just not deal with memory or resources of any kind?
C programs kinda do with automatic local variables, which are allocated on the stack at function entry, and deallocated at function return.

Other than that, ressources and dynamic memory have to be manually managed.