/dpt/ - Daily Programming Thread

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

Attached: 61556441_p0.png (1221x1832, 1.21M)

Other urls found in this thread:

en.wikipedia.org/wiki/Tcl
github.com/dotnet/csharplang/issues/2574
gigamonkeys.com/book/a-few-format-recipes.html
lispworks.com/documentation/lw50/CLHS/Body/22_c.htm
forth.com/starting-forth/
thinking-forth.sourceforge.net/
twitter.com/AnonBabble

>auto main() -> int
Why the fuck is C++ doing this shit?

'(FUCK LISP)

C# and anime girls!

Most people don't do that, only autists use trailing return types everywhere.

Sane languages:

#include

auto main() -> int {
for (int i = 0; i < 2; ++i)
{
auto localBool = false;

if (localBool)
std::cout

Attached: 1540491518819.png (804x876, 456K)

Attached: smokey.jpg (338x450, 134K)

But Lisp is fun!

It's not C++, it's retards. The arrow notation for return types was introduced to specify explicit return types for lambdas. The kinds of people who use it for real functions are the same kinds who do this:
(define f
(lambda (x)
...

Don't respond to trolls.
Refer to

>Sane languages:
>#include

Attached: 664.jpg (558x614, 18K)

OH NO NO NO NO NONO
Imagine being a cnile brainlet LMAO HAHAHA

Attached: 1537771566378.png (1200x1400, 502K)

the average sepples fan hates on iostreams too

Imagine writing code that ever needs to perform the same operation on different types, such that you would ever run into this problem.

Imagine unironically being that bad at programming.

Do I have to be a tranny to be a decent program?

Attached: 1560862569489.jpg (3120x4160, 3.3M)

Grapes

Yes, to be a decent program you have to be transspecies and identify as something nonliving, namely a program

>Sane languages:
>sepples
too much baka in one post

Attached: 1496154461040.png (247x261, 10K)

Is this what we're doing now?

Apples

It's more likely this is intended to prevent mistakes.

c# has lexical scopes user

>NON PORTABLE CPP MACRO
no you got it all wrong.

Generic: bad.
Non portable macro: bad.
Void pointer: bad.

The only real good: recognizing the only two types you will ever need for anything are int and char[]

Just wait until you hear about this great new language called B.

lol

>get a job after being a neet for years
>reflexively start looking at lolis and listening to anime song like I always do
>female coworker saw my monitor and went "UGH" and walked out
I'm fucked aren't I

Attached: 1560332497082.png (645x773, 11K)

Has templates (cringe and bluepilled)
>C++
Has C macros (based and redpilled)
>C
>GHC/Haskell

why int? you can put anything in a char[].
en.wikipedia.org/wiki/Tcl

>Reflexively looking at lolis and listening to anime

Jesus christ

Since you're lying about having a job nah
You're good /b/ro

You think you're joking but I unironically hold 'upgrading' B to C was a mistake.

C++ has macros too

It even has inline functions, which are like macros but better

top and bottom are the same thing
templates are just a fancy texteditor

Attached: my cacton.jpg (1280x720, 67K)

Templates and macros are both shit compared to real generics.

Using int where possible is more optimized.

Templates, macros, generics, and void pointers are all shit compared to just writing good code in the first place so that you never need to do the same thing to multiple types

if you can tolerate ints for performance then why not floats as well?

The only time you don't benefit from apply an operation to multiple types is when you only have one dynamic type in the first place.

Yeah, floats too, I forgot those.

It certainly suits the "minimalist" philosophy better. Just make everything a word, why not?

You only need three types and there's absolutely no reason they should be dynamic.
>int
>float/double
>char[]

>"""""""""modern""""""""" language
>doesn't even have an effect system

Attached: Bauer_Andrej.jpg (2934x4128, 2.41M)

because posits exist

html5 parser is sepepeples.

You only need one type, and it's a machine word.

indeed

Attached: ChuckMoore.jpg (279x234, 36K)

Writing a generic version takes the same time (in C++) so it's always worth it

No, you need at least two types, a data word and an address word.

If it was lewd lolis, you're dead.

If it was non-lewd lolis, they'll still think you're a pedo because Western culture is incapable of handling the concept of men thinking little girls are cute without it being sexual but at least the cops can't do anything about it.

>BYTE
ftfy

>Has C macros (based and redpilled)
>Haskell
what?

How did you manage to work Jow Forums into this?

Yeah but it's never actually worth it. "Worth it" would be if you gleaned a net benefit. Instead you always break exactly even, because you spend the same amount of time writing it and get the same payoff. Since you don't need to use the same code on any more than one type after all.

On many platforms they're the same.

> four levels of indentation to write a line
i want to burn these fuckers alive, kill these fuckers

That's where obnoxious people with trashy opinions belong.

bot misfired

On pretty much any 8-bit platform they aren't

Neat! I'd never heard of this. Is it useful yet? Will it replace floats?

>t. hardware programmer
Enjoy being poor.

I really dig FORMAT and LOOP in Common Lisp. You can get pretty crazy with it, for example (not written by me):
(format t "~{~{~:[~;Fizz~]~:[~;Buzz~]~:[~*~;~d~]~}~%~}"
(loop as n from 1 to 100
as f = (zerop (mod n 3))
as b = (zerop (mod n 5))
collect (list f b (not (or f b)) n)))

Not that this is particularly elegant or how you should use FORMAT in practice but I do find it fun.

You don't even know what that means, do you. You're just imitating what other people on this website are doing

Attached: thumb_hey-bro-if-you-dont-stop-it-ill-have-to-35828588.png (200x213, 23K)

Apparently it's deliberate
Scoping is too hard of a concept for millions of pajeets at Microsoft so they decided to bake-in a handholding feature into C#

github.com/dotnet/csharplang/issues/2574

Giving ground to functional programmers was a mistake

That syntax is comfy desu.

Attached: 1343084364166.jpg (1024x768, 619K)

I'm not even a hardware programmer, but that's actually where all the money is. Low level programmers make wads in embedded shit. High level programmers make wads in web backend. Both of them make fat stacks in database design. Pretty much everyone else is a code monkey.

Yes, otherwise executing you would sit on my conscience

Someone else said that embedded pays shit a while back. I haven't seen a single thing, with the exception of writing COBOL for banks, that anyone can actually agree with well paid or shit paid.

the syntax makes you want to kill yourself

have to take my daily dose of estrogen before i can start programming

Attached: Screen Shot 2019-06-18 at 11.08.38 AM.png (1920x1080, 2.69M)

>Jake
That might be a girl

If you actually knew the syntax, that ~SOMETHING are directives, it's not that bad at all. It's actually all very readable.
gigamonkeys.com/book/a-few-format-recipes.html
lispworks.com/documentation/lw50/CLHS/Body/22_c.htm - Specifically look at the control flow section.

Fuck it, I'm implementing a lisp interpreter. In javascript.

byuu for some reason does that all the time in Higan's code.
It's otherwise a pretty clean codebase, but I always found the "always trailing return" policy quite strange.
Anyway, in both C++ and C, the best style is to use the traditional leading return type (unless you need the trailing return for usage with decltype), but put it on a separate line.
It avoids the additional "auto" and functions are all aligned.

Why not look up some numbers?

O-ok? Have fun!

Now I want you to explain, in detail, what's "Jow Forums" about that comment.

existing solutions exist

Stop it user. Some people need to justify their existence in some way. Don't poke holes into that. It's important.

>solutions
user, slow down. I don't even have a logo or a name yet.

I am too much of a brainlet to properly interpret the numbers.

Easy. It says '(FUCK LISP).

Ok, and? Why is hating Lisp Jow Forums?

Redpill me on Forth.

If I had to make a stretch it would be because of it's integration into emacs which was written by stallman who is a semetic man.

Go redpill yourself
forth.com/starting-forth/
thinking-forth.sourceforge.net/

LOOP and FORMAT are...something alright.
I prefer Iterate over LOOP, it's a bit nicer and more sane. FORMAT, I don't know.

why did I read that as "Go Forth and kill yourself"? strange

You misunderstand, I want to make violent love to Lisp.

You can like or hate Lisp without it being a pro or anti jew thing.

Because hating lisp is hating. There's nothing wrong with hating, but only Jow Forumstards think it makes for worthwhile conversation.

Attached: Untitled 2.png (651x394, 65K)

Lisp is a jewish language, literally.

You better kill yourself dude. I wouldn't be able to live with Jow Forums living rent free in my head.

Who is this person and why are people constantly posting his pictures on Jow Forums?

Thanks user.

holy shit! pajeets really can't into scopes. this doesn't compile in java nor c#
int x;
for(;;) {
int x; // too hard for pajeet
{ int x; } // NOPE TOoo hard!!!
}

You don't have to stretch that far.
Just think about its original designer.

I don't know, man, it looks a lot more similar to English than Hebrew.

Since when LISP was about doing anything practical?

Doesn't matter what you'd be able to do, I'm not living for you. In fact I'm not living for anything. And that's all the more reason I'll keep living. If my dad raping me didn't make me kill myself, and my mom dying didn't make me kill myself, the unfortunate fact of knowing Jow Forums exists can't make me kill myself either.