/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Old thread:

Attached: iyuiw062b1s11.png (500x656, 159K)

Other urls found in this thread:

cppquiz.org
jetbrains.com/clion/
twitter.com/NSFWRedditImage

while(1) {
printf("Thanks for not using an anime image!\n");
}

Employed Haskell programmer reporting in

Attached: 1483073157801.jpg (1280x720, 110K)

for (;;)
{
puts("Your style sucks.");
}

give me your job

Attached: Dp-R90zWkAA0oe_.jpg (1200x675, 67K)

>relying on undefined behavior

Attached: Screenshot from 2018-10-26 02-57-21.png (3840x2160, 637K)

Infinite loops are not undefined behavior if there are side effects.

What programs do you use?

ok, can someone tell me what's the best FP lang?

Attached: kaguya_luna.jpg (1036x1450, 222K)

JavaScript

Haskeru

Erlang. All other FP langs are useless.

I learned COBOL, got a job and I’m not 60 years old.

added refresh, it would be cool to have each post identified and separated for easier reading but i don't know how to do that

import requests, bs4, sys
url = input('')
def obj():
get = requests.get(url)
chansoup = bs4.BeautifulSoup(get.text, "lxml")
for postMessage in chansoup.find_all('blockquote', attrs={'class': 'postMessage'}):
print(postMessage.text)
def obj2():
refresh=input('[r]efresh')
if refresh == 'r':
obj()
obj2()

obj()
obj2()

>useful
>best FP lang
pick one

Post any good/fun warez you have made. I'll use it.

Attached: 1539313518762.jpg (801x1200, 119K)

Congratulations on your soul-destroying 40 year old bizapp maintenance career I guess.

I'm checking the language out and to me as a complete novice it just looks like Matlab.

Rust is amazing

Attached: 1526840387974.png (810x1150, 795K)

I cracked a video game in the late 1990s
The crack is still floating around but I cannot post out of fear of getting doxed
It was as simple as replacing JE with JNE, literally 1 byte

>be in coding interview
>Have you heard of fizzbuzz?
Have you ever wondered what happens if you say "no"?
Maybe you think the interviewer is dumb and simply give you the easy retard test because you didn't memorize the answer yet.

If they ask you this in the coding interview, answering "no" means you are so ill-prepared for the interview that you haven't even caught up on the most piss basic interview question circa 2008.
This makes you look like a terrible applicant even if you did complete it successfully.

Attached: akira-kogami-2853.jpg (300x450, 28K)

>JE
>JNE
?

I'll have one Burger and a Coke.

x86 instruction
jump-equal/notequal

Ah, k.

The money is pretty good and it pretty much guaranteed me a job out of Uni. I’ll probably do something else one day. Everyone I work with is literally every boomer programmer stereotype you can think of

Thanks, you too!

Attached: dancing-ferris.gif (734x490, 258K)

Employed C++ programmer here

Attached: image (4).png (764x1200, 371K)

Nice can you solve these cppquiz.org

finally made a thread huh foosetsu

>he doesn't have a macro for booleans

Attached: off-with-their-heads!.png (564x420, 97K)

For what purpose?

Am I a programmer now?

Attached: whoa that was hard.png (1067x462, 52K)

So you can write the four letters TRUE instead of 1.

Attached: 11yJf1qdz93w.gif (200x200, 623K)

a REAL programmer would reverse engineer their unit tests

what is a good editor on linux for c++ with code completion?
please no autism

Attached: 1533166894224.png (640x703, 452K)

dpt :: IO ()
dpt = putStrLn "Thanks for not using an anime image!" >> dpt

dumb frogposter

kill yourself

>please no autism
VS Code, you just install the official C++ addon in 2 clicks and you're good to go

I use VS Code with Intellisense. Sometimes shits the bed when including LLVM but it's still alright.

Now THAT's what I call podraising.

very mean desu

>kaguya_luna.jpg
is this bait? thats kizuna ai

jetbrains.com/clion/

Should i learn Python?
Is it good for a beginner?

Attached: 0296c360.jpg (544x638, 33K)

>he doesn't include stdbool.h

No
No
learn Haskell

>paying
where do you think you are

No
Yes
But learn Nim

It's not a good language and it's definitely not for beginners.

C instead will do

What exactly is data driven design?

when the data structures are from resources external to the code. for example, a game engine built to load the entities, items, levels, ... from xml or json files.

fpbp
For once

Is C# good?

Na.
I'd recommend a strongly typed language like Java or C++. Don't be intimidated, just be patient.

Ok, thanks for the advice.

For some applications it is not desirable, such as pic related.

Attached: 1514326798688.jpg (600x450, 40K)

So it was you

Just how hard is it to convince the compiler a certain code path won't be reached?
#include

int func(int x){
int dummy;
if (!(x == 0 || x == 1))
__builtin_unreachable();
if (!(x == 0 || x == 1))
return 4;
switch (x)
{
case 1:
case 0:
break;
default:
__builtin_unreachable();
dummy = *(int*) NULL;
dummy += 1/0;
return dummy;
}
return x*x*x*x*x*x*x;
}

What the hell do you want?

Python is strongly typed too you fucking fool.

I wish we could somehow ban anyone with either less than 1 year of uni experience or 3 years of work experience from posting on /dpt/. They add literally nothing to the discussion except noise.

>C++
>strongly typed

Meant to say statically typed.
I bet that autism is great at parties.

You seem frustrated. Are you getting laid?

>Tries to give a stupid fucking opinion
>Fucks up and instead gives a stupid AND incorrect opinion
>When corrected, presses on and tries to insult the person correcting him
As I said, people like you are trash and should not be allowed to post here. You ruin the discussion for everyone else. I barely even come here nowadays because it's always the same cesspit of the blind trying to lead the blind + obvious bait that everyone still falls for somehow.

Fuck off and never post here again.

see

Do you wanna talk about what's going on, buddy?

How is his opinion incorrect? I wish we could ban spergs like yourself who can't communicate without pronouncing to the world how immature they are.

He really likes Python.

More noise. Your bait is shit.

There's nothing to talk about. You people are ruining /dpt/ (Jow Forums in general). The problem is that the culture of lurk before posting is dead and every dumb shit thinks they have a right to be heard even when they're posting factually incorrect trash.

Fuck off.

>going through old Z80 source code
>70% or more of every program is ld instructions moving data around

I guess move really is Turing complete all on its own

Lisp is the most powerful programming language.

>The problem is that the culture of lurk before posting is dead and every dumb shit thinks they have a right to be heard even when they're posting factually incorrect trash.
I can smell the underage from here. You're not fooling anyone.

Attached: 1535095095978.jpg (300x295, 24K)

__builtin_assume(some_condition_to_assume_always_true); in clang

I get it, man. Malaysian typewriter forums are serious business.

>How is his opinion incorrect?
C++ is a terrible language, doubly so in 2018 where it's unbearably bloated, triply so as the first language for someone trying to learn how to program. This is the stupid part of his opinion.
Python is strongly typed, C++ isn't. This is the incorrect part of his opinion.

Calling me underage and posting that image doesn't invalidate any of what I'm saying. I realise that you probably haven't been on Jow Forums for long enough to have actually experienced what I'm talking about, but people did actually try (to some extent) to understand what they were talking about before posting (because otherwise they'd be made fun of).

>C++ is a terrible language, doubly so in 2018 where it's unbearably bloated, triply so as the first language for someone trying to learn how to program. This is the stupid part of his opinion.
What's a better language?

This is one of the saddest posts I've read in awhile.

Attached: y8Ea8jB.gif (480x358, 1.14M)

I'm still waiting for that user to post his Hangman/Tower of Hanoi code.

yes. it's really terse and simple to write. really good language for anything apart from performance-critical tasks (because its slower than a grandma with a broken hip crossing the road) and good for beginners because due to its simplicity and intuitiveness you can focus on learning programming concepts rather than wrestling with the quirks of the language
if you want to program professionally you're better off moving onto another language when you have the basics of programming down but for a hobbyist its perfect

As a first language? Scheme, ML, Java (no really).

you need something in the middle of for,it basically becomes a while loop.

Hey Jow Forums, in Python, what's the best way to wrangle with data in lists of dicts with lists of dicts in them?
Right now, I've got something retarded like:
for prospective in input_data:
if any(entry["title"] == prospective["title"] for entry in masterlist):
for entry in masterlist:
if entry["title"] == prospective["title"]:
entry["locations"] += [{"path":exepath, "ip":prospective["ip"]}]
else:
masterlist.append({"title" : prospective["title"], "locations" : [{"path":exepath, "ip":prospect["ip"]}]})

where I'm basically just trying to incorporate input_data into masterlist while checking if a title already exists so I don't duplicate an entry. I know there has to be a better way to go from checking if a record exists to editing said record if found.
I thought about.
for prospective in input_data:
flag = False
for entry in masterlist:
if entry["title"] == prospective["title"]
flag = True
modify_entry()
if flag == False:
create_new_entry()

But setting and resetting a flag just feels so boomer. Or should I just quit fucking around and define some classes?

It supports __builtin_unreachable too.

Attached: compilers ain't shit but hoes and tricks.png (1356x567, 86K)

Two mostly useless languages and a third that is comparable to C++ with a garbage collector.
I was just checking if you actually knew what you were talking about, which you clearly don't. Good day.

Pretty much any other, honestly. C++ is probably the worst living language (= in mainstream use) in the world right now.

So far your replies to my posts have been:
>You're a virgin
>You're a sperg
>You're underage
>You're sad
Do you notice the pattern of trying to attack my character/traits instead of trying to argue against what I'm saying? You argue like a spoilt brat who can't handle being called out for his bad behaviour - and this is exactly what you are. You are behaving badly and ruining the thread for other posters, but you think the world revolves around you and so make us put up with it despite us not having any obligation to do so. Your father should've hit you more often when you were younger.

>Java is C++ with a GC
>You don't know what you're talking about
lmao

Arguing with strangers on the Internet won't get you laid. Have fun jerking off tonight; you can think of me when you do.

Attached: 1535501481798.jpg (480x360, 26K)

You would have a point if you weren't also so obviously incel.

Come for the security promises, stay for traits, enums and crustaceans

Since the product at my new job is written in a horrible mix of c and c++ and ive nearly only written c#, whats the best way to get into c++?
Any sites or books youd strongly recommend?

It's a good language if you want to jump right into doing things, less so if you want to teach yourself CS fundamentals. It has a very simple syntax, most everything justwerkz how you'd expect it to syntactically, there's a huge standard libraryl, and a vast multitude of other packages that are just a pip install away. My opinion is this is exactly the sort of thing beginners should start with, but lots of anons just can't help sperging out about how you need to learn lambda calculus before writing your Jow Forums shitpost generator.

it works if you tell the compiler to assume x*x==x but that feels a bit dumb, it should be able to conclude (x*x==x) from (x==1 || x==0) imo

Maybe
Yes

You will also hate it after its taught you enough that you feel comfortable learning Java, or C#. But that's good, learn it and then learn a better language then never use it again.

Because 1 and 0 graphically mimic what is being represented?

Writing a script to do my crypto taxes. Damn you HMRC.

>cashing out
lmfao

what are you working on?

I understand why this is considered better and I still hate it.

Even if you trade between alts it's a taxable event.