/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1523366112141.jpg (1450x975, 523K)

Other urls found in this thread:

automatetheboringstuff.com/
twitter.com/NSFWRedditVideo

>includes in a separate directory
Nope.

Behold, the power of C++!
#include


template
struct List;

template
struct List
{
constexpr static
unsigned size = 1 + List::size;

using Head = T;
using Tail = List;
};

template
struct List
{
constexpr static
unsigned size = 0;
};

template
auto consHelper(List)
{
return List{};
}

template
using Cons = decltype(consHelper(L{}));


template
auto mapHelper(List = {})
{
return List{};
}

template
auto mapHelper(List = {})
{
return Cons<
typename Fn::template Template,
decltype(mapHelper())
>{};
}

template
using Map = decltype(mapHelper(L{}));

struct AddPtr
{
template
using Template = T*;
};

using PtrList = Map;

void f(PtrList)
{}


template
auto filterHelper(List = {})
{
return List{};
}

template
auto filterHelper(List = {})
{
return std::conditional_t<
Fn::template Template,
Cons,
decltype(filterHelper())
>{};
}

template
using Filter = decltype(filterHelper(L{}));

struct IsInteger
{
template
constexpr static
bool Template = std::is_integral_v;
};

using IntegerList = Filter;

void f(IntegerList)
{}

>POO programmer
>shitty wall of text image macro
>non-anime OP for /dpt/
Ban OOP from /dpt/

Attached: 1476111082775.jpg (540x652, 46K)

template
auto foldHelper(List = {})
{
return Init{};
}

template
auto foldHelper(List = {})
{
return (typename Fn::template Template<
T,
decltype(foldHelper())
>){};
}

template
using Fold = decltype(foldHelper(L{}));

struct Biggest
{
template
using Template = std::conditional_t<
(sizeof(T) > sizeof(U)),
T,
U
>;
};

using BiggestElem = Fold;

void f(BiggestElem)
{}


struct Id
{
template
using Template = T;
};

struct ComposeTwo
{
template
struct TemplateHelper
{
template
using Template = typename Y::template Template<
typename X::template Template
>;
};

template
using Template = TemplateHelper;

};

template
using Compose = Fold<
ComposeTwo,
Id,
L
>;

struct AddConst
{
template
using Template = T const;
};

using PPP = Compose;
void f(PPP::template Template)
{}

>Yeah I was working with them the last year. They were a start up and doing a lot of interesting work with web data related to the work involved with your company
>Ok cool, and how much you were getting paid?
>...

Attached: wojak.jpg (1600x900, 53K)

What are you trying to achieve?

learn Haskell

Attached: karen haskell.png (1280x719, 818K)

Why is he using self for LineEdit and is not using self for Label?

Attached: file.png (596x841, 96K)

where do you braindead haskell NPCs get the idea that functional programming is a worthwhile pursuit? who implanted the idea into your head?

>NPC calling PCs NPCs

Attached: 1520096169694.jpg (1024x768, 286K)

what, can't you tell?

because those objects aren't bound to self, they're bound to sub-members of self used the 'setBuddy' function apparently

>shitty meme paradigm gets BTFO
>have a meltdown in public

Attached: thumb.png (800x450, 359K)

>someone posting anime girls reading the Jow Forums meme book isn't an NPC

yeah I don't know why these OOP codelets even bother desu

Attached: 1488646807083.png (2015x2204, 704K)

No, too much template fuckery to read through the boilerplate.

I have defined map, filter and fold "functions" over types in the form of templates.
Because C++ does not have template templates/HKTs, I need to use templates nested inside types in order to pass type functions into templates.
I have also defined function composition where the each type in a list of types contains a nested template. Those templates are composed together to return the composed type function.

Truly, C++ is the most powerful programming language.

I'm working on surgically adding features to my company's hand rolled equivalent of make which consists of a jumbled mess of python, powershell and unreadable batch scripts.

Every Haskell / functional freak I've met is so high on adderall, a comment line this would send them to fucking outer space with the place of their rapid explanations and justifications.

... something tells me you knew that, too.

Haskell programmer here
300k starting

Attached: 1421165446325.jpg (1280x720, 48K)

I imagine everybody with a three-digit IQ seems like that to you.

defmodule Test do
def hello do
IO.puts "hello world"
end
end

Entry level gopher here
400k starting

>do ... end
Not even bash is so awful

I make 11enty billion dollars writing scripts.

>all this effort to achieve basic functionality
Sepples really is awful.

bash

anyone need a collaborator for any interesting opensoruce projects (interesting is the keyword here), (You) me

languages: c, sepples, c#, java, js, python, perl, php, ruby, sh

Wow, not a single good language is in that list.

I can pick up any language in seconds, but I bet you ain't got any good ideas do ya mr. soiboi hipster man?

Wow, not a single intelligent thought is in that post.

So it's like a good language but shit?

heh, I expected that answer. Jow Forumstards who jizz themselves writing fizzbuzz in l33tcode are usually devoid of any sense of imagination or productivity

I'm so good at programming that it hurts

Attached: 1421164417027.png (714x738, 342K)

Simply epic

Competitive programming is for people who are uncompetitive in the job market.

They're called OOPsies these days

Name 1(one) mainstream language which allows you to do this + example code.

competitive programming is a fucking meme, I wasted so much precious time over it when I could have been doing projects and building my portfolio.

I advise everyone here to stay away from it, the effort required to reach a high level is insane while the returns are miniscule. I reached master on codeforces by grinding algorithms 24x7 and I have got nothing to show for it except a declining graph on my profile. most employers I went to don't really give a shit about it either.

if I had to describe it, it was like one of those addictive F2P chink grindfest games but without the positive feelings you get from accomplishing stuff in those games

Sorry for being newfag
I am currently learning C in my class. I still don't really know why pointers are used so I wonder why my teacher used pointer to assign strings in this case:

const char *t1 = "Hello";
const char t2[] = "Hello";

Strings in C are char pointers.

>competitive programming
how dumb do you have to be
>grinding algorithms 24x7
lmao

where?

how else are you getting into google?

their interviews always ask those problems

Should I get hard copies of SICP and HtDP?

how about building real skill instead of writing variations of fizzbuzz

>*tweaks question slightly*
>all your rote grinding is now useless

based and redpilled

An array is basically the same as a pointer, he was probably just trying to show you that. Also what the other guy said, strings in C are char pointers.

Ah, thanks alot

Hello, I have a question: Have two large groups of data in a cvs/.xlxs file, both are formatted slightly differently and I want to make graphs from the data within each group of data.

What is the most useful/easiest way to do this, and if I have to learn a programming language for it, which would be best? I'd like to generate charts as bitmap images too.

What's wrong with using Excel to generate the charts?

I could put it more succinctly actually: What is the best programming language to learn for sorting through large .csv files and generating graphs as bitmap images?

I could, but it's literally hundreds of graphs.

Python with numpy/pandas and matplot lib would probably be the easiest
The excel library for python is pretty good I found though its better if you have them all in csv

Thankyou very much. I should add though, I've never really actually written any code before, would you recommend any learning resources?

Oh boy. Automate the Boring Stuff by Al Sweigart is really good and what I used to get into coding.
Whole book online here
automatetheboringstuff.com/

Then if you need help with Pythons data resources, pic related is really good

Attached: Python-for-data-analysis.png (300x300, 35K)

Lads it feels like the shitlangs are winning

Sandwhich artists make that much?

Amazing. This looks like *exactly* the kind of thing I'm looking for. Thanks again.

>how else are you getting into google?
By cutting off my dick

The name of the game in OO language design these days is to copy FP features but dumb them down and cripple them. OO itself is stagnating because it has run its course and has nothing to offer.

first class functions isn't exactly rocket science

I can't imagine doing large projects in anything but OOP

Then you need to broaden your imagination.

OO will never lose to functionfriends because OO represents reality

you've been institutionalised

Attached: 1489270803974.png (1052x1342, 769K)

There is a reason why it became popular, not even recently but almost 30 years ago.
You can't even make a sega genesis game and not beg for having objects

How to increase one's programming productivity? What project management method is useful?

Attached: carl_jung.jpg (213x320, 11K)

Don't bother trying to argue with the autists
>FP left, OOP right

Attached: 1536509160125.jpg (750x750, 103K)

use as little extraneous shit as possible

List what needs to be done then do it

Don't give the FPtards what they want, stop confirming their false dichotomy with OOP, they are not opposites, they aren't even related

>OO represents reality
Imagine being this fucking delusional

Put your smartphone in a different room
Unplug your ethernet cable, and give it to your mom
Check yourself for sleep apnea and/or low testosterone and/or nutritional problems

t. cowardly centrist

If you only understand OOP, perhaps

Reminder that OOPsies don't even understand FP, so their views on it are worthless.

Attached: Mad-Men-Quotes-2.jpg (490x554, 36K)

centerist implies you're in the middle. they aren't opposites. Functional programming languages stand in opposition to imperative programming languages, some of which have no OOP features at all.

>People who drive cars can't even ride horses

>functionvirgin is mad objectCHADs steal all his shit and then make fun of him

i'd vent my rage on taiwanese comicbook boards too if I was you

>OOPsies don't think
Figures.

Anyone aware of a forum platform that provides a feed for new posts?

>ex. Oh yeah, VBulletin had an RSS feed by default that's published at ...

Haskell is the finest imperative language around today. Stop your shenanigans, OOPsie.

You're confused, functional shit ran its course back in the 80's and then died and was forgotten for a reason (LISP was like the third most used language back then). You're obviously too new to remember though.

Haskell isn't imperative because computers don't work the way haskell works

Haskell doesn't work.

This is hilariously wrong. All that happened is industry went chasing fads. It's coming back to FP these days, kicking and screaming. FP has been a constant force in academia. Not that you'd know that, of course.

If Haskell isn't imperative then why can I write imperative code in it?

You mean it doesn't work when you write it.

10 OOPsies = 1 FP boi

>calls me hilariously wrong
>goes on to write delusional fanfiction
No one's "coming back", kid.

>academia
lmao
academia is on it's last legs, it can't get by teaching practical skills anymore because you can learn them on your own through the internet, so now they're teaching pretentious shit like haskell

>it's not happening!
>Facebook using Haskell doesn't count!
>nor do all the other companies using FP!

>Facebook using Haskell
appeal to authority fallacy

Careful with that chip on your shoulder.

He's 100% right though

that's my own pet theory anyway, I'm trying to understand where all these FPtards are coming from

Hardly. It's simply a data point, albeit one you'll have difficulty claiming is a tiny irrelevant company.

Writing spaghetti code is a practical skill these days? How times have changed.