/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

forum.arduino.cc/index.php?topic=166099.0
timeanddate.com/time/map/
pastebin.com/xRTtGacw
github.com/MotorCityCobra/face_ripper
wisdomination.com/screw-motivation-what-you-need-is-discipline/
resources.sei.cmu.edu/library/asset-view.cfm?assetid=5283
yegor256.com/2014/12/01/orm-offensive-anti-pattern.html
twitter.com/SFWRedditImages

op is a faggot

Learning Cutelyst.
>inb4 >>>/wdg/

You're the faggot for baking before autosage.

C is great
sepples sucks

This, but unironically.

This, but sarcastically

who's the chihuahua?

Actually user you are the problem. New threads made before the bump limit are duplicate threads, but once the bump limit is reached the thread is not a duplicate any more and now the "well-intentioned" thread splitter has created a duplicate thread. It's not about a competition to see who can get the earliest legitimate thread.

...

>You will never have a cute gf to code with

Kate Micucci.

static inline int longitude_to_timezone(int longitude)
{
return longitude / 15;
}

tfw you figure something out that isnt easily google-able

>figure something out
It's literally in every geography book, you brainlet. Too bad it doesn't really work in practice...

Talk me out of learning Rust.
No memes or ad hominem allowed.

I have no idea what geography is or does sorry.

every reason to ever use rust over any other language can be refuted with 'git gud'
why won't you git gud, user?

>reinventing tzdata, incorrectly
to live in your spherical cow world...

>the function to find a rough representation in c is in
>LITERALLY
>every geography book
would be nice if arduino had std

cyclic or intrusive data structures
borrow checker when the tradeoffs of GC would be sufficient for your task
platform support
SJW infestation in the community and its spaces
compile times
young and still incomplete ecosystem for certain tasks

eh, it depends
good idea for some goals, less so for others

>arduino
tf do you need timezones for in an arduino

gps based clock

Arduino sure has STDs, user.

Redpill me on this new borrowchecker meme, /dpt/. What's the deal with it?

Rust has the borrow checker. It means you can't have multiple mutable references. It means you can't move an object through a reference.
It makes it take twice as long, for both the programmer and the machine, to do anything but fizzbuzz.

hm, I see
>tfw you figure something out that isnt easily google-able
"gps sensor timezone" second result:
forum.arduino.cc/index.php?topic=166099.0
>Get time zone with GPS?
yeah, the 15deg trick might be usable in your locale, but if you need it to be universal, and have the budget, it'd be nice to allow the user to switch between timezones, I mean just have a look at this mess:
timeanddate.com/time/map/

ooh you're right, what do you want as a participation prize?

>this new borrowchecker meme
We're too dumb to figure out who owns what, but if we dumb down the language to compensate for it, we can solve the problem!

obviously

There's something wrong with that /dpt/ image op.

rust is not dumbed down, if anything it's too complicated for its own good

even more line noise than sepples yet barely 2 years old. sad.

Why the fuck there is always multiple /dpt/ on the same time?

it's a meta reference to multi-threading

Once the thread is infected with trapposting it's best to just quietly make a new one and hope they're too busy ERPing to fuck up the real /dpt/.

>Tried to split a heavy task into several threads
>4 web workers run 10x slower than main thread
Fuck this shit. Why do they give me ability to utilize more cores without giving me any benefit from it?

the screen is off
she is lovely, but is dumb
nice feet also

doing the chapter 11 exercises of the haskell book. a lot of fun, even when my own solutions dissapoint me most of the time.

>Why the fuck there is always multiple /dpt/ on the same time?
This thread is unofficial.

Nigger.

Real /dpt/ started with

>created before bump limit
no

>severely constraining the way resources can be used, to the point where a compiler can figure out for you when to free them
>not dumbed down

Enjoy your memory leaks, faggot.

>looks at op image
Yea this shit isn't official.
Legit /dpt/.

Nigger.

Rust doesn't prevent memory leaks. In fact, Rust shills routinely claim that leaking memory and crashing is not incorrect.

no argument.
If you want to post like op, and talk about rust why not just go back to blebbot. You fucking faggots.

N I G G E R
I
G
G
E
R

Who gave you permission to post my wife?

hand rolling matrix convolution in cuda. I'm getting 2 tflops out of a 1050ti, I honestly think I'm at the hardware limit. Going to check on my 1080 in a bit.

>when the fresh-out-of-college new hire tries to tell you how to refactor your code
ive been on this project for 2.5 years. you havent even seen the code let alone know how it works.

>when you're such a shitty coder that even a fresh-out-of-college kid can do better

i used to think i knew it all too.
you will learn.

Missing programming socks

I know plenty of retards just like you who can be outperformed by literal beginners, and they all think they know better, even when faced with direct irrefutable evidence of being outperformed.

And I know plenty of 20-something year olds who think they're hot shit because they have a CS degree and no experience, yet know nothing about software development.

Raymarching with signed distance field.

>all good editors use spaces and \n by default
How true is this?

why wont my shit WORK
WTF
pastebin.com/xRTtGacw

>le CS degree and no experience meme
Here's the amazing thing: people with a CS degree have a demonstrable capacity for learning, so they pick things up quickly and actually learn from experience, which can't be said about the vast majority of code monkeys, who can only defend their blatantly abominable code with appeals to how long they've been stacking piles of shit on top of each other.

I'm a college dropout and still have to fix code from know it alls like you

>people with a CS degree have a demonstrable capacity for learning
the only thing your degree means is you can pass a test.

The best editors will treat them the same but let you choose the underlying representation.

And I fix plenty of code from new grads who think they need a double for loop to build an identity matrix.

That's what fucktards tell themselves to feel less inferior. You have zero logic or evidence to back it up.

I've found most people I've worked with to not have an actual talent for software development or problem solving in general. I've worked in the industry 6 years and I've yet to meet a decent developer who doesn't have a CS degree. They exist for sure (John Carmack), but they are rare where I am.

The fact that I can hold a job is evidence enough.
What do you have?

>What are you working on, Sup Forums?

Just finished a jpg face ripping repo for deepfakes.
Not sure where to post it anymore now that r/deepfakes got shoah'd.
github.com/MotorCityCobra/face_ripper

A form calculator for my second semester of college. C# bros, will I survive?

Are you saying a CS degree makes a good developer? Because I can show you the bottom 30% of any graduating class. You dont have to know what you are doing to get a degree. You just need to be good enough not to fail.

And being just good enough not to fail, may not always cut it in an actual job.

>The fact that I can hold a job is evidence enough
It would've been evidence that someone is willing to pay some unspecified amount of money for your shit-tier code if you were able to produce any evidence of actually being employed. In any case, it wouldn't be evidence you're a competent programmer.

I didn't say that at all. Read my first sentence.

Are you talking about
for i in range(0, n):
for j in range(0, n):
if i == j: matrix[i, j] = 1

Because you need a double for just to do about everything for matrices.
I see code that goes at least 6 indentations deep on a regular basis.

>Are you saying a CS degree makes a good developer?
No, you absolute retard: what people are trying to communicate to your dumb ass is that there's a strong correlation between being able to get a CS degree and being able to get good at programming. Incidentally, there's also a strong correlation between writing posts like yours and inability to ever get good at programming.

I forgot Sup Forums is CS 102

What the hell is the future of IT specialists? My company is starting to move towards public cloud based offerings like Amazon's AWS and doing away with just about everything in-house. All of this automation and external service pretty much makes traditional sys admins and the like obsolete. And even if I somehow stick around, my company can just outsource all of the administration to Pajeet. I'm trying to get into big data but who says that field is even safe from this kind of mentality going forward. Should I just go into software development? My concern with that is older software developers (40+) are looked at with scorn and I don't have much hope with that career remaining sustainable. Overall, technology just looks really bleak to me at this point. If the machines don't replace us, Pajeet will.

>My concern with that is older software developers (40+) are looked at with scorn
Most people I work with are 40+. If that's the case where you live, then move.
>If the machines don't replace us, Pajeet will.
Don't blame Pajeet. Just get good.

is that a trap?

I find it hard to motivate myself to pro/g/ram anything anymore

How do you do it fellow anons?

You don't need motivation, you need discipline: wisdomination.com/screw-motivation-what-you-need-is-discipline/

In my experience, the most effective way of becoming discipline is employing the Personal Software Process: resources.sei.cmu.edu/library/asset-view.cfm?assetid=5283

God bless you user, useful advice, I needed to hear that

This, but redditically :^)

Related but not related, I interviewed someone a month or so ago who listed a masters in cs on their resume and couldn't even explain to me the differences between Java and Javascript (no knowledge whatsoever of the concept of async languages).

It isn't an anime image

>no knowledge whatsoever of the concept of async languages
What? I thought you'd be expecting a more general answer than this.

>how long they've been stacking piles of shit on top of each other.
you get what you deserve when working with javascript senpai

I brought up async as a follow up question and they were oblivious. Never heard of a promise.

Unless you know specifically the cpu you are programming for, don't use multithreading for that. Use multithreading if you genuinely need to do more than 1 thing at once, like user interacting with the application while you load something.

Resource contention? If workers have to synchronize over the network a lot then I can definitely see a parallel implementation vastly underperforming a singlethreaded implementation.

I've never heard of async and promise in school. I only ever read about it while looking up shit online. I'm sure the guy you interviewed would be able to grasp the concept pretty quickly though, it's not that hard.

Not knowing the difference between Java and JavaScript is pretty huge though. I assume at least one of those languages was listed in the job description though, so he should have been familiar with one of them.

>she

Understanding the difference between Java and Javascript means understanding the differences in their runtimes, their ecosystems, their language philosophies, their roles in the industry... I'm of the opinion that if someone doesn't know these things, they're not cut out to be programmers. It's a lot to know, but if someone can't program competently in a half dozen languages as a junior developer, then they should fuck off to an easier field.

>not using %
pleb

could someone help me understand or maybe whip me up an example of showing how to do basic oop + db persistence but without an orm or odm? in something like ruby, python or php?

Read yegor256.com/2014/12/01/orm-offensive-anti-pattern.html

Is it a good idea to study partially documented source code?

What do you mean?
If you can only understand the code from the documentation it's probably not well written code. Unless you're at fault.

It's a good idea to read a lot of code generally though. You should prioritize by the quality you perceive the code has. If it's good code it can probably help you learn to make good code yourself.

I usually download code to a program that interests me and try to figure out how it works. I can understand how the code works mechanically but not always whys of its implementation.

One of my friends suggested that it's bad practice to study this way, because you don't get the insights of the programmer's thinking.

i have the black belt in clean code and clean architecture

It's a fair point. But how often do you get the insight of the programmer without their presence?
Documentation certainly isn't a reliable representation of the programmers thinking.
Especially not if you're concerned with developing. What you'd really want is to sit next to them and ask questions while they're writing the code. If you read the documentation they're simply telling you what they concluded after writing in some sense.
>whys
Difficult to come by sometimes. Depends a lot on the programmers and the principles they follow. If you look at code and see some principles you recognize you should be interested in where they break them.

I don't think you should worry too much about it. Learning is always about spending time efficiently. Maybe you learn better from a well structured book.
You can be sure that reading this code is better than getting bored of a book and doing something else though.
And a book won't really get you in a habit of reading code. It's something you'll absolutely do in the future.