/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

github.com/android-ndk/ndk/wiki/Changelog-r16-beta1
people.gnome.org/~federico/blog/how-glib-rs-works-part-3.html
youtu.be/rX0ItVEVjHc
youtu.be/qWJpI2adCcs
vandenoever.info/blog/2017/09/04/rust_qt_binding_generator.html
ddili.org/ders/d.en/
fuchsia.googlesource.com/
fuchsia.googlesource.com/modular/ /master/examples/HOWTO_FLUTTER.md
fuchsia.googlesource.com/magenta/ /master/docs/concepts.md
twitter.com/SFWRedditImages

...

working on my rss feed downloader in scala

Why would I ever use fclose(); after I'm done with the file?

Otherwise you'll leak the file descriptor.

Goly shit, sounds like my dream lang

can someone recommend me a good anime without sexual undertones?

thanks.

What genre?

Try Claymore

japari park

Nichijou.

Anyone else?

Is this true, dpt?

Claymore was a nice anime.

I do it occasionally when I'm not satisfied with the performance I get, mostly to check if everything is inlined.

ioccc.org/

What are you, a faggot?

A futalabi clone with newer technologies as a side project to learn MEAN like dev.

What's the best C compiler for Linux?

g++

But that's wrong

No it isn't.
Proof: I said so.

Is there any pics floating about with some programming project ideas?

Could a good programmer code straight asm better than the compiled asm of gcc?

Learning vim and C++ at the same time.

would not recommend

clang++ ofc
>gcc
Even Google thinks gcc and libstdc++ are outdated: github.com/android-ndk/ndk/wiki/Changelog-r16-beta1

>glib-rs
people.gnome.org/~federico/blog/how-glib-rs-works-part-3.html

Psycho Pass

What is that link supposed to establish?

possibly but it would take a long time

No, modern CPUs are too complex to be able to keep everything in mind, stuff like caches, reordering, branch prediction, register usage, etc. The only exception is small pieces of highly vectorized AVX code, but it's better to use intrinsics for it.

What's wrong with it?

you don't have to do that in rust

That GCC is not longer supported by Android NKD and libstdc++ is on its way out.

Looks like a waste of time, GTK is dying, Rust community should focus on integration with Qt instead.

How does Rust do deterministic resource management? Constructors and destructors?

Can I get some book recommendations on C, besides K&R I mean.

Yes, good old RAII.

But Qt is OOP, Rust isn't.
RAII

Before game release
youtu.be/rX0ItVEVjHc
>gained weight
>emotionally stressed throughout the entire talk
>coughing
After game release
youtu.be/qWJpI2adCcs
>slim
>calm and relaxed
>seemingly no health issues

Why do people want to be game developers? It seems seriously harmful to your health. You hear about the crunch being stressful but I don't see people actually measuring how bad it is.

Are there any more hardcore programmers though? I watched a GDC talk from the guy who thought up Diablo 1 and he had 8 months of crunch (wake up, drive to work while eating, work until 12AM, go home and sleep too little). He almost missed his daughter's birth. Shits crazy.

vandenoever.info/blog/2017/09/04/rust_qt_binding_generator.html

Okay so I compiled a C program but bash isn't executing it; it only returns 'command not found', even when I am at the directory of that program.

./

do ./program rather than program

the current directory is not part of your PATH

You need to type ./nameofprogram
If you just type 'program' it will look in a variety of environment variable set paths for the executable.
./ means current directory.

Okay, thanks.

Some people unironically like crunches, kinda like being at war, facing a great challenge, then come home and sleep for a week. That Diablo dude mentioned that he liked crunches iirc. My gamedev buddy tells me that he performs best during crunches. I mean, if you are young, healthy, capable - why the hell not?

Actually, GTKMM is much more sane than Qt.

Qt was implemented back when C++ wasn't really "standardized" and it has a lot of hacks around the standard C++ of today. They are so deeply rooted that they have a long way to fix those and not break backwards compatibility.

>kinda like being at war
user you'll look like an absolute psycho bringing up being at war as a positive ever.
But I suppose you're right in theory. And I don't remember if he liked it or not. Maybe.

Why are you antifa?

I'm a nazi

Bump

i am actually not sympathetic towards antifa. but i have to pretend i am or else mozilla fires me :/

No fuck off, you post this every fucking week

What's the best language to learn for beginner?
Is it C or Basic? Are they any good for understanding basics of programming?
In a long term i want to do my software for smartphones, how hard will be switch from C to Java?
What are best online literature for learning? And why is there nothing in op about learning, most of the other generals have those kind of links in their

If you want to be an Android developer, learn to be an Android developer.

If you want to make your life easier, add the current directory to your PATH. Usually you would add it to the front, so you can override globally installed commands with local ones.

export PATH=./:$PATH

That only works for that session, but you can add that to the end of your .bashrc so it runs every time you run a bash session.

Basic is a complete irrelevance.
Just start off learning Java. It's as simple as it gets while still being OOP.

>java
it has been deprecated by google. learn go, or if you want into android dev lean dart.

Huh, I thought that's what Android was all about. What's recommended now?

Java's poor OOP was difficult for me to understand in the beginning. I don't recommend Java anymore. C will make you feel that programming is tedious.

I actually suggest you to learn D, it's a fairly decent language in all categories and the books is very beginner friendly too

ddili.org/ders/d.en/

> if you want into android dev lean dart
Don't listen to this faggot. If you wanna be android dev learn kotlin.

I started with C, and I think everyone else should too. The majority of the most popular languages in use today are procedural languages with OOP features on top. C is the epitome of a basic procedural language. It will be easier to move to Java, or C++, or many other languages because they all inherit C's syntax for purely procedural code.

>is it hard to switch from C to Java.
No but it requires a different mentality where you have to accept that you won't know about all the things you'd normally know in C.
Also the way references are handled can also be confusing.
If we're going that way isn't Kotlin what you're supposed to learn? I'm not an android dev I just hear these things.

>A beginner should learn a language with no community or resources

C is meant for people giving the idea that Programming Languages hasn't evolved in the last half a century

Hi, Andrei.

>C is the epitome of basic procedural languages
No but it's certainly a very basic procedural language. All the UB kills it a bit as a teaching tool sadly. It's all very C specific.

>no community or resources
To be quite honest, the D IRC channel is very helpful, there is ZERO elitism unlike C++ or C

Don't forget about the Dlang forum, they are very patient with you as well.

android will be deprecated soon. fuchsia is its successor. it uses flutter

>elitism on IRC
NO WAY.

Trust me, user. The C/C++/FreeBSD/OpenBSD IRC have given people the wrong idea

>fuchsia
>flutter
Stop speaking foreign Steve give it to me in American.

>android will be deprecated soon

This is my first time posting it m8 but i saw one ages ago so they obviously exist, maybe make a mini sticky or something for the general that contains that crap if you get so pissed off and it shits up the thread so often

fuchsia.googlesource.com/

Flutter is a joke. A coworker of mine wasted a week on researching it.

Stop pretending to be Steve. It doesn't not make you look smart and it doesn't help you achieve anything

fuschia is operating system developed by Google for small devices.
Flutter is SDK that let's you develop android/ios applications with dart

fuchsia.googlesource.com/modular/ /master/examples/HOWTO_FLUTTER.md

Which one do you want?

Few weeks ago:
>you: has anyone got the epic programming rolle lying around?
>No
>fuck off
>you: I will post that inspire of you *posts picture*
>more "fuck off" posts
Yeah I know your pattern

...

>how to flutter
>step 1: dress like a fairy
No thank you.

struct with dynamically allocated char* or fixed size char[]?
With fixed size char array it gets allocated with the struct reducing malloc calls. But the structure size is bigger, could it be worse for the cache?

not an argument. android will be deprecated soon and fuchsia uses flutter for its ui

That is probably my only reservation. I'm kind of pissed that the community decided to go with "leave the UB in and spend god-awful amounts of time developing UB sanitizers" instead of saying "fuck the standards commitee" and making a UB-less variant of C. I mean, how hard would it be to modify something like tcc for a formal demo of a UB-less C variant? After that I'm sure Clang and GCC would implement it. SafeC is a plenty good name. It would still be able to be ABI compatible with legacy code. I truly don't understand...

That's literally not an argument as why it shouldn't be taught as a first language. Allowing people to see how progress is made through abstractions allows people to understand why are how those abstractions are made. Thrust them into modern (as in template-abusing) C++ and they will not learn a goddamn thing.

Use a flexible array member if you're not keeping the structs in an array.

>not providing C API for native GUI
It's as bad as android at this point
>android will be deprecated
even if google stops supporting android people will still be using it and developing for it, too much existing software.

magenta is superior to linux though.
fuchsia.googlesource.com/magenta/ /master/docs/concepts.md

>That's literally not an argument as why it shouldn't be taught as a first language.
When people are taught Biology, they aren't required to major organic chemistry first. Don't be a fool, there is little or no reason to make people go though the history classes of how science has evolved.

The top down approach is much more intuitive and doesn't make people loose interest

lose*

Fuck off, idiot

>he gets triggered because someone said that linux is shit
poor babby. fork and exec were a mistake.

It's alright m8, thanks for the info. Was looking around the internet last couple days and only found other peoples projects, thought Sup Forums's stuff would be on everyone hard drives and not floating about
Nope, i have the shit now so wont ever need to ask again
Heres some advice m8, next thread just copy paste

What are you working on, Sup Forums?

Old thread: >>
>Sup Forums Programming challenges available on google image search

First off, stop pretending to be steve, and second of all stop attention whoring you pathetic fucking trash

stay true

#define NUM 50

int array[NUM];
How many elements does the array have? 50 or 51?

>The top down approach is much more intuitive and doesn't make people loose interest
Wrong and idk, I wouldn't agree. All things are a sum of parts, if you go top-down you only understand how one thing works. If you learn bottom-up you understand the parts and have the ability to see how different combinations result.

>When people are taught Biology, they aren't required to major organic chemistry first.
I honestly wish it was. Biology is a shitfest of pure memorization. That class is what made me switch to CE. Smart people can't do much with memorized facts, they have to given understanding.

50. From 0 to 49.

50.
So it would be invalid to do this.
int array[50];
array[50] = 10;