/dpt/ - Daglig programmeringstråd

Hva jobber dere med, Sup Forums?

Gammelt tråd:

Other urls found in this thread:

no.wikipedia.org/wiki/Norske_dialekter
stackoverflow.com/questions/6264249/how-does-the-compilation-linking-process-work
twitter.com/NSFWRedditImage

Great spot for an asylum center.

even better for a refugee centre

...

*refugee camp

I don't understand why people want RAII so much. It helps you SO rarely during proper programming. If you're actually finding it useful you've got no memory management scheme going on. You don't do IO in a sensible way and you have unnecessary constructors/destructors everywhere.
Your code gets harder to read because only after you've read both destructor and constructor for every type you can see if they were trivial and unnecessary to read.

The only use I've had for C++ constructor+destructor is for profiling. I find it useful to just be able to inset an object at scope and have it automatically log whatever metric it was logging across the scope by having something akin to a start time in the constructor and an end time in the destructor and then just have the destructor write it out to my logging system (deferred or not). But it's such a minor thing.
>my compiler should inserts free() wherever the fuck
Why? It makes no sense to desire that. If anything this is an indication of what I said. You don't have a memory management system. You have the (sadly very typical) practice of allocating and freeing whatever whenever. It's an absolute mess.

Why are C++ programmers generally so shit? Even the ones that dislike the growth of the language aren't good programmers most of the time. This is probably the main reason why computers are slow. Other programmers in better high level languages work under the understandable assumption that the frameworks they use will make their programs fast. But if you shits can't even make these frameworks fast then those programs are fucking doomed.

Fuck you Norway, fuck you Bjarne.

Bjarne is Danish.

prover å skjonne hvordan jeg skal koble en byte stream fra fs2 tcp opp mot en messagepack scodec decoder og vice versa

Er litt å sette seg inn i, men etter å ha brukt det en del så må jeg innromme at jeg virkelig liker de funksjonelle bibliotekene til scala som fs2, scodec, cats etc

scalaz > cats?

Er mye det samma egentlig. Har vært mye krangel fordi cats har den jalla typelevel coc greia, men virker som om trenden i stor grad er at folk går over til cats.

Syns det er trist at de pusha den dumme coc'en men har egentlig ikke merka stort til det. Er bare masse svette nerder som contributer uansett

Forresten så langt jeg vet så har scalaz en del mer features enn cats, men jeg har alt jeg trenger fra cats, og rammeverk som doobie, fs2 o.l er mer cats orientert så vidt jeg har forstått det

Don't care. Hate him either way

Don't blame Norway for Denmark though.

what language is this?
it looks far superior to Rust

Asking the real questions here. Is Norwegian statically typed?

that's not saying much

I wish I could code webapps with C++. There. I said it.

No. You can have both ei kvinne and en kvinne in Norwegian. Literally "a woman (female)" and "a woman (male)".

I use scala js. Means I won't have to deal with the insanity that is js so I like it

webbläsarplugin som ska få lögnmedia på fall

So Norwegian is the closest language to Rust, then?

> a woman (male)

Hva med en som ignorere dumme froskpostere

Note, however, that you cannot have ei mann. Only en mann.

haha nä

I'm a beginner in c++.

This is test code from youtube that I cannot get working.

Attached is all the code and the error message.

After reading online i have found that the problem is that the the linker (i don't know what this is) failed to find the definition of external symbols (which are things like variable name, function name, class name or typdef.

Norwegian has huge variations in sociolect and dialects that is spoken.

Click "play" on the different ones under chapter "lydopptak av dialekter" here to hear the variations:

no.wikipedia.org/wiki/Norske_dialekter

They have two official types of norwegian written language.

You tell me if rust is spoken in variations and has two official syntax rulesets

...

this is bait

"En" is like a wildcard for any gender but "Ei" (is getting more nad more obscure) refers exclusively to female GRAMMATICAL gender

It's not bait i swear to linux

You need a main function if you want to compile to an executable.
The system needs to know where to start your program. You basically just defined a class and some member functions but never told the computer to actually do anything.

>(is getting more nad more obscure)
I bet the feminists would have a field day with that.

This means it lacks a main function. Probably means you are compiling it into an executable while you meant it as a library. Tweak your IDE's parameters, can't help you with that because I compile with actual build tools.

You can't use en in place of et.

i added a main

But does it work now?

You might want to look up some resources that teach you how the compile and link process of c++ works, this will help deciphering the error messages.

On a side note: Why aren't you dating a norwegian girl?

I tried to once. She talked a lot about how PHP was fast but I didn't let it bother me. Then it turned out she wasn't Norwegian at all. What a letdown.

Norway is full of cucks just like Sweden.

>rust is spoken in variations
Yes: nightly, beta, and stable.

>two official syntax rulesets
Yes: there's the language, and the CoC.

>Why aren't you dating a norwegian girl?
Jeg snakker ikke norsk.

Yes it works now. Hence the tanks.
Can you point me to a slim and fast resource?

As to your side note, I don't know where to find them I live in Canada.

>I live in Canada
I hear there's quite a lot of people with Scandinavian ancestry in Minnesota.

>CoC
>Syntax
ur dum

Syntax governs what you can write. A CoC governs what you can write.

What do I do once i've found them.
Do I show them my muscles or my linux?

Either your CoC or your Coq.

Sadly, the best I could come up with is this SO answer with no diagrams stackoverflow.com/questions/6264249/how-does-the-compilation-linking-process-work
But it might still help.

Parametric polymorphism does not imply dynamic typing.

Why is tabs vs spaces an argument?

I get the case for spaces(the one I'm familiar with at least), that is that since tabs are interpreted as different lengths by different editors it messes up formatting and readability. So spaces appear to make sense to me then, but a person argued to me that "why should I hit space 2 or 4 times every time I want to indent?".

Are there seriously people that use such shitty editors that are incapable of inserting/deleting/backspacing the correct amount of spaces when tab is pressed once?

What case if any is there left for tab then?

Does /dpt/ have a CoC?

Since everyone else in this thread is being a cuck, it looks like you don't have a main function. You should define main() in a third source file that instantiates a Fraction object and does operations on it. Otherwise you just have a library, not an executable file.

Had a good week. Convinced the CTO to tell HR to ignore all resumes containing Python or Go. I had crunched the numbers and found that hires who had previously used Python or Go always produced more bugs than those who hadn't.

No, all /dpt/ posters are women pretending to be men.

>Convinced the CTO to tell HR to ignore all resumes containing Python or Go.

so basically you're a retard?

good for you.

t. butthurt Python "engineer"

I am highlighting and reading it now.
It is well explained.
Do you yourself understand all of this?

I don't use python, but you're a fucking moron if you're filtering on literally irrelevant information.

comfy flag desu

It isn't irrelevant information, though. Did you miss the part where I ran the analysis and found that people we hired with Python/Go backgrounds produced more bugs?

>produced more bugs
In comparison to what?

In comparison to people we hired who didn't have Python/Go backgrounds, obviously.

yeah because you're such a professional statistician.

were the results even significant?

how do you know who had previous python experience?

Did you forget that correlation doesn't imply causation? There could be a hundreds of different things they have in common.

came into the office on the weekend to get away from downtown where I live (graduation at the Uni by me is today.)

I'm making some sbcl docker images and writing some automation to be able to us CL in a mesos cluster.

>yeah because you're such a professional statistician.
You know what they say about assumptions, user.

>were the results even significant?
Yes.

>how do you know who had previous python experience?
I looked at their resumes.

google uses go and python
What if you miss out on hiring a former google employee?

I won't care?

I don't think there's anything special about people who've worked at Google.

do you guys want to read a brief story? Google AdWords had an office down the street from us and we hired a guy from there once... he was... well i can tell ya if you want a laugh

Yes.

Google create Go to be as dumb-down as possible so their army of shitty coders could write programs without spending months learning how to do it properly. So yeah, there is nothing special about being yet another google employee.

Well yeah their likely years of networking experience and collaboration with top developers/hires doesn't really mean much in some situations

>top developers/hires
Yes, so good they can't be trusted with Java or C++, they have to make them use Go instead.

Tell us dead user.

we hired this dude after he left Google Adwords, we never really caught why but our boss liked the guy because he reminded him of himself when he was younger and more unbearable I guess.

this new guy sits across from me, and after 30 minutes says 'why don't you guys use rancher OS here--slashdot says it's really good' I sorta just brushed it off as some badly done ice-breaking that I expect from most people in the field. He didn't know anything about our processes yet at that point.

halfway through the day he leans back in his chair and belts out 'MEOW MEOW MEEEEEE-OOWWWWW' and the whole office almost collectively shits it's pants in fright. he then loudly explains 'OH SORRY, I HAVE TOURETTES THAT IS CHAIRMAN MEOW, ONE OF MY TICKS MY WIFE LOVES IT.'

we are all reeling quietly trying to digest this while our black coworker walks into the office. as he is setting up his laptop and stuff this guy starts making this incomprehensible screeching noise while roiling his arms against his chest in agony. our black coworker just stops dead in his tracks and gives all one of those 'oh hell nah' looks that they're really good at. the guy goes 'OH HELLO NICE TO MEET YOU, THATS MY GUITAR SOLO TICK IT HAPPENS A FEW TIMES A DAY' my coworker just goes 'hey there' and proceeds to put his laptop back in his back and leave without ever sitting down.


weeks go by of these outbursts (we had a client we had to let go because their VC dried up, this guy ended the call by MEOWING over the despondent CEO of the company while we brought his infrastructure down.) we couldn't bring him face to face with any customers given that he'd completely embarrass everyone personally and professionally.

the staff takes it upon themselves to research tourrettes and it's manifestations, and we all quickly realize this guy in no way has tourrettes, he's just a full on desperate for attention neurotic weiner.

1/2

2/2

he finally gets fired after I put him on a project to update a client running on python2.7 to python3.6. (I won't lie I gave it to him because I could sense he was generally incompetent but was having difficulty finding a way to prove this to my management in a way they'd be able to understand). customers site goes down for 6 hours and we find him alone in the office in tears. I add brackets around a handful of print statements and add encoding methods to a few lines and bring the site back up. next day the boss comes in and tells him to pack his shit.

as he's leaving--pterodactyl scream at jet engine decibles. echoes down the halls and sometimes i can still hear it reverberating in the pipes in the ceiling.

>i can still hear it reverberating in the pipes in the ceiling.
Stopped reading there.

>Do you yourself understand all of this?
To an extend. If you have questions, ask away.

(I don't have a north korean girl ._.)

ROFL thanks user.

TL;DR LESSON: Google is a really big company only a small sub-sect (google X) does anything remotely cool. the rest is full of people like that guy, who was by far the biggest case for euthanasia I've ever met

The guy you describe is a bit of a special case but ultimately I don't expect most Google devs are that much different to most devs at other tech companies.

Anyway, good story, definitely made me cringe. Thanks user.

I really really like this story

yeah he was definitely on the extreme end. the rest of the people in that adwords building were varying shades of semi-retard to seemingly-normal.

I'm sure the good folks who made CoreOS are all nice down to earth people.

Can i save it?

Is it guaranteed to be safe to call realloc() on pointers to memory returned by malloc()?

Yes.

yeah of course! I wanna tell you guys his name really bad but that'd be fucked up. He tried to add me on linkedin a while ago and I noticed he'd had like 6 jobs in the year that had gone by since he left. he's currently a 'technologist blogger' which i think means unemployed. bless his wife though that woman must have either have the patience of a saint or he wears a chastity belt 24/7 while she beats him

>(double) (numer)/ denum
This is really bad and may not give you the results you want.
It does not matter for the int to double conversion, but can be relevant for other conversions you want to do later.
In this situation, I would suggest that you use static_cast(numer)

>he'd had like 6 jobs in the year that had gone by since he left
Always a warning sign.

I mean calloc(), not malloc(). I know realloc() is part of the "malloc() family" along with free(), but is calloc() GUARANTEED to be compatible with that family?

What do you guys think of this as an introductory interview question?

>Implement HList
>Use it to implement a map where trying to look up a key that isn't in the map results in a compile error

...

man realloc

Elem is a simpler way to do that

Why?

what happened to that web assembly meme?
did it die?

No.

It died because webshits can't/won't learn a language other than JS.

It's not being made for them tho.

They brayed and bleated and stamped their little feet because they're scared of their impending obsolescence.