/dpt/ - Daily Programming Thread

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

Attached: 1561394302161.jpg (900x820, 193K)

Post your haskell projects

Scheme!

post you're vulkan projects

You made me wait for my JavaScript lesson... you're unbelievable, user!

Attached: d00bca56e724ec583ab285d76e1c184a.jpg (580x1024, 81K)

Some PNG spec is driving me mad. Other than that I'm having a fun time with C

Attached: 1560434004087.png (1920x1080, 390K)

No! Clojure!

Why do I get this result?

Shouldn't it have printed the memory address of the array?

Why does it do this with int but not char?

How do I use pointers with char?

Attached: 2019_07_20_04_05_05_C_TDM_GCC_32_test.cpp_Notepad_.png (642x386, 14K)

For what purpose are you dealing with PNG directly when libraries exist?

>babbys first cstring

uintptr_t

my bf asked me to for his homework :3

what's the best programming language to learn programming with, and what's the best book to study from? I was thinking C++ and using the principles book alongside The Art of Programming, but there's also Lisp, Haskell, Fortran, R, C, and so on. Not sure what is the universally accepted pathway to becoming a codelad.

>uintptr_t
how would I use it?

c++ is all you'll ever need
everything else is shit and/or trash

Cast the pointer to that, then print it.

When you cout

Just use an std::string, retard. Or learn what a C-string actually is, you know, like you'd learn in the first day of a C programming course.

Don't listen to this that knows jack shit about programming.

There are a thousand ways to learn programming and you can start with literally any language you want. There is literally no uniform way to get into programming because there are a lot of languages, ways to get into programming, and new hot fads.

However if you want a really good book to understand what programming is all about, I urge you to read this book. You will not use Common Lisp very often except if you're a fanatic like me, but this will teach you every basic concept of programming and things you'll see in this book are still being implemented in other languages. Then you can either delve more in Common Lisp with Practical Common Lisp and learn about things like CLOS, or you can go to any programming languages you want and you will feel 100% at ease to tackle anything. Trust me here. This book is a masterpiece.

Attached: Gentle-introduction-to-symbolic-computation.jpg (260x326, 25K)

Don't listen to this CS grad that knows jack shit about how real world software that's actually useful works

thank you very much. i'll go into this book right after i finish reading up Nicholas J. Smith's "Logic: The Laws of Truth"

im not trying to make a string, I'm trying to make a dumb cmd prompt game using an array

is my char pointer actually pointing to the array?

>no replies
fitting

Cutest image.

For general purpose programming, I'd go with SICP or HtDP. Otherwise it depends on your area of interest.

Nice book, very profound.

Attached: deep_lisp.png (565x63, 15K)

>is my char pointer actually pointing to the array?
Well it points to the first element, so sure

is it pointing to the address location I mean?

what did he mean by this

When you divide people, it's easy to make them accept evil. Together, people can resist evil.

I have a web application written in Haskell that is running for idk 5 or more years.

how big is this?

Here you go user, now this looks like something from someone who knows what they are doing

Attached: unknown.png (1080x1920, 198K)

t2 tile project will be the end of this bit marching retarded era

nice

that is deep.
does it mean we can stop language wars now?

Is low-code /no-code the future or just a meme? I might see some uses for a Mendix for a large corperation as some kind of layer over their ERP system to make everything accesible, so that every employee can easily make something of a dataview with small inputs.But for big projects, it just seems like a meme desu. Anyone with any experience with jt?

Is there anything more autstically satisfying than shit just lining up?

Attached: Capture.jpg (260x82, 6K)

...What the fuck are these comments dude
I'm actually angry

m_device.bindBufferMemory
( tempBuff
, tempMem
, offsets[i]
);

Yes, running clang-format over the autists' code and watching them seethe.

spacemacs or spacevim?

doomemacs

>m_device
Gross.

Tell it to , retard

generalizing the range analysis algorithm for my programming language. the theory behind it turned out beautifully simple and elegant.

Attached: golden-ratio-aloe.jpg.320x0_q80_crop-smart.jpg (320x213, 18K)

What is wrong with them?

newline comma becomes annoying after a while

Attached: Capture.jpg (715x154, 14K)

gay
never post here again

your comments should be the variable names.

you've gotta do the opening paren too so they all line up

why?

because I'm the gay authroity here

Unfortunately, many languages don't have symbols, which means there's nothing for people to gather around and use to represent the good that can be achieved.

Because it's fun reading specifications and reinventing the wheel. I'm sure whatever libraries out there will perform better than my code, but that's fine

Attached: proxy.duckduckgo.com.gif (345x535, 218K)

Holy shit nigga this is not how you comment code. You should restrict comments to explain WHY you programmed something.

vk::FramebufferCreateInfo fbInfo({}, m_renderPass, 1, attachments, m_swapchain.m_extent.width, m_swapChain.m_extent.height, 1)

ahh so much clearer

I would understand commenting function definition but commenting when calling a function is downright retarded. Do you comment every function call?

Attached: 1557557945260.jpg (1280x720, 57K)

Put them in variables

n-no l-lol

Attached: Capture.jpg (549x866, 56K)

If you don't want to end with random values in your code and you want to be clean and not use comments (as you should), you should make a constant with that value. This way, I don't have to scratch my head reading your shit. This is the optimal use of constants, so please, for the love of god, use them, you fucking retard.

are you proposing writing out sausages of temporary local constants that get to be copied for no reason if not adding even more move semantics garbage just to have named parameters?

These should be in function definition, no function call.

>"huuuur why should i make my shit more readable"
>"what do you mean this is not how you use comments and my code should reflect what I do???!??!!??!"
>"constants??? what's that lol xd"
So you're THAT guy at the office huh

nvm I'm retarded. But it should be formatted in a way to allow automatic documentation.

ah so you are retarded and can't form a coherent argument ok

I usually only do that for functions with more than 3 arguments (which might be better to avoid, anyway).

How do you get it to align?
Do you have a formatter that does that?

I am currently on exercise 32 out of 52 exercises of "Learn python the hard way". I knew intermediate c++ but I have got rusty due to being out of practice. How should I get back on track, I want to improve my problem solving skills too. Please guide me good anons. Thanks. Have a productive day

I mean, go ahead and continue doing your shitty retarded commenting garbage until someone like me comes to you and murders you for adopting such retarded programming habits. Please, for the love of Jesus Christ himself, read a fucking style book before I have to take a painkiller induced by your stupidity. Constants are a thing. Use them. Only use comments if you need to explain WHY you programmed a thing a certain way. Otherwise, do not use them, and if your code is not reflective of what your code actually does, then you should reconsider the way you program.

Peace, and see you at mc donalds. Still ordering a big mac with large fries and an ice-tea. Thank you, loser.

nigger

Learn basic algorithms.

dude, they're just comments. they're harmless. a lot more harmless than /dpt/.

No, this is where you don't get it. The "it's just a comment" attitude leads to people overcommenting code for absolutely no reason whatsoever and not understanding what comments are in the first place. Comments are a band-aid to bad code. Meaningful variable names should be more than enough to convey what you code does. Any specific literals like a number, a memory address or whatever, should become a constant specifically so you do not need to write a comment about what it is, because it breaks any decent style guide. This is important. Also all programmers that do this shit never use comments to explain code reasonings and a reason to explain why something was implemented a certain way because, again, they do not follow a good style guide. This makes it so programmers that need to look at your code, or you in the future looking back at your code, will have to sift through your stuff not understanding the whys of your code, and will end up trying to do better without even understanding what you were trying to do.

When you understand what mess it is to change a complicated system without that kind of comment, and instead you have really badly placed comments, you start caring about this shit. Please. If it's "just comments" then take the time to adjust to something nice and tidy.

do you think I'm gonna read all that shit lmao

>PR isn't approved because of a missing period in a comment
Sometimes I want to do harm to my coworkers.

maybe I can't get excited about it because I haven't had to maintain code that weird.

Starter ressources for python? I am having a course soon and don't want to go in blind.

>There are too many errors for the IntelliSense engine to function properly, some of which may not be visible in the editor.
>no errors
wow very cool

first it's a missing period, then it's an accidental typo causing a bug.
get shit right nigger

Your existence is an error

>Look up Madcow 5x5
>It's percentage based
>Look up "Madcow workout generator"
>*light bulb goes off*
I found myself a weekend project.

Attached: 4900ec1a04e1b72024237e9778c75ff0.png (1980x2520, 3.98M)

...

>type causing a bug
Get your fucking house in order. I will shit on dynamically typed languages all fucking week. But even the most basic linters will catch that. You do have hookd right? And you do have tests that would catch that error right?

Is this your first programming course?

Lisp is the most powerful programming language.

It's the most flexible, not the most powerful.

all languages are just variants of lisp.

me on the left

Where can I get runtime access to the AST in C?

C is just a lisp without this feature and with algol inspired syntax.

Use system calls to intercept the call to the the compiler you're using and manipulate its AST.

>runtime access to the AST
bruh the AST only exists at compile time

>What are you working on, Jow Forums?
Pic related

Attached: suzanne2.png (1282x752, 67K)

>reinvent the wheel

ahh, no fun allowed. what are you workin on user?

Attached: suzanne3.png (1282x752, 138K)

a time machine so i can go back to a time before /dpt/ ever existed

getting a gf that will love me despite of what i am

I broke my main hand now i have to do everthing opposite handed. It sucks, but going slow can have its advantages.

Wrong

Wrong