/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

imgur.com/a/RTFeJ'
twitter.com/NSFWRedditImage

This thread is 5 seconds younger. Praise anime!

C# is glorious.

Fun to write in, easy to get shit done.

You cannot dispute this without resorting to memes.

But it is limited to MS platforms.

Wrong

Not my fault OOP has become a meme. I like OOP in some cases, but not when OOP is forced on me by the language.

It runs like shit on anything non-windows.

C# is multi-paradigm, and can basically be written straight procedural.

How?
It's not as wide as Java,
it was partially open-sourced only a couple of years ago,
WPF is still closed.
For cross-platform development it's not a good choice.

But the standard library is OOP and you can't even have simple things like global variables without a retarded OOP wrapper around them.

The performance is fine.

Considering arbitrary benchmarks for trivial computational tasks is useless. These types of things ought to be abstracted to a C-lib when necessary.

>What are you working on, Sup Forums?

Just restarted my NVMe stuff from scratch, so now I'm working on a userspace NVMe driver using sysfs and will eventually do some fancy stuff with the GPU (perhaps hosting IO submission queues in GPU memory)

If you're referring to writing a cross-platform user application, Java isn't a good choice for cross-platform GUI development, either.

This marketspace mostly belongs to totally-not-web-browser-based GUIs running on Atom and its ilk.

How many nested functions are you on right now?

17

Like, maybe 5 or 6 right now, my dude.

>But the standard library is OOP
How does this affect the way you use the functionality in the standard library? Can you give a code example of how you would write something and how you think it should be written?

>you can't even have simple things like global variables without a retarded OOP wrapper around them
Can you give an example of a global variable you would want in a non-trivial application? These are generally dubious at best, and one ought to stake a flag next to them describing their exact behavior if literally every bit of code can access it in some way.

>totally-not-web-browser-based GUI
But it is too heavy.

Does "2GFY" mean "to go fuck yourself"? English isn't my first language. Does it mean anything else?

>too stupid to understand API documentation as-is
>start using lazyfoo to learn SDL2 again
>80% of code is dedicated to error-handling for errors that will never happen
>10% is redundant code to make things "easier"
>the remaining 10% is actual learning material

I guess I have no right to complain since it's the only tutorial easy enough for me to comprehend, but Jesus Christ
I just wish there was a middle ground between "You'll only understand this if you already know 90% of it anyway" and "I'm going to repeat this core concept for the 6th time in case you didn't catch it"

I've never heard anyone say that. It could mean anything.

I think Urban Dictionary has more information on that.

consider writing your own layer of abstraction between sdl2 and the rest of your program

if you "just" want to draw a texture at a point in the window, write MySDL_DrawTexture(Point position) or something, and then do what you need to make that function work as expected. repeat for common tasks until you're where you need to be

Alright you autist why are there 2 fucking threads?

Name one (1) number

This thread was made earlier, why are you asking him?

you are not by any chance my boss are you?

Solve Problem Euler on your own.

5226

Question for andriod app devs

Can I use resources for my app that were released after the current level of the API? For instance SMS manager is the go to way to send text messages for your app but it was released with Kitkat.

Can I still use it and have my app be compatible with the pre-kitkat android users out there?

RAII is programming god-mode, prove me wrong /dpt/

I am too intelligent to know what is that

a ruff victory

Doesn't change that it's the standard now.

No, but you can try if the support library has a backport available.

How does anyone here even start a project? I don't even know what I want to do.

From an idea.

It helps to have a job or want extra functionality from something.

open notepad.exe
write your program entry point function
save to a folder
compile
>inb4 interpreted shit
write more if you want to

$ curl -s 'imgur.com/a/RTFeJ' | grep '^\s*image\s*:\s*' | grep -o '{"hash":"[^\"]*","title":"[^\"]*","description":null,"width":[0-9]*,"height":[0-9]*,"size":[0-9]*,"ext":"[^\"]*"' | sed 's/^.*ash...\([^\"]*\).*ext...\(.*\).$/https:\/\/i.imgur.com\/\1\2/g' | xargs --p 16 -n 1 wget -q -nc --show-progress


this oneliner rips lewds from a hestia album
does this count as programming or degenerate pajeetery?

typo! the xargs args should be
xargs -P 16 -n 1 wget -q -nc --show-progress

You're like a little kid, watch this:

Pajeet of a code P(c) ~= (number of regular expressions in c) ^ 3

sorry user

oh no

Bored out of my mind and I want to program something. Someone post some non retarded challenges? Networking? Implementing application protocols(already did most of the popular ones)?

http server in haskell

A timetable parser for the Untis timetable web frontent. They use HTML 4 and earlier, and it's completely malformed. They open tags they never close, they nest tables in tables and other tags in which they aren't allowed, sometimes you'll find random characters in between the tags (like ``) and they create new tables with redundant empty tags in them to create spaces. Their timetables are defined in rows, not columns. If a lesson spans over multiple rows, it is done via an attribute that defines it's height in the starting row, the rows afterwards it isn't mentioned at all. That means that you have to keep an array with counters you check and reduce on every row, and increase the index manually if one of the lessons in the previous rows spans into the current row, else lessons will shift to the left and end up in the wrong days. Additionally, for every row with content, a useless empty row follows, except on the first two rows, which both have content. I recently found out that lessons can also be split into several sublessons that can span different row heights. One would think that they'd achieve this by using nesting, but in fact they just define the width for a double split lesson as half the width of a regular lesson in the root structure. I'm starting to question my life choices.

Write a program for a problem you face. Automate something that annoys you every time you have to do it. Write a helper program that assists if automatization is not possible.

You basically have to have a menial job for this, though.

Mine is called school

>CLR based
D is better in that regard

My brain has been fucked, what should I do?

MMORPG in ASM x86

>2017
>x86 assembly

I like the way you think user

brain surgery

Not an argument, unfortunately.

Cross-compiling is a fucking pain.

>Doesn't change that it's the standard now.
The good thing about standards is that there'll be another one along in a few minutes.

Yeah, it's funny how all you are actually doing is writing the assembly for different language. That should be that hard.
Still wondering why there isn't compiler that you cant just give source code and you could just pass paramere --arch=arm or something like that. Of course dynamic linking would be little problem but can't fall to that can it?

Many modern languages like Go and Rust already do that, but only if you don't link against any C libraries. Then you're back in cross-compiling hell.

It's not a problem with Java.

Daily Daily Reminder

You all could be making web business apps and make a lot of money

I'm building for desktop PCs, not Enterpriseā„¢ servers. Those won't have 50 GB of RAM just lying around.

>You all could be making web business apps and make a lot of money
But who will pay a lot of money if all programmers will make web business apps?

>make a lot of money
not in canuckistan, user

>abstracted
This word needs to stop being used, it doesn't mean what people want to say when they employ it.
>C-lib
You mean Fortran, right?

medium to large businesses for IT solutions to reduce their costs in business

Can anyone recommend me a good WPF book to help me pick it up in my free time and use as a desktop reference at work?

>prove me wrong /dpt/
You don't exactly control when your memory gets freed. If many containers go out of lifetime at the same time it can introduce a nasty pause in your program.
But I agree it's very good for non-real time applications.

How do I speed up computation time in C++? Is overclocking the only way?

If you use classes as array of structures change it to a more cache friendly layout.
Remove virtual calls as much as possible.
Which brings me to the next point to put templates everywhere instead of inheritance to make as much shit as possible get optimized at compile time on top of no longer having any sort of semantic completion for your IDE. Once you've done all of that, kill yourself when noticing how dumb and ugly C++ actually gets when you try doing high performance computing with it.

Basically the story of my life.

-O3

yes, overclocking is the best way. most of my programs automatically overclock until the user's cpu is running fast enough

What's the price of your soul?

I have some other tips but I need to know how your program is structured if you want me to give you more ideas.

use C/C++ with unity build strategy
or just don't use sepples

Don't use classes you kuk

working on a list of different kind of ways of committing suicide, since I decided to get a job in software development.
More recommendations are always welcome

>You don't exactly control when your memory gets freed
you can if you need to. one easy method is to push objects slated for deletion into a vector of shared void pointers and then prune or clear the vector when convenient

build the first AGI with no ethics or alignment to humanity

How do I come up with an abitrary meaningless name for my ML-clone language? I just want to get coding but I can't set up the project / git repo / namespaces without a title and it's annoying as fuck

MLess

Serendipity
Start coding

Lambda-lang

I'll start on the logo

PHPScript

What are the objective benefits i would get from using C++ instead of C?

+ and +

>objective benefits
very funny

MLady

templates

>undefined behavior
ishyggy

struct {}; instead of typedef struct {}; is a little "nicer," unless you're linus

function overloading is nice

kek someone do this

...

>typedef struct {};
doesn't compile

shorter syntax on some declarations
other shit only niggers care about

A few things that won't kill you if you use them:
- Function overloading.
- Operator overloading if you only use it for aggregate types is very nice as it doesn't create 50 objects behind your back.
- Templated functions allow for some compile-time optimizations you wouldn't get from C if you had to throw function pointers instead.
That being said I like using the meme that the only "sane subset" of C++ is C, but you still have a few nice features some of which I mentioned.

kek someone do what this guy said

kek this