/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

docs.oracle.com/javase/tutorial/
stackoverflow.com/questions/32781937/getting-a-single-character-without-pressing-enter
youtube.com/watch?v=PeXEWsobJRE
youtube.com/watch?v=vw9zyxm860Q
twitter.com/NSFWRedditImage

First for Javascript

First for C AND Lisp

& or &&?

&&&!

haha you memester :33!

C, C++ and OCaml are the only white man's languages.

So functional fags, can you sell me Idris? Why would I need theorem proving facilities in a general purpose language and in general why should I learn it?

I have a lot of free time lately so I may try to learn it

LOL

OCaml is for faggots

>I have a lot of free time lately so I may try to learn it
Well you're gonna need it because thanks to all the retarded abstractions you probably spend more time compiling than writing your programs. If you want to prove theorems relatives to your code, use Coq or Isabelle and export to a saner language.

:3

Really wanna get into learning the meme-language.

Trying to come up with ideas for suitable projects is hard though. The same issue I usually have with C++.

Theorem proving is how you verify that a program meets a specification. Dependent types let you write very expressive specifications.

Posted this in last thread not too long ago:

Anyone able to help me with my Java program? It's shitty but due in soon and all I have to do is implement a betting system.

I can send you the folder of everything you need to have a look at it through email.

Thanks in advance

Can you explain dependent types to someone having just a basic grasp of Haskell?

...

(1

post a link to the files and your problem. I'll take a look

True

Friendly reminder that Rust is for straight white level-headed men.

>straight
>posts animu

Hi
I'm new to programming
What should I learn ?

It's a female, just in 2 dimensions which makes it better.

>straight
>white
You mean bisexual. That's how you call white men who are attracted to women.

is the 1 in (1

Are you somehow implying that women are men? because I don't understand your post otherwise.

programming

If the left is signed, False.

basically a type dependent on a value. For example in Haskell you can say "this function takes in a list" but you can't say "this function takes in a list of length exactly 4." likewise you cant say "this function takes in an even number." of course you can get around that with custom types and smart constructors.

>What should I learn ?
To fucking kill yourself.

java and C++ are good

whatever you do, don't start with python or haskell

docs.oracle.com/javase/tutorial/

>java and C++ are good

Left one overflows, so false.

What is the most redpilled programming language?

Yes, I believe so by the standard. I went to check as well:
unsigned x = 0xFFFFFFFB;
int y = -5
cout

Meh, I guess I'll take a look

Hello new friend
You should start with Java, because then you can learn javascript (an extension of java) which is the most powerful language out there!

>unironically using greentext to quote someone

C, because you'll be forced to learn how some things in high level programming languages work. Then you could go C#, since it has C-like syntax, more modern than Java and evolving unlike Java.
Learn the basics, then go OOP.

*physical pain*

Why would you deliberately regress?

Anything OOP, because if you try it, you can't go back. xd

>regressing
Try writing maintainable game or database application with C.
You just don't

I was referring to "then go OOP".

If I can easily solve all SICP exercises am I MIT-level?

:^)

Since when is OOP regressive?

MIT is not some next step in human evolution

Always has been and always will be.

I'd suggest starting out with C. Make sure to learn about structs.

When you move to C++, think of it as being like C except you have "classes" which are basically structs except that the functions needed to operate on them are fields of them, functions that are fields of a class are passed a hidden "this" parameter that points to the instance they're to operate on, and fields can be "public" which is like you're used to or "private" which means they can only be accessed from the aforementioned field functions.

When you move to Java, think of it as being like C++, except everything is implicitly passed by pointer and you don't have to manually free anything.

>Since when is OOP regressive
>Try writing maintainable game or database application

Games should be written using the entity-component-system paradigm, not OOP. Database applications should be written in database languages, not OOP.

>move to Java
That would be a horrible mistake

Some light reading.

You will not divide us

Learn C. Once you understand C you can understand pretty much every other programming language easily.

>Games should be written using the entity-component-system paradigm
I prefer to just call it procedural.

us /= 2; // where is your god now

Exhausting the shit off my brain solving exercises on Haskell

(I'm new to programming, and i've just gotten into college of Science of Computing)

From last thread

>>D still can't read a single character input from stdin
>This is literally killing me inside out

>Just WHY

void main(string[] args)
{
import std.stdio : readf, writeln;
char c;
readf("%c\n", &c);
c.writeln;
}


or you can call into the C library if you want

But that's not what it is. It's not procedural, it's data-oriented. And it's not just data-oriented, it's the entity-component-system paradigm. Other data-oriented approaches don't tend to work as well.

That's not a single character input, that's a two-characters input, and one of them has to be a newline.

When will D be able to read a single-character input typed in without pressing Enter?

I meant OOP languages, f.e. C++, C#, Java.
However "database languages" like SQL can't be used to write any application. You still need some other language preferably, an OOP one like Java or C# with Entity Framework or equivalent.

ECS is very procedural. You split the data from the code and composition is your main method of reuse. Data-oriented design is something that lends itself well to ECS but it isn't necessary for it.

>g++ -O3 > 20MB
>g++ -Os > 12MB
>strip -S > 10MB
>upx -9 > 300KB
holy shit what is this wizerdry!?

>entity-component-system
>not OOP
that's a subset of OOP you dummy

Is there a language that can do that?

C

Post code

You have to press enter though

>its not oop its just data with methods bound to it!

char* str = "hello";
>assigning a string literal to a string gives a warning in C
defend this

const char*, not char*

try
*str = 'H';

you were warned

because they are immutable

True

void main(string[] args)
{
import std.stdio : readf, writeln;
import core.sys.posix.termios;
import core.sys.posix.unistd;
char c = 0;
termios oldt, newt;

tcgetattr(STDIN_FILENO, &oldt);
newt = oldt;

newt.c_lflag &= ~(ICANON);

tcsetattr(STDIN_FILENO, TCSANOW, &newt);

while(1)
{
readf("%c", &c);
if (c == '\n') break;
c.writeln;
}

tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
}


t. Stack Overflow

Got this book lying around for quite some time now.
Guess Ima start actually reading it. Only read a few pages of it til now.

>zed shaw
you got meme'd

Not this guy but you can achieve this by setting the terminal in non canonical mode. There is documentation around. That's how libraries like nurses are made.

>And it's not just data-oriented, it's the entity-component-system paradigm.
And it's not just the entity-component-system paradigm, it's Prince Herman in a can.

You should let him out.

std::cin.get()
get on my level.

stackoverflow.com/questions/32781937/getting-a-single-character-without-pressing-enter

That's not what he was asking for
Yeah, I figured it out

>where is your god now
I don't know, was God in the first half or the second half?

>Yeah, I figured it out
Congrats!

In none, because he doesn't exist.

atheist nigger

Oxymoron
All blacks are inherently religious and religion is inherently black

HWNDU was such cringe lol

youtube.com/watch?v=PeXEWsobJRE

loooooooooool

Desert religions are inherently black*
The non-desert religions are fine.

JVM or CLR

OK then, Odin worship and Svetovid worship is not black.
But the desert trilogy (jew->christian->muslim) is blacker than KFC+purple drank+watermelon combo.

reminder that vundle is a piece of shit.

>poop or turds

better vid

youtube.com/watch?v=vw9zyxm860Q

my sides

This thread is about programming

poo in loo

JVM by far

microsoft is so fucking shit like you can't even imagine

c or c++ as a beginner?