/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

npmjs.com/package/is-zero
npmjs.com/package/is-negative-zero
twitter.com/SFWRedditGifs

Justify the existence of these packages, /dpt/.

npmjs.com/package/is-zero
npmjs.com/package/is-negative-zero

...

>negative zero
>positive zero

web devs everyone

>It's not the literal code being used
Apparently you changed more than you thought because the user you're replying to got your posted code to work with those fixes. Obviously there is something in your code that is not in the posted code, and that thing is causing the problem. I wish people wouldn't try so hard to reduce their test case when they don't even know anything about the problem.

Sometimes you want to return error on positive zero, but not negative zero.

Why the fuck do web devs keep appearing here?

The wonders of a vibrant open source community.

>they'll write 30 LOC of test cases for 3 inefficient useless functions, but they won't even accept my simple pull request

I hope you're just pretending to be retarded.

why is web development such a cluster fuck? whose idea was this? serious question

>start typing question
>while typing question i figure it out after struggling with it forever

anyone else do this all the time? i wonder if theres a name for this phenomenon

the same reason IT/information systems is such a clusterfuck, it's marginally easier than the rest of the "field" so it attracts idiots

Yeah it is called being retarded

It's not the name of the phenomenon per se but this is known as "rubber duck debugging". What happens is that as you analyze the problem to explain it to someone else, you find something that you missed before.

How is it possible for Rust to have a worse type system than C++, a language that is over 30 years old?

C++ templates can be used to do HKTs. Nothing in Rust can.

HKTs are unsafe

>HKTs are unsafe
No, they're not.

What is the math, or in other words, which math topics in specific do I need to learn before diving into "Introduction to Algorithms, CLRS". I hate to admit it, but I got overwhelmed by the proofs. I understand the algorithms, and how they work. However, when it came to the mathematical proofs, I just simply choked. I am currently learning how to program, and I know I may not "need" the math for programming, but I still want to learn it. I truly believe that said math will only help me understand algorithms even better. So, if you would please lead me in the right path, the path of de-retardation.

If you don't have trig, calc and stats down, don't even bother trying to read CLRS.

What is your education level?
High school math?
College math?

Currently finishing Calc 1 in college. I have already taken Trig(though, I need to dust off my knowledge on it).

Alright, so I better leave it for later, and start reading other algorithm books. I am currently reading "Algorithms Unlocked" by MIT. I was planning on reading CLRS after finishing this one, but I guess I better get proficient with Calc, Trig, and Stats before I even think about touching that book.

If your are in a STEM major the amount of maths modules you take should be enough for you. Anything more and that would be a more math focused major route (stats, maths)

What does that have to do with anything?
Rust still allows unsafe code, and most would argues, /requires/ it for anything meaningful

It's really not that important.
You can understand algos without the rigorous proofs.
Once you get past a certain level, it's all academic wank that gets further and further from applied computer science.

It's worse in that way alone, better in every other conceivable way. I agree with your sentiment, though, it's an egregious omission.

I'm gonna be honest here, Rust not having HKTs is the only reason that I'm making my own language right now. If it did, I could live without dependent types, but I might as well implement them since I'm making my own language anyway.

Oh, for sure. I know math is "really" not that important for programming. It's just that I feel kind of, empty, if I don't "truly" understand a proof. I guess I gotta take baby steps, and learn them little by little, and not get discouraged whenever I don't understand something(I suffer from this a lot).

What major are you doing in college?
Because unless you are doing something really steeped into maths, there is no need to understand a proof.

Well, I've decided to start working a on a project. My aim is to make some kind of game using pdcurses and C. I have no clue wtf im doing, but I'm sure I'll figure this shit out one way or another. Maybe some kind of adventure game and then I'll work my way up to a roguelike or something else.

Any recommended readings?

I want to do this, user, but I don't have enough time on my hands.
I might during summer after finals.

Computer Science.

t. retarded code monkey.
Don't listen to this guy.
Math is proofs and math is important.

I am not sure about your college but when I did mine, my uni did require me to do a bit of modules that required me to do proofs.

anons,

I've started to take CS50 and enjoy the general problem solving elements of programming. My problem is I don't know what to do with any of my knowledge and I feel like CS50 moves slowly. I'd much rather just pick up a book and start learning. One tip I heard was to find a project and try to build it but I don't really know anything I'd like to do that isn't super mundane. I guess I'm interested in creating my own basic Android app, and I guess trying to learn Java in order to achieve that. Is this a good idea or should I start smaller? What are some big projects that inspire you all?

>Math is proofs and math is important.
Yeah I am sure the engineers that built 99% of the shit that you are currently using know the proof behind the maths they are using when they design/build a product. Fuck off with your academic wank fest.

Application of maths is far more important than proof of maths.

Dumb nigger. You're not studying cs if proofs are optional, if proofs are something that you just want to dabble around in in your own time.
If proofs isn't something that's being drilled into you in many courses then you're not studying cs.
Fucks like you give cs a bad name.

Most big projects start off as small ideas that got more complex as time pass and more and more stuff are tacked on. My advice is not picking a project based on it complexity or difficulty but really doing a project that you are interested in and learning from that.

Friendly reminder that there exists a 200 page proof explaining why 1+1=2.

If all you're doing is applying what other people have made then you're not really programming, you're just gluing libraries together. If you ever write your own non-trivial algorithms, you should be able to prove that they work.

is there a good book / reference for C# programming and learning .NET? I don't want to just learn C#, I want to learn how to develop on the .NET platform (build tools, configurations, project setup, etc...)

No but maths is literally proofs.
If you're not doing proofs, you're not doing math, you're doing computation and you might as well have a machine doing it.
As for engineers, sure they get babby-tier, engineering math (most places) but we're in a programming thread and the user you were originally replying to is studying cs, which is a heavily mathematical field.
In any way memorising the algorithms isn't enough.
If you can't rigorously prove their correctness and do complexity analysis then you're just a retarded code monkey that has absolutely no place in CS or any interesting field of tech.

You don't need a math degree to write your own algorithms.

Getting proofs drilled into your head =/= Learning how to prove they work

That's helpful. I guess my issue is that I always want to see the grand scale side to my hobbies, which can be somewhat self-stultifying. It's like, "oh you can't come up with the next big thing then why begin?"

Which is sad since CS degrees churn out the most code monkeys and most of the actual proofs for new algorithms are relegated to Masters and beyond.

>Yeah I am sure the engineers that built 99% of the shit that you are currently using know the proof behind the maths they are using when they design/build a product. Fuck off with your academic wank fest.
They probably do btw if you're not using very, very crappily engineered products as most math engineers need is calculus, diff eqs and maybe a bit of lin alg.
Proper courses on these topics have you do proofs.

enjoy rotting away in academia forever, just like ruby

Reminder that CS is not math.

>the people who derived and figured out all of the formulas that touch every aspect of engineering don't matter, only the engineers themselves matter

Proofs are taught or at least explained in Engineering but they are almost never tested since the application of formula is more important than how these formulas are obtained. Oh and you are oversimplifying the amount of maths engineering needs, depending on field alone the maths would be different, a signal engineer requires a different set of equations from a power engineer.

I don't understand why you are being so angry. Isn't the fact that I am trying to learn proofs on my own time instead of waiting for a professor to teach it to me a good thing? Like I literally can't see why you are getting so goddamn butt hurt about the subject.

Do you really need a function for it?
Do you really need that function to be in its own package?

As nice as HKTs are for C++, I don't think I've ever used one or had a use for one. I don't think many Rust programmers will find themselves too restricted by a lack of HKTs.

Thank god we now formalize mathematics in such a way that 1+1 just computes to 2 and nothing needs to be shown.

I didn't say you did.

Obviously you can rely on existing, valid theorems and whatnot. I meant proving your own algorithms correct, which I suppose is arguably an application of maths but not in the sense that most people would consider applied maths.

Programming is NOT math.

If they're non-trivial you ought to have some cs knowledge though. This includes proofs.
>Implying you can truly know how they work without knowing why they work (ie proofs).

There are thousands of "ideas" and "concepts" in academia that rot away in papers because no one test them or apply them. Guess who are the folks that field test and apply these concepts.

Then pick a project you are passionate about that can scale upwards. Doing the next big thing would make you get up in the morning to code, doing something you are interested in would make you get up in the morning to code.

why is general software development not respected? we're called "code monkeys". forklift drivers are called forklift drivers. nurses are called nurses. mechanics are called mechanics. but mention that you are a software developer and you get shit on and called a code monkey. it's just another profession, no need to be so hostile. we're not computer scientists

Because of the image software developers get. Particularly when majority of the population think Pajeet when you say you are a software developer.

code monkeys refers to UNSKILLED programmers who scrape by only because they glue together other people's libraries and could never write a library on their own.

Most programmers fall under this category, sadly.

>majority of the population think Pajeet when you say you are a software developer
>majority of the population
The world extends beyond just Sup Forums, user

Because the people doing it ought to have a CS, CE, maths, physics or other such heavily mathematical background.
I have no respect for software dev degrees or the people who hold them.

Most programmers can write their own library, they don't need to because there is an available one that is more competent than whatever they can write. I don't know why people think programmers need to write everything from scratch and if they don't they are not "real" programmers.

is semantic web a meme field? or not?

Because 'code monkies' are sitting at a comfy desk job copying/using their resources to make their job a cake walk while muhamed at MIT is working 24/7 on his theorem to prove some computational model. Guess who is jealous of the other to the point where they call them names?

Thanks user

>wow you just sit in front of a computer all day typing, thats not real work!

>muhamed at MIT
What? Muhamed isn't an indian or chinese name.

There's another codemonkey thing, "NEVER ROLL YOUR OWN LIBRARIES!!!".

Modern programming ideology shits on people inventing a better wheel for any reason.
Except in webdev, where literally everyone does it to pad out their resume.

obviously there is a spectrum. one on end is typical Pajeet or Jessica, web developers who only know frameworks and CRUD and can barely write a basic for loop. other end are your super "10x" software engineers that have dozens of side projects and can easily write their own libraries.
but I would say even Pajeet demands a base level of respect. even what he is doing requires at least a little bit of skill. certainly more respectable than flipping burgers or mopping floors.

most software development does not require advanced math and deep knowledge of computer architecture.

I don't understand this paragraph from "The Art of The Metaobject Protocol"
>In a language based upon our metaobject protocols, the language implementation itself is structured as an object-oriented program. This allows us to exploit the power of object oriented programming techniques to make the language implementation adjustable and flexible. In effect, the resulting implementation does not represent a single poin in the overall space of language design, but rather an entire region within the space.

Is it saying that the language need be object oriented. How does this lead to a "region"

Why are you getting so defensive?
Did I insult your honor?
Go learn to shit in the toilet before you get all uppity with me again.

Yes and?
The people doing it still ought to have it.

If I take two points on a grid with integer coordinates, and then XOR their X and Y coordinates together, what properties will the 3rd point have?

What the fuck is a higher kinded type and what are they useful for?
Btw I'm not an FP programmer and never used an FP Lang before.

object oriented programming? OOP is POO. go back to india PAJEET. OOP is garbage!
is that way friendo

>even what he is doing requires at least a little bit of skill.
absolutely not
webdevs are the mobile games of traditional software development

you will have combined both integers together.
you can actually swap numbers this way without a temp variable by doing
x = x ^ y;
y = x ^ y;
x = x ^ y;

You are not going to invent a better wheel when the wheel has thousands of man hours put into it from people with higher education than you and thousands of dollars worth of R&D in it.

There is a difference between "re-inventing" an open source wheel that Joe put 5 hours into making and re-inventing a commercially made wheel that is supported by a company.

I hate idiots like you who think they can waltz into a project and go "lets rewrite X library" when X library license probably cost more annually to license than what they pay you annually.

Yeah I am sure you and your CS degree can invent a better wheel. As a project manager, I have seen plenty of your kind already. You just haven't got your reality check. Maybe when you actually graduate and find a job.

At least when I say it, "code monkey" means someone on a project who isn't in charge of any design decisions and exists solely so that the designers don't have to waste time on trivial but time-consuming tasks like writing getters/setters or implementing algorithms in the language itself instead of pseudocode.

>appeal to ignorance
>appeal to popularity
>strawman
>strawman
>ad hominem

>Just yuuze boost.
>Just yuuze eigen again and again.

>FOSS == reliable

You fly in aircraft for which the control software is part FOSS.

>If its in the standard library, it is automatically superior to everything.

>I like what said about smart pointers, yet have no useful criticism of my own. We should therefore just yoooze it.

>Re-write the whole thing? B-but we spent a decade building it, and have no clear idea of what the requirements are.
ITS TIME TO FUCKING FIGURE THAT OUT, THEN.

>Unmaintainable PhD spaghetti meme code is better than any rewrite.

>FOSS saves time and money.

>e probably cost more annually to license
Okay M$,Google,Apple, and Facebook, you can go now

guarantee these gatekeeping transsexual weeaboo NEETs have never written anything non-trivial or ever had a real job in software development

I can say the same for your arguments

You're not worth responding to, dumb codemonkey.

>code worked yesterday
>wake up today
>black screen, nothing happens
and I don't remember what I did last night. fuck.

>IF YOU CAN'T WRITE A BETTER LIBRARY THAN A COMMERCIAL LIBRARY YOU ARE NOT A "REAL" PROGRAMMER REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

>No arguments because he is wrong
>Y-y-you b-baka
Post more anime reaction pictures to prove I am wrong you NEET

!5..1
calm down lad

LET ME FUCKING DUMP MY SHIT LIST HERE

>Our project uses Qt
>Our project uses wxWidgets
>We use the FBX library
>Bullet physics are accurate with smaller step sizes, NASA uses it after all!
>We use ODE, but can't figure out why our curve constraints don't work correctly, or why the whole damn thing is jittery like a pile of fucking jello
>RK4 is sufficiently accurate for orbital simulations

DONT FORGET:
>SCRUM meetings help managers and team members stay on top of project developments.
>Sure, lets just have a teleconference
>Oh, we could have just sent eachother emails instead of fucking around on webcams for two hours

No shit

If you add two numbers you combine them as well

A higher kinded type is a type constructor, like a generic.
If you think about it, a generic is like a function
Type -> Type
You give it a type parameter, it gives you back a type.
But you can have something that takes a generic as a parameter - a function
(Type -> Type) -> Type

e.g.

struct Test {
f x;
f y;
}

Just write your own library or are you a codemonkey?

Trash.

And you can also be polymorphic over higher kinded types, and have them in traits.

For example, you could say that there exist classes of containers that take a parameter for the element type, e.g. C
You can then generalize over the C, by saying
"given some container type C that supports insertion and deletion, I can sort it given that e can be ordered"

How far can I get with graphics programming if I'm stuck on opengl 2.1 because my hardware is 10 years old?

Will my software run on future hardware for the next decade?

No