/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1560384993657.jpg (640x800, 99K)

Other urls found in this thread:

vocaroo.com/i/s0DBKcPYMJTK
youtube.com/watch?v=iozAFIr3BEw
gigi.nullneuron.net/gigilabs/sdl2-pixel-drawing/
gigi.nullneuron.net/gigilabs/drawing-lines-with-sdl2/
autohotkey.com/docs/Hotstrings.htm
dev.realworldocaml.org/
twitter.com/NSFWRedditImage

based Sachiko

I'm a worthless filthy neet, so I'm learning Common Lisp.

nth for Nim!

I miss C++
If only C++ was not so shit for mobile and web...

Attached: 1536063434961.jpg (1060x1064, 96K)

C++ is shit in every other situation too.

Attached: 1558828626337.jpg (480x639, 32K)

Following an AFML tutorial and rewriting everything in Haskell.
Wanna work on my FP chops.

>AFML
Fuck me, I meant SFML

>Ah, Fuck My Life

vocaroo.com/i/s0DBKcPYMJTK

based and bappiled

>based and brappilled
fixed

Attached: 1553330925163.jpg (1200x800, 706K)

What do you recommend for staying focused and not being exhausted when learning programming? My last marathon learning sprint was good. Today, I felt exhausted after 8 hours with 2, 20 min breaks and feel like I'll fall asleep before 10pm. I already closed the computer since I feel like my head is going to sleep. Please serious answers and no, drugs and cofeee won't help.

I feel disappointed that I'm not able to do more than 6-8 hours

Attached: 1536063434957.jpg (1000x1000, 80K)

More little breaks probably. Try 20 minutes every hour and see how that works for you.

>My last marathon learning sprint
kek

i like to go on walks. break it up in sessions go on a walk in between but while your walking think about programming so then you'll be really inspired when you get back. something about walking gets endorphins or some sort of energy flowing back through the body so your thought processes are back on point sitting too long entices the opposite effect.

i remember reading google purposefully designed some of their coding spaces with this in mind and made it like a campus where everything was separated so you had to walk to get lunch or to different areas or ride a bike. it got the programmers moving and thinking.

No that's C. C++ has relevant usecases.

I'm kinda collecting resources about SDL2. Any other good tutorials aside from the lazyfoo ones?

Can someone tell me if my understanding of the "this." keyword is correct in this context?

ClassName(String s) {
this.s = s
}

This constructor basically lets you pass down a value when making an object to modify the data field, right?

i never liked the code style written by lazyfoo and how they split the code in functions

public class mirror {

//Checks if a a string has complete parentheses, takes advantage of Java
//autounboxing characters to ascii codes and the fact that matching
//parentheses are within 2 character codes of each other on the ascii table
//only works for (), {} and [] as far as I know so far.
public static boolean test(String s){
String s1,s2;char[] c1, c2;int len = s.length();
s1 = s.substring(0,len/2);s2 = s.substring(len/2);
c1 = s1.toCharArray();c2 = s2.toCharArray();
int i = 0;int j = len/2-1;
while(Math.abs(c1[i]-c2[j--])

String s;

ClassName(String s) {
this.s = s
}

or
String abc;

ClassName(String s) {
abc = s;
}

Discord is full of trannies, furries and faggots.
/dpt/ is full of pedos and weebs

Where can I chat with sane and rational people? IRC? Slack?

you'd probably fit in better at hackernews.

LinkedIn comments

reddit

Reading "How to Read and Do Proofs: An Introduction to Mathematical Thought Processes," in preparation for a math in CS course.

study before the class? what are you a nerd? lmfao

Nowhere because you're delusional and pessimistic.

I asked this in the last thread, but any good guides on getting proficient with the VSCode debugger, especially VSCode/Chrome debugging for front-end?

also, any good hacks for productivity in general? like which keyboard shortcuts to use, which extensions, etc. I really want to increase my productivity after seeing a few developer tutorials/streams, the seniors FLY through coding an app (the good ones, at least)

i've heard the fastest developers basically never touch their mouse

Haskell

>i've heard the fastest developers basically never touch their mouse
odd, that sounds a whole lot like vim

uuhhh...que?

"this" refers to the global variable
In OOP programs every class is also an object so "this.s" refers the to this object's variable s NOT this method's local variable s
It's just a scope thing.

Redpill me on Racket.
Why are universities pushing and claiming it's the best Lisp for production apps when that title imo should be given to Common Lisp/Clojure

The farther away a lisp flavor goes from "pure' lisp, the better off it usually is.
Dr Racket, optional types, and its native GUI stuff really help.

extremely good idea

I don't know but they are ditching LGPL, which has prevented some companies from using Racket. Once companies can actually use it, we will see what they prefer from a technical standpoint.

Rust has a pretty good WASM stack.

mate I'd be happy if I could focus for more than one hour a day.

Attached: f6cad5172e2e8d44da168d71b28d04bd.gif (647x363, 650K)

youtube.com/watch?v=iozAFIr3BEw

Trying to learn OCaml because my company uses it :(

not ADHD.

why the sad face?

Jane Street?

no one? maybe using the debugger isn't as popular as i thought, i thought basically all seniors used it

What about mobile

Automate the boring stuff.

wtf you should be glad

Stupid name but a great functional language.

Trying to implement this tutorial in C:
gigi.nullneuron.net/gigilabs/sdl2-pixel-drawing/
How do I translate this line:
Uint32 * pixels = new Uint32[640 * 480];
and this:
delete[] pixels;
Can I do it without constructors?

such as?

malloc and free

Any devs here pls redpill me on dvorak or colemak.

>Uint32
God, I fucking hate pointless typedefs of integers when standard ones exist.
uint32_t *pixels = calloc(640 * 480, sizeof *pixels);
free(pixels);
malloc works too, but zero-initialised is probably helpful here.

colemak is literally just a modified QWERTY for the shitters who got filtered by dvorak.
Take the 1-2 week hit in typing speed and learn dvorak

There is no reason to switch keyboard layouts. The marginal benefits (if any) are not worth the time invested.

they exist if you want to be slightly faster at typing
won't really benefit you much but if you're into that autism do what you want

thanks

Dvorak is very good for typing English but still not as fast as voice recognition. Programmers use a lot of weird character combinations which are often inspired by the qwerty layout. I haven't tried Colemak.

If you want to learn a new layout, you have two choices. One is you can stop using qwerty and just practice the new layout. DO NOT DO THIS because you will lose the ability to type on qwerty. The other option is slower to learn but much wiser: Spend some time each day with each layout.

If you think that faster typing is the way to be more productive, you should consider whether you could use a more productive language or paradigm first. I've tried both and found that working smarter is much more effective than typing faster.

Why do they even bother teaching data structures and algorithms when most companies don't care as long as it werx?

I haven't really lost much speed on QWERTY since switching, it just takes your brain a second to load in the muscle memory.

I lost qwerty 100% and it took me months to regain my old speed.

Use emacs

Hooray, it werks

Attached: Снимок экрана от 2019-06-17 11-25-57.png (640x512, 12K)

Do you use voice typing?

Sometimes you need just the right data structure to make it work.

Because appropriate use of data structures and algorithms leads to much more efficient and maintainable software.
You can't just fucking cram everything into a hashmap and dynamic array.

If I need to write a lot of English, Dragon works well. I haven't gotten into writing code by voice. I was using Java when I decided to learn Dvorak to cope with its verbosity. Today I use Clojure and it's so terse that my typing speed is plenty.

I'm pretty sure he meant the disconnect between academia and the real world with regards to "the proper way" vs "just make it work however you can"

Note: Dragon is voice recognition.

why limit yourself to only companies that don't care as long as it werks?

Aww too bad you have to subscribe to use it.

You can buy a copy, but yes, it does cost money.

>love C++
>once a project becomes too big it becomes too unwieldy for one person
I wish I could use it for hobby projects, but once GUI and stuff comes into play it's just too slow to write it in anything lower level than WPF

Ok, I'm back again, now with this tutorial
gigi.nullneuron.net/gigilabs/drawing-lines-with-sdl2/
What can I use instead of this thing?

If there are words or phrases you need to type repeatedly, make a hotstring for it.
On Windows you can use AutoHotkey for this. Example:
::btw::by the way

autohotkey.com/docs/Hotstrings.htm

Roll your own linked list or make a dynamic array using realloc.

>Roll your own linked list
linked lists aren't complicated not sure what "roll your own" is for

Or just use macros

Best way to learn python (I'm a total noob). I have the Automate the Boring Stuff course but I feel it's too simple and doesn't cover enough computer science knowledge. Where do I go from there?

This has to be a joke right? If you're working on critical software, your code needs to be efficient. Also, with big data and database applications, you're going to have a bad time if your code isn't efficient. Ever heard of shuffle hash join or index nested loop join?

Or just not be a virgin and type it out

Why do they teach anything in medical school, when you just write up whatever the medicine companies tell you to write up?

have you guys noticed a particular thing that every programmer should know, but most don't?

i've been noticing lately that a LOT of coders don't know how to use RegEx. also using their database shell rather than some GUI bullshit

Inefficiency is the worst thing about the software industry today.
Imagine how much faster your car would go if it was written in C.

Regex looks like alien language to low IQ mouthbreathers

You could make a hotstring for "virgin" and it would save you an hour every day.

>coders
>low IQ mouthbreathers
Found the newfag normalfags
Guarantee you use "regex" (probably not even regular) where you shouldn't

>have you guys noticed a particular thing that every programmer should know, but most don't?
math

You're not helping your cause here. Put a trip code on so we can filter you

Attached: 1558840602008.jpg (221x250, 9K)

>Inefficiency is the worst thing about the software industry today.
no

Wow you've really convinced me, now I know you've been here at least, what, a week?

I'm a math brainlet. What's a good book for someone essentially needing to restart from an algebra 1 standpoint.

Attached: D8ywak1WsAEhjW5.jpg large.jpg (681x918, 53K)

>poot
haha

>the amount of time you're on Jow Forums corresponds to how well you know regex
This is sad at this point. You should probably stop talking

Attached: 1557262071337.jpg (700x557, 41K)

Who are you quoting?

dev.realworldocaml.org/