/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?


Previous Thread:

Other urls found in this thread:

jimmycuadra.com/posts/the-highs-and-lows-of-rust-2017/
en.wikipedia.org/wiki/Floating-point_arithmetic
twitter.com/NSFWRedditVideo

Friendly reminder that programmer work will become blue-collar work with matching pay within 10 years.

First for Fortran.

jimmycuadra.com/posts/the-highs-and-lows-of-rust-2017/

I'm working on a game. But I'm stuck doing unity tutorials for now.

I want to design so bad but sitting down to learn from videos just kills my motivation. I can "design" all day, but sitting down for a 20-60 minute video tutorial totally ends my progress for the day. :/

Why does storing floating point numbers in a database always store numbers which are off? I've tried double and long double, but still get weird stuff like 1.23365 gets stored in the database as 1.2336499999999999

en.wikipedia.org/wiki/Floating-point_arithmetic

congrats on learning that life isn't some fairy tale and shit takes hard work

why would you assume he didn't already know this
not him but i am also a game designer who dislikes having to do hard work
and i should certainly know how i feel about hard work because my dad was really abusive and it was hard work just to live in the same house as him

Right but that's not the problem, its something to do with what I'm doing because when I load the database directly it stores the numbers correctly but when I insert through C++ it stores these.

DRY philosophy is trash

Finished writing my kickstart script so provisioning all my servers will be less tedious now. Wish there was a way to ID network interfaces non-interactively.

>spent a month writing C# app
>run a memory analysis tool
>see all the garbage that .NET is throwing up
>look at .NET socket implementation
>the lowest possible socket connect call accepts IPAddress as input and creates 2 classes just to connect, instead of just writing the IPV4 long to native
>realize C# is a horrible language made for enterprise shit

>C#
into the trash

what language would you prefer?

Rust

What's the most mind expanding language you guys ever learned?

I've been trapped in an IT groundhog day for the past couple years and too high to google. If I've only used C#, java and TSQL (not the same, I know); what's a good motivation or two to jump to rust?

C, change that to mind narrowing

Go to their official website and check out yourself?
It's basically no GC no manual memory management tier language that has nice FP niceties

rooby

Python I suppose. Freeing might be a better term.

Haskell without a doubt

>freeing
>his language cannot even mix statements and expressions
kek

Don't laugh:
Ruby.

On the surface it looks like a shitty Python clone,but it has so many crazy features and the meta programming is the best I've ever seen in any language.

2nd place is probably Assembly or C because of the "how computers work" meme.

>Haskell
>literally a makefile lang
kek

I only knew java :'(

what is the hardest practical programming language

I took a look at rust and their std::net which doesnt even support async tcp?

Practical programming languages aren't hard to use

my boss has pretty much refused to give us all of the project requirements up front (because he doesn't even know what he wants) so every time my boss proposes a new feature it requires a huge rewrite of the whole system because we had absolutely no idea that he wanted that feature

so i'm doing one of those rewrites.

i've been putting applications in everywhere with no calls.

module Ruby
def method_missing(name, *args, &block)
define_method(name, &block)
end
end
previously_undefined_method do
puts "please kill me"
end

stop watching videos and read a book. videos are the worst way to learn and you should only use them if you are incapable of reading

shit that should be module Kernel not module Ruby
anyway my point still stands: it's a smelly poogarbagelang that doesn't want to exist

How so?

It's pretty smart to know where to look when something doesn't work. Also code duplication is a bad thing.

Of course every "pattern" can be misused. But it's similar to OOP, MVC and GoF stuff: know when to use it and when NOT to use it, and you'll be a good programmer.


C++

You're being paid to write software.
The fact that you're complaining about throwing out work means you're becoming attached to software that you're being paid to write, it's NOT yours, deal with it.
If your company wants to keep wasting money and developer time rewriting the application over and over again, let them, it's not your problem because it's not your code.

what do you guys think of j, apl, and other array languages?

>and developer time
This is the problem.
He is the developer whose time is being wasted.
The fact that it's not his code is irrelevant.

Aren't you being paid to shit out code?
You're being paid to shit out computer code, just write garbage if you know it's gonna get throw out anyway.

>pffrrrrt

yeah when my boss wants new features to be rolled out on a weekly basis, each requiring a complete rewrite of the entire front-end of 3 different websites, and i'm the only one working, it's a bit stressful.

when i say i'm the only one working, i do mean that i am literally the only person employed on the dev team at this company. i do not have a single coworker until the end of august.

so i'd say i have the right to complain about throwing out work when even more work keeps getting piled on. i also have the right to tell you to go fuck yourself. deal with it.

I've only messed around with J for a few hours and it was pretty fun.

>know when to use it and when NOT to use it, and you'll be a good programmer
pretty much, but DRY is being sold as a holy grail, every book and novice tutorial has it right after helloworld, when in reality it's easier, faster and less bug-prone/more future-proof to write multiple special cases vs one that tries to cater to everything.

It's your own fucking fault if you're letting work pile up exponentially because you're too autistic to communicate to your boss that every feature addition means a total rewrite.
If you're really the only dev, they're not going to fire you because it would take longer to hire someone and get them up to speed.

What's your point?
That you can abuse things?

"Method missing" is pretty dark magic, but you can use it for some special purposes.
A thing that comes to mind is an object that delegates calls to a sub object (as "proxy" or "adapter")..

Or if you want to build a testing suite, it can be pretty useful.


It is far from smelly. It is a very good engineered and designed language.


The greatest things about Ruby is that it's such a versatile language. Super comfy for scripting and web stuff is crazy easy. Not only websites, but you can make a webscraper or an API in no time.

But yeah, Python or even Perl can do this, right?

What makes Ruby really stand out is that it's basically "building material". It's pretty much an OOP version of LISP.

You can use it and simply make you own domain specific language. Look at RSpec, Chef, Puppet, Rails or Metasploit to know what I mean..

i did not help create the initial product. i was hired when they had one working site and were expanding to 3. then all the other devs left for internships elsewhere for the summer.

up until now, most of the new features were just small additions that didn't require any rewriting. anytime my boss proposed a feature that did require a significant rewrite, my coworkers would tell him it wouldn't work yet, and put it off until later. well, it's later now, and i'm having to do the rewrites.

all of this would have been avoided if my boss knew what the hell he wanted, and gave us the full list of requirements and features that he wanted the sites to have, instead of giving us this stream of information over time.

you can also use method_missing to create a class that implicitly has attr_accessor for all possible member variables

Of course.

I do not trust any "hoyl grail" anymore, when it comes to programming.

I don't do tcp, ask in their IRC

Is GDI+ still a good option for custom controls in C#? I'm looking into making a syntax-highlighted text box component and I don't want to build it off a TextBox/RTB for performance's sake.

How would you go about doing 2D platformer collision between an entity and the world (static tiles, dont move) and solid entities (most likely static but can move).

There AABB, but how do you ease the load of the program so that it only looks in the radius around the entity?

Using horizontal movement for the question, flipping row and column around would be for vertical movement I suppose.

Do you go down every pixel row, and on each row, check so many column pixels in the given direction and skip checking collision if it is "out of bounds"?

WPF. Look at ActiPro/DevExpress components

I'm not GNU. I'm just Harry

Make a grid? Then another one? Split screen in 4 parts, then those 4 parts in smaller 4?

>WPF
Yeah, no

Hairy*

>ribbit the reddit frog
>>meme
>"""comfy"""
>>web """stuf"""
>ribbit spacing
I don't want reddit stink nearby. Fuck off.

>being this autistic

Shut the fuck up you autist.

What OS do you use and why?
I'm just trying to get an idea of what most people use. I'm tempted to go to Windows from Linux since I'm still learning Linux.

It's called hit enter to make it more readable, dicktits

@61035247
It's attention whoring. You're artificially increasing the vertical space your post takes, so people can see it easier.
If you actually paragraphed your shit properly, that would be much easier to read.

Entity vs. world: plain grid
Entity vs. other entities: quadtree

Not programming related, you fucking retard.
Use

why do haskell programmers get ALL the girls

it's a bot

>recommending the thread that is literally called faglet

STRONG typing

the worst part is this:
it isn't

It's hardly better than blue collar work today. Pay is better than a lot of desk jobs I suppose but no one ever made any real wealth though a dev job, just a comfortable salary.

rust more like bust lmfao

I don't care what fucking thread you use, I just don't want your ilk nearby.

>ilk
why don't you go "ilk" yourself

That wasn't me. I asked the original question.
Sorry.

Ubuntu MATE

does a quad tree apply to the world as well?

how difficult is it to implement a quad tree?

Not programming related, you fucking retard.
Use

>does a quad tree apply to the world as well?
It could, but it's needless if the world is tiled.
>how difficult is it to implement a quad tree?
Not that difficult at all. It's pretty much just a binary search tree, except that the keys are coordinates, and accordingly the key comparisons are done on two axes instead of one (hence why four quadrants are necessary instead of two halves).

>new has better audio quality than malloc
Applause for C++ programmers.

Indexer, Private Tracker, Stats, auto-curation. All in docker or serverless. bundled to create everything from single compose file. uses offsite object store cdn to serve .torrent files. Working on a seedbox w/ a transcode detection bot now.

Not programming related. Use some other thread.

61033365
this fat fuck is the next step of perfection

Do you browse /agdg/ by any chance?

I'm not subhuman, so no.

Funny, we had one autist there too that would reply to every single post he didnt like and say "not game dev related

It sounds like this person is loading files off storage for every fill of the soundbuffer. That'd explain why he thinks things are better now that he put it on a ramdisk and found a more optimal memcpy.

What a horrible programmer. It could of course just all be placebo and almost nothing changed. Since they're audiophiles.

>level design is not game dev
>mixel art is not game dev
>source.jpg.png.gif

I'll go ahead and give you more benefit of the doubt than you probably deserve. Explain to me what is not programming-related about implementing indexing and sorting algorithms for an infohash indexer?

@61035703
Oh, so you're one of their kind. Don't reply to my posts again. I don't want to be associated with your ilk.

>@

Nothing in your post talks about that. Your post might as well belong on

@61035736
I'm sorry, but you must be confused, redditor.

I don't tend to want to exclude people but in this instance I agree.
I'd probably just walk away if someone spoke to me like that in person.

Do you know what an Indexer does?

>I don't tend to want to exclude people
Your wishes are irrelevant. Non-programming discussion simply doesn't belong here regardless of what you or I think.

Lua a shit.

How do you structure a python project? There's a million different ways that I've seen people do it online, and I've never really made anything substantial in python, so I'm not sure what the best way to structure the files is.

Your post doesn't talk about programming. More than half of it is entirely unrelated garbage. Feel free to delete it and make an improved version.

in real life he's a sweaty weeb you just back-hand him to the floor.
clearly on his period too

Point to the rules user.
I agree but we don't have a rulebook AFAIK.