/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

youtube.com/watch?v=5lnus09vYo8
twitter.com/SFWRedditGifs

Please do not use an anime image next time. Thanks.

Second for D

char x[]
vs
char* x

>OOP

kek

A better question
char* x
or
char *x
or
char * x

Second, no doubt.

these threads are shit because of the amount of autistic faggots on >>>/code/ when, without the ability to post and ban if you don't post code

char* x

I unironically enjoy VS Code

20% CPU USAGE ON A BLANK DOCUMENT

char* x
declaring more than one variable per line is for idiots anyway

>You agreed with "loops are equivalent to recursion", then you disagreed with the same statement. In what way is that not a contradiction?

You are one dense motherfucker.

First of all, get your terminology straight and stop trying to twist everyone's words.

No I did not agree or disagree with:
>loops are equivalent to recursion

I agreed with:
>it is simply impossible to have a loop which can't be translated to recursion

And I disagreed with:
>Everything you do with a loop you can do with a recursive function

Those statements are not the same. One is abut concepts and syntax, and I agreed with it because you can in fact write any loop with recursion even if it's convoluted and inefficient. The other is a statement about objectivity and it's one you've contradicted yourself on when you admit recursion is less efficient as "everything" encompasses doing things with a certain level of efficiency.

It's just a very different way to view the world/live, since for most of my life "not knowing" == "stupid, to be ridiculed". Thanks for your response.

If you have a shit CPU, maybe.

stop dragging autism from one thread to another, its just going to be replaced with another topic or more derailing
>who r u quoting
crap

>And I disagreed with:
Disagreeing with it while at the same time agreeing with the previous statement without contradicting yourself is impossible.
>"everything" encompasses doing things with a certain level of efficiency.
It doesn't unless you try to play retarded word games.
"being able to do everything" isn't the same as "being able to do everything with a certain level of efficiency".

Thank you for using an anime picture.

I used to use
char *x

But now I use
char* x

for my projects.
It's less enjoyable too look at now.

I tried to use VS Code, but the performance was shit; it's better than Atom though.
Install vim.

>it is simply impossible to have a loop which can't be translated to recursion
Implies
>loops are equivalent to recursion
So you did in fact agree with
>loops are equivalent to recursion

>install vim
I have primarily used vim for 10+ years. Performance is great for VS Code for me, you should use a better computer.

>Disagreeing with it while at the same time agreeing with the previous statement without contradicting yourself is impossible.

It's not and I just explained why.

>It doesn't unless you try to play retarded word games.
>"being able to do everything" isn't the same as "being able to do everything with a certain level of efficiency".

Being fucking clear what you're saying and not putting words in other people's mouths isn't playing word games, it's using words the way they're meant to be used. You can't retroactively reword your point to make yourself look correct and then accuse others of playing word games you retard.

And yes, "being able to do everything" does include everything. Let's use some first order logic here.

Can do X with Y efficiency. If there is a value for X and Y where this is true for loops but not for recursion, then recursion cannot do everything loops can.

You logic and wording are both terrible which makes me wonder if you've ever programmed before in your life.

>front cover is on the back

but I thought moonrunes read rtl?

char *x Is the right way but
char* x makes more sense and looks better

Working on a sh implementation in python, pic related

Those Asian types read right to left

>It's not and I just explained why.
It is. I hope you agree that these are different statements:
"being able to do everything"
"being able to do everything with a certain level of efficiency"

"x can do everything y can" means "x can compute everything y can", it meaning anything else is entirely irrelevant in this context.
>first order logic
Complete trash. Didn't even read past this sentence.

Let me rephrase as my original wording is misleading: its performance is shit compared to Vim. Also I had Code installed on my SSD and my processor is fine. Again, though, Atom is the real train-wreck.
There's also a 2hu background theme for Code which is adorable; I miss that.

Where do you think you are?

They do.

>Working on a sh implementation in python, pic related
I don't want reddit stink nearby. Fuck off.

>There's also a 2hu background theme for Code which is adorable
Which one?

LTR is more practical for a technical text.

>char* x makes more sense and looks better
How does it make more sense?

char* a, b;
a is pointer to char, while b is a char. If anything this makes less sense.

>It is. I hope you agree that these are different statements:
>"being able to do everything"
>"being able to do everything with a certain level of efficiency"

Yes, because "being able to do everything" means being able to do everything with all levels of efficiency.

>"x can do everything y can" means "x can compute everything y can", it meaning anything else is entirely irrelevant in this context

>You can't retroactively reword your point to make yourself look correct

I can't remember the name, but search "anime" in the extensions marketplace. I think it was published by a Chinese dude.

no prob user. You sounds like you're really capable that's all that matters. not knowing and being a faster learner is better than knowing via rote memorization and having no elasticity to your learning.

Implying that "do everything" means anything other than "can compute everything" when we were talking about Turing machines since the very beginning is outright retarded and dishonest.

from the perspective that 'a' is of type 'char-pointer', it makes sense. But when you declare it like that it really doesn't make sense.

>when we were talking about Turing machines since the very beginning

I think you might actually be mentally ill or something because your comment had nothing to do with Turing machines.

>dishonest

That's funny because since I jumped into this conversation all you've done is try to worm your way out of what you said and misrepresent what everyone else said.

Reread the whole reply chain, that's what started it all. Do you have some memory related deficiency? Also I'm convinced at this point that you simply can't read and comprehend what's being said in a normal manner.

I want to get into operating system programming. Does anybody know any good resources for that sort of thing? I'm probably going to base it on some flavor of BSD.

are you trying to do something specifically POSIX or would you want to do something lower level for something embedded perhaps?

my mom's trying to push me into an IT job paying $48k a year. she's very forceful about it. i'm majoring incomputer science and have a 3.92 gpa

POSIX. I'd like to eventually make a desktop OS.

dumb frogposter

Oh look, you're completely full of shit, what a surprise.

Tell her you can get a much better job.

i did and she brushed me off saying 48k is a lot

yeah dude for pay like that you'd be working with potato chips not computer chips

is it ok to create tons of functions that make the code easier to read but longer?

for the record I did nowhere near as you, do not have a degree, and make over 100K at the moment.

What do you do?

Tell your mom to fuck off.

As long as you don't overdo it.

I'm the consultant from earlier posts

Your post just confirms that you can't read and comprehend even simple posts. Let me know when you can parse basic English.

I hope it will be entirely GNU-free.

stay foolish stay hungry

Let me know when you have an argument.

Which is the best JVM language apart from Java?
(Are any of the alternatives even used?)

Scala and Clojure are very popular.

How does this answer his question?

Too bad they're fucking garbage.

Solve this simple riddle:
>1 + 2 = 99

Yeah, but the second snippet is generally avoided exactly because it's too easy to make that mistake. If you stick to the first style, and you should, then it makes sense.

>Solve this simple riddle:
+ 2 = 99

The answer is: False!

javascript

(1>(2+(9=9)))

The answer is: False!

the ascii code for 1 is 49, and for 2 it's 50. 49 + 50 = 99

Give me a functions/structure where you use recursions, ill try my best to find a loop/more efficient way of doing it.
Ive already done it plenty of times in my own code, bringing it out would feel like throwing poopy diapers at a baby.

Why is everyone talking about Coq, verifiable C compilers, halting problems, Rust and substructural types /dpt/? I just woke up from a coma. Is our world tired of C ub shenanigans or what is happening

damn, pajeet's not going to be hired by the federal govt anymore
youtube.com/watch?v=5lnus09vYo8
do dijkstra's

I made a "pact" of sorts with a certain creature.

Alright ill take a quick look into my A* code from years ago, once im done with this bug.

I asked for your code, but i see you have none.

hanoi towers

oops, i meant to quote this

oh thanks for reminding me I need to add pajeet to my filter.

Why would we not be talking about Coq, verifiable C compilers, halting problems, Rust and substructural types?

>I asked for your code,
no you didn't, think i'll start tripping since it's getting confusing with everyone being named anonymous

You want me to do dijkstra's and hanoi towers?

again.
>I asked for your code, but i see you have none.

>Give me a functions/structure where _YOU_ use recursions

filtering doesn't change reality, rajesh. you have to do back soon

CORRECT!

overgeneralizing is for retards, user :^)

>>Give me a functions/structure where _YOU_ use recursions
quit acting dumb, i already told you i'm not who you thought i was. if you can really do recursive things iteratively so easily you wouldn't be getting defensive when i give you something to do it on

i cant do hanoi towers even using recursion lmao

memorizing the ascii table finally payed off

does 1 + 2 really = 99 in javascript?

I gave you rules to adhere to and yet, you, did not, follow.
Im "upset" because it would be easier to improve your 20 line function then write a program for hanoi tower/ review my years old code.

Declaring variables is for idiots anyway.

>I gave you rules to adhere to and yet, you, did not, follow.
once again, no you didn't. i assumed you were acting dumb but i guess you really are just stupid

check out the OSDev wiki

>Give me a functions/structure where _YOU_ use recursions.
Does this not make sense to you?
Is this not a rule set?
1) you need to give me _a_ function.
2) _You_ need to be the one using the function.

are you unable to read?

Apparently i cant read your point.
Try explaining it.
>implying
Is for people like you, not people like me.

i was teaching my bro about recursion and generators

"""
This code is in the public domain.
"""

import unittest


def fib_loop(n):
x, y = 1, 0
for _ in range(n):
y, x = x, x + y
return x


def fib_recursion(n):
def f(m, x, y):
return f(m - 1, x + y, x) if m > 0 else x
return f(n, x=1, y=0)


def fib_generator():
x, y = 1, 0
while True:
yield x
y, x = x, x + y


class FibTest(unittest.TestCase):

expected = [1, 1, 2, 3, 5, 8, 13, 21]

def testFib(self):

for index, n in enumerate(self.expected):
self.assertEqual(fib_loop(index), n)
self.assertEqual(fib_recursion(index), n)

def testGenerator(self):
for actual, n in zip(fib_generator(), self.expected):
self.assertEqual(actual, n)


if __name__ == '__main__':
print(fib_loop(input('gibe number: ')))

Does anyone here actually use OOP or think it is good?

i saw you make a post asking a guy for recursive programs and that you could turn them into iteration, so i gave you one, and you flipped out

I sure hope not.

nice quads

why is she so happy?

Have you learned it yet Sup Forums?
Time to put get with the future.

Reminder that Rust is a straitjacket, there is valid, safe code that you cannot express in it