Daily Programming Thread

This is /dpt/, the best subreddit of Sup Forums

Pair programming edition.

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

/!\ ** Read this before asking questions ** /!\

mattgemmell.com/what-have-you-tried/
catb.org/~esr/faqs/smart-questions.html


What are you working on?

Other urls found in this thread:

youtube.com/watch?v=rWDNwN0h0LM
youtube.com/watch?v=rkcXRBhYZHU
youtube.com/watch?v=MZIv6WtSF9I
youtube.com/watch?v=qFl-Q21MzmQ
youtube.com/watch?v=1CpjRMICXNM
youtube.com/watch?v=IIAWs3_Hgtc
movio.co/en/blog/migrate-Scala-to-Go/
jimplush.com/talk/2015/12/19/moving-a-team-from-scala-to-golang/
members.nfc-forum.org/apps/group_public/download.php/18688/NFCForum-AD-BTSSP_1_1.pdf
youtube.com/watch?v=3U3lV5VPmOU
benchmarksgame.alioth.debian.org/u64q/cpp.html
twitter.com/NSFWRedditGif

>muh lambdas
>muh monads
>muh higher kinded types
>muh generics

>Hating on lambdas
>Hating on generics

>Shitkell
into the trash it goes

>muh generics

>Anime
Hi.
Go to hell.

Is Nock good for anything?

>C++
youtube.com/watch?v=rWDNwN0h0LM

>python
youtube.com/watch?v=rkcXRBhYZHU


>C++
youtube.com/watch?v=MZIv6WtSF9I

>python
youtube.com/watch?v=qFl-Q21MzmQ


>C++
youtube.com/watch?v=1CpjRMICXNM

>python
youtube.com/watch?v=IIAWs3_Hgtc

>C++ fag getting insecure over python
Times must be really hard

> Using traits for the first time in rust be like holy shit inheritance never again

>Literally just like Java interfaces and abstract C++ methods

What is the language of the future?
Go
or
Rust
???

C++

Rust

>C++ fags having to fly out of nowhere to stay relevant
Times must be hard. I mean it never even could compete with C with all those bells and whistles how can they compete now?

No.

But neither of those are functional languages.

Normal thread:

pls respond

>comment is 90% youtube links

kys

...

kek

i doubt we will have a language to rule them all like c or java were, especially now that the available tools allows anyone to build his own programming language without too much difficulties.

What do you guys think of Scala? It seems pretty mature by now, being tied for 11th most used language in the Redmonk rankings and a large number of big libraries like Akka and Spark. It can compile to the JVM, to LLVM, or to JS. It's big enough that I see jobs in it pop up even in the backwater where I'm from.

It looks like something I should work on learning. It has a nice balance between monads and employabillity.

movio.co/en/blog/migrate-Scala-to-Go/
jimplush.com/talk/2015/12/19/moving-a-team-from-scala-to-golang/

>available tools allows anyone to build his own programming language
retarded or just trolling?

Scala is so 2010.
Use F# for that matter.

>a language to rule them all like c or java
>A language
>Lists two languages that still exist and are widely used

c ruled from the end of 70's to 95
java ruled from 95 to now (thanks to the android platform)

have you seen how many usable programming languages have flourished these last 10 years?

>tfw you will never be one of the few people that created really ground breaking algorithms over 20 years ago

Should I learn C++

new technology need new algorithms. today hot waters are AI, Enhanced/Virtual reality, Computer vision

Better question: can you?

Write a function to determine the number of dimensions of a given array
dim(["lka", "chu"]) == 2 //char[][]
dim([]) == 0
dim(['s', 'q']) == 1 //char[]
dim([[21, 22], [387]]) == 2 //int[][]


How will C tards ever recover? Let's find out :^)

Anyone here who did Bluetooth pairing with NFC before?
I am somewhat confused in how to set it up.
I have a TI CC2541 for the Bluetooth part and in the pairing I don't want to have to do traditional BLE handshaking.

I found this document describing the idea.
members.nfc-forum.org/apps/group_public/download.php/18688/NFCForum-AD-BTSSP_1_1.pdf

I'm confused as to how the NFC and Bluetooth part work together.

>/dpt/ being a measure of what's relevant
enjoy your reddit-tier circlejerk

>determine the number of dimensions of a given array
Why would you need such a function? Great example for a problem no on ehas ever encountered in the real world.

who are you quoting?

Those empty square brackets look like the Unicode missing character symbol.

>:^)

>chilling in javascript

typeof NaN
it's 'number'

not gonna lie, xded here for a bit

I don't care much about how new something is. I care about whether it is good enough to build stuff with, and whether it can get me a job.

Reminder that if you can use a language to implement (a -> a) more than one way then it's trash.

NaN has a definition in IEEE 754

NaN has always been a float.

Since float is the only numerical type is JavaScript they just call it number.

>big libraries like Akka and Spark
Both of those libraries are absolute garbage.

>a nice balance between monads and employabillity
It's a toy language. The moment you want to do anything non-trivial with monads you end up overflowing the stack, so you have to trampoline everything, resulting in a massive performance penalty.

Yes, I imagine if your team is full of retards then they'll prefer to use a language designed for retards.

Daily reminder that strictly typed languages are legacy garbage that does nothing but slow down development time and needlessly increase comlexity

Is there ever a reason to have a static method with the same signature in a derived class?

Ruby

Remember this whenever you're writing Go. It's a language designed for people who aren't good enough to use other languages.

youtube.com/watch?v=3U3lV5VPmOU

I learned that other languages do not allow you to recast things as different types, literally cucking you out of neat features like type punning and type generics.

How do people deal with this shit?
Why would you willing use a language that enforces it's "best practices" on you?

>literally made for retarded codemonkeys
I like how gofags always ignore this

Because that's the whole point of having types at all?

Neither.

It's C++ and LISP

types are just a compiler directive so it can know how to deal with pointer arithmetic and struct member names.

If you can view an A as a B, then prove it by providing a function from A to B.

Is c faster for algorithms and easier to learn than c++?

Oh and, operator overloading for arithmetic between different types of numeric representations, such as int to float, or struct assignment, etc.

No they aren't.

>Is c faster for algorithms
Kinda

>easier to learn than c++?
Definitely.

where can I get a loli like that that will watch over me?

>""generics""
What is a "Generic"?
>Why would you willing use a language that enforces it's "best practices" on you?
How can my own language enforce its "best practices" on me? That doesn't make any sense.

little sisters are a meme

>>Is c faster for algorithms
>Kinda
Dangerously wrong. Go might be a better language for your skill level.

>arithmetic between different types of numeric representations
Fuck off.

t. underage retard

C is faster on average especially compared to idiomatic modern C++

∀ a b : Type, a -> b

Wrong.

You are dumber than the average user especially if compared to smarter anons

mmk

>benchmarksgame.alioth.debian.org/u64q/cpp.html

Who said anything about using idiomatic modern C++?

It's faster and safer than classic C++.

Can you implement it?

Who said anything about using classic C++?

what if i told you those c programs are also c++ programs

>he writes C with classes
>he thinks he writes C++

what if i told you those C++ programs could also be printed and used as toilet paper?

do you mean something like this?
B AtoB (A a)
{
return a;
}

also, the c++ regex uses boost while the c one uses pcre. it's more a test about boost vs pcre than c++ vs c.

f : ∀ a b : Type, a -> b
f = f

Congrats on your inconsistent language.

I'm derping around with quantum search algorithms.

Fun fact: a quantum computer can do binary search in log_3(N) operations instead of log_2(N) operations.

Oh, and if you haden't heard about that already, quantum computers can search for a given element in an unordered array in O(sqrt(N)) operations instead of O(N).

I just found an algorithm to find the median of an array in O(sqrt(n) log(n)) operations.

That's not written in my language though.

I've started learning C++ recently, and made a space invaders.
But could someone explain something to me?

Why is it, that my program shows glitches and segfaults due to an (unrelated?) memory leak on Linux, but shows no such behaviour on Windows?

Congrats on using an inconsistent language, then. I suggest you apologize to your mother, considering what day it is today.

>Anime
Hi.
Go to hell.

You're probably overwriting your null terminators or something and writing past the end of the array.

Are you initializing your arrays and variables?
Because C++ doesn't do it for you.

linux is shit, more news at 11

Because you wrote it in C++ and not Idris.

If you don't like anime, why are you here?

Russian.

run it with valgrind

>Congrats on using an inconsistent language
I wouldn't use such a language. I'm not interested in something which can prove any proposition.

POST CODE
post code
POST code
post CODE

90210

Every object that needed to be declared either gets created in a constructor or set as NULL there.
I don't initialize my vectors or base types.
Finding and fixing the memory leaks removes any trace of glitches.

It took me half an hour to set it up on Linux, took me half a day on Windows.
Not to forget the shit I had to undefine because some compiler shit fucked with a "createWindow" function I wrote.

Can't really get the hang of Valgrind, most things it finds are leaks in the SDL library I'm using.

Don't have any problems right now, and the leaks came from unrelated objects. It just made me wonder.

>Can't really get the hang of Valgrind, most things it finds are leaks in the SDL library I'm using.
Yes. That's fucking annoying.