/dpt/ - Daily Programming Thread

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

First for C11.

Thank you for using an anime image!
Thank you for using a Karen image!
Thank you for using a Haskell image!

what do you call anime where girls act cute?

"anime"

M O E
O
E

What is good and fast prototyping language?
Pro tip: Python ain't fast

Cython

literally "cute girls doing cute things"

>What are you working on, Sup Forums?
Training a co-worker on how to dev in C#, and he's completely green.

It's actually kind of fun, though.

Haskell

can he do FizzBuzz though

Good question, I'll ask him to do one.

Will post results.

>it doesn't bloat up the language like C++

Standardizing VLAs are the single biggest mistake ISO has ever done.

C11 is also pretty fucking bad, so bad that nobody has bothered with Annex K, because unlike C99, it does violate "the spirit of C".

not necessarily. But supporting those things is certainly highly desirable in just about every situation I can think of.

Proof of what?

Thinking about memory representation of higher inductive types.
data Circle : U where
base : Circle
loop : base = base

Values of Circle need no representation. (base = base) is equivalent to the integers, so a path in (base = base) can be represented by an integer. Transitivity of paths in (base = base) is addition and symmetry is negation.

>filename
Why?

Why's that slut eating grass

Because the sea weed

>caring about performance in a prototype

Yes, it's being a non-programmer who can;t justify the time to learn anything better.

C#
.NET library and true OOP means you can just throw shit against the wall and stick an interface on top without any actual effort

Every good programmer should.

Oh, and of course refl would be 0 and loop 1.

This. Or F#

Annex K, like threading, is optional. Why bother implementing what nobody really wants, and other compilers also aren't implementing?

>Annex K
Yes. Annex K is fucking garbage, but it's an optional part of the language.
The reason it sucks so hard is because it didn't take threading into account at all when it was designed.
>Standardizing VLAs are the single biggest mistake ISO has ever done.
I think they're pretty useful, although you obviously need to be mindful when using them. It's certainly better than alloca and shit that people were using before.
They made VLAs and complex numbers optional in C11, so that compilers targeting embedded platforms didn't have to add a bunch of shit they were never going to use.

Not when performance severely limits productivity.

It would take days to do some things in C that can be done in like 4 lines of code in Python/C#/Java.

Sure, so why use python when you can use something fast like C# and Java?

Hilariously true.

So easy to get shit done in C# and shove it in an extension method or something and move on with your life.

It Just Werkz™

I don't get the complex numbers in standard library meme
Is it just bandwagonning?

No arguments here, C# is my favorite language.

Sure, you should "always care about performance", but performance comes after getting it done.

You should code sanely the first time (e.g. don't call I/O on every iteration of something), but save fine-tuning optimization for when it actually presents itself as an issue, or when there's nothing else to be done.

They were trying to rival fortran and become more viable for numeric processing.
That's why they added restrict pointers, because that was one of the things fortran had over C.
That's why they added , to make using the math functions easier.

I've used the complex number functions before. It was helpful when I was doing some stuff with FFTs.

>Sure, you should "always care about performance"
And that's all I stated.

never tried programming before, first day today, started with c++, seems pretty fun!

Sorry, assumed you were one of those "muh C" cucks who get absolutely nothing of value done ever.

java is the best, friendos

enough green squares to get noticed by the HR subhumans?

maybe in a world where there are no other options

so in this?

The only winning move is not to program

Not when there's people like me.

does this image represent C++ accurately?

post images for other languages

reimoo?

that's what everyone is doing here

Swiss army knives are useful, safe and well designed.

No.

>barely commiting on saturdays & sundays
It's like you actually got hobbies.

for i=100,1,-1 do
if(i % 5 == 0 and i % 3 == 0)
then
print("fizzbuzz")
elseif(i % 5 == 0)
then
print("buzz ")
elseif(i % 3 == 0)
then
print("fizz ")
else
print(i)
end
end


Job please. I need money.

Runescape

>look up basic react.js tutorials
>HI JUST ADD THESE 120 DEPENDENCIES
>DONT ASK WHY HELL IF I KNOW
>WE'RE GONNA NEED THIS LIBRARY TO ADD JAVASCRIPT FEATURES FROM A FUTURE VERSION AND RECOMPILE CODE INTO OLDER JAVASCRIPT
>WE NEED THIS TO PACK YOUR SCRIPT INTO A SINGLE SCRIPT
>WE NEED THIS TO ADD ALL DEPENDENCIES
>THIS DOES... UH.... STOP ASKING QUESTIONS
>THIS ADDS SOME TRIVIAL COMPONENT AND/OR FEATURE YOU COULD CODE YOURSELF IN 5 MINUTES, AS WELL AS A MOUNTAIN OF CODE THE PROGRAM WILL NEVER USE
>THIS COMES FROM A TRENDY STARTUP AND EVERYONE USES IT
>THIS IS NEEDED FOR COMPATIBILITY WITH SOME SHITTY FORGOTTEN BROWSER NOBODY USES ANYMORE

are all javascript developers mentally ill?

is getting good in SQL hard?

99% are just copy pasting pajeets in white skin

No

:^)

>do the needful

Triggered

Sort of a dumb comic. As shitty as JS is, you can get it to do useful stuff without too much pain if you're not retarded.

See, this is what I'm talking about. Why is this accepted? Why are there so many people that keep supporting this piece of shit? Why do they keep making new variations of it (coffeescript, typescript, jsx, ecmascript 2016)? This must be some kafkaesque nightmare.

who the fuck thought JS is good outside of handling DOM?

While writing a query generator / formatter today, I realized that Amazon's CloudSearch structured query format is thinly disguised lisp input.

>JS
>Good at handling DOM

Are you retarded?

JS powers the web. A lot of people use the web you know. If you want to do something interesting on the web, JS is the only option.

>js is popular because it's popular

welcome to the tautology club

Well, as far as I understand, it was the initial idea of JS.

JS is popular because the WEB is popular jack ass.

Are you asking why the web only supports JS and nothing else? Because web standards suck ass and always have.

WebAssembly will save us, r-right?

>comparing i % 5 to 0 twice

Get out before I call security.

Where can I find some good tutorials on "MySQL normalization" or "indexing", I heard it solves alot of performance problems on forums, currently my forum database has >1GB of data and the queries are taking minutes, of course it's not a populated or "real" forum but I would like to fix this, also another question, does other types of database have this problem as well or they just work™? (PostgreSQL and others)

I think you can read a guide just on database normalization, since this problem is universal.

It's just easy and intuitive to program with, a hundred million times easier than whatever "godtier" language you guys use, as long as "better" languages still are a pain in the ass to learn and program with JS won't die

for i=100,1,-1 do
s = ""
if(i % 3 == 0)
s = s .. "fizz"
then
elseif(i % 5 == 0)
then
s = s .. "buzz"
else
s = i
end
print(s)
end

Hey guys wanted to know once I'm done following the tutorials of Visual C Sharp step by step will I be able to make games?

>It's just easy and intuitive to program with
too obvious 0/10

Sure.

I learned it just by trial and error in a couple weeks with basically no programming knowledge

So it's easy and intuitive to learn compared to what?

What's the most complex thing you've written with it?

Does anyone know Scala well?

I want to connect to a bare SSL/TLS socket that talks XML so like a webservice but it stays connected because there are broadcast messages sometimes.

Where do I start with connecting to this in Scala?
I looked at Akka but that looks to be pure webserver.
I found spray but I'm not sure if that's the right direction.

By godtier languages I meant C++ and C, you cannot deny those two are infinitely more complex than JS

Scala is awful, please stop using it.

I'm not familiar with that language but it seems you dun goofd your if statements there, bud.

Are you being genuine? I just want something no matter how long that once finished will make me 100% capable of creating games without wasting any more time with incomplete stuff.

What makes you think that C++ and C are "godteir"?

At least those are fast.

My point is JS is shit, and there's far better langugaes than it for doing just about anything besides web stuff. I would not go around describing it as "easy and intuitive" because it's one of the least easy and least intuitive high level langugaes in common usages, beaten only by PHP.

Well, learn C#, and then learn a game engine that uses C#.

You can certainly make some simple games with very limited knowledge of C#.

finish watching the tutorials because quitting makes quitting a habit and you will get better at gamedev by finishing them (you'll have more knowledge/tools to work with in your head and a greater sense of whats possible and how to find answers).

Gamedev is done using tools and game engines it's not just coding, programming is only a small part of actually making games. Enginedev is more what you think of when you think "games require c++ programmers!". This isn't even from a meme visual coding tool standpoint or a "I can make an RPG maker game I'm a gamedev!" standpoint. You'll do programming when making any significant game, but it will mostly be scripting stuff (the difference between scripting and programming is basically non existent) but whatever you do it won't be pure language stuff.

>basic programming knowledge ( boolean logic, for and while loops, basic data types, string manipulation, some sort of data structure knowledge)
>art workflow of some kind (text stuff, 3d modeling, 2d art)
>game dev tool (how are things displayed, the pipeline for using assets, using scripted game logic, outputing and packaging a game together for distribution)

Most of the game creation part is entirely done depending on what tool you're using for gamedev. Enginedeving is a completely different skillset.

>the difference between scripting and programming is basically non existent
Scripting is just programming using a scripting langugae.

...

>Enginedev
that's the only fun part of making a game

Is this meant to be a joke?

Fuck I did. I hate if, then, else statements in Lua. It like doesn't use brackets for some reason so you have to use then and end for if statements.

It should be

for i=100,1,-1 do
s = ""
if(i % 3 == 0)
then
s = s .. "fizz"
elseif(i % 5 == 0)
then
s = s .. "buzz"
else
s = i
end
print(s)
end

for(i = 100, i < 1, i-- )
{
s = "";
if(i % 3 == 0)
{
s = s + "fizz";
}
else if(i % 5 == 0)
{
s = s + "buzz";
}
else
{
s = s + i;
}
print(s);
}
}


is so much more sane.

none of these describe a script. God help whoever wrote that garbage.

Your intendation makes me cringe

Messed up brackets this time.

Just fucking end me already for not reading my code before posting for the third time. The only reason the first one was syntacticly correct was because I actually ran it.

both of those are wrong. "fizzbuzz" is never printed when i is divisible by 3 and 5.

Anons who actually enjoy programming, how do you decide what projects to do next? What do you do to "practice" coding?

Alright, thanks for the answers.

I think of something that sounds fun to make and I make it.

Whatever will piss off the largest number of corporations I hate, that's what I'm gonna choose for my next project.

>how do you decide what projects to do next?
I randomly get some ideas for shit I want to do and that might be useful to me, and I do some of them.

i mean i'm a new programmer but i just do what seems feasible giving my competency and what interests me. someone told me pick projects that seem harder then what you can do because that's the easiest way to learn. so my next project might actually be difficult.

Yeah thats also true.

It should continue the first if check or be separated into two if checks. I didn't compile that at all but I know why it doesn't work, its exiting the if check at fizz when it needs to be fizzbuzz.

Honestly though rewriting it because I checked for i % 5 twice isn't something I'd do anyways because the first code example was so much more clear. Writing code thats as short as possible and grouping as many checks together in the smallest amount of space possible is for faggots.

I'd rather have the code do three checks for three checks separated into three clear blocks of code than be cute and do two checks for three checks using as many shorthand operators as possible because you have some sort of autistic need to write everything in as little lines of code as possible.

I'm also a shit programmer though so my opinion basically means nothing.

What language?

Could be worse. Brendan Eich could have invented PHP instead of JavaScript.

I either take something that bothers me and try to do it better than the existing solutions (if any exists), or teach myself some advanced techniques by writing toy programs that illustrate the techniques.