/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

2ch.hk
hastebin.com/ajohalelul.java
twitter.com/AnonBabble

>js
not programming

Electron truly is the best thing that happened to the JS community. God speed user

>t. has never written a single line of code

Whoumst'd've are you quoting?

I tried vscode once and it was just a gross reimplementation of my commandline tools with unfamiliar shortcuts.
It also installs lots of shit without asking you and burning your data plan if you're on a metered connection.
Don't forget that it sends all keystrokes back for analytics, and it's technically against their software license to take the open source project and strip out all the analytics in your own "botnet-free" build.

Nice pasta.

>I tried vscode once and it was just a gross reimplementation of my commandline tools with unfamiliar shortcuts.

It has some nice built-in debugging tools. People praise it because it's not as awful as atom and not as stripped down as sublime (even though I prefer sublime).

>it's technically against their software license to take the open source project and strip out all the analytics in your own "botnet-free" build

And what are they going to do about it, if I do?

Fresh from reddit boys

What did Sup Forums mean by this?

That they all should be deleted because no SICP in OP's pic

Should I get a webdev job

I wouldn't if I had other opportunities but if it's all you got go for it

>want to work on my pretty sideproject
>can't because tired as fuck after work

The autist from the last thread that couldn't understand pointers split /dpt/ with all his screeching.

Explain to me why does Russian version of Sup Forums has entire board dedicated to programming, and actual Sup Forums that uses international language only has a half dead general?

>hmm let's take a half dead (not really) general and split it off into a whole board

>metered connection
AHAHAHAHAHAHAHA

You misunderstood my question, I didn't make that proposition.
So I guess this is the power of /dpt/

tell me what cykachan's /prog/ post per hour is compared to here.

rip /prog/

Not sure I almost never visit it. Seems like a slow board.
Also
Just found pic related there kek

how about you go back there.
I'm tired of reading broken English from ESL shitters like you and that gypsy cunt from yesterday that didn't know what cross-platform was

How about you go back

So how's life

Hiro nuked the text boards "to save bandwidth".

Is VS Code our editor?

Nearly, we just need to get rid of the JS menace.

Much higher, and much higher quality threads.
2ch.hk
/pr/catalog.html

Only FizzBuzzers use editors. IRL programmers use IDE

>threads up for 1 month+
>pretty much the same shit you'd find on /dpt/ and Sup Forums
Why are you shilling a ded russian image-board on an English site?

>IRL programmers use IDE
>t. pajeet

actual productive developers use ides

>stale memes
>this image
smells like pajeet

I'm stealing this image though

Except that /dpt/ is completely dead right now. The threads are of much higher quality as people discuss actual programming in them, and not just inane semantic arguments over whether int* is a type and why const int* doesn't guarantee immutability.

I need to get gud at Windows in the next couple of months. Winapi, d3d, nt kernel, all that shit. Any books to lurk family?

>russian comp sci
Be weary lad, they're pretty hit miss.

Dvach uses 2010 Sup Forums memes though, that's par for the course.

The absence of any book by Bjarne Stroustrup for C++ makes me doubt the seriousness of this image.

>c thread filled with beginners
>20+ threads of CS students and their homework
>most threads are sub 30 replies

i see of no quality ivan only normal low-quality cyka posting.

Fuggg you're right. Into the trash it goes

>relying on a bloated, slow piece of crap is what actual productive devs do
Alright, then.

I create an abstract class Filter
The subclasses are different filters that change a set of integers according to the the used filter: even numbers, odd numbers, greater than, smaller than etc.
The classes return a newly created array.

I wanted to create an abstract method: abstract int[] filter(int[] array);

Unfortunately this abstract class wouldn't work for the greater than, smaller than class because it needs a second integer.

Should I create a public int[] filter(){
return null;} method and override it in every filterclass?

Compared to....

a faster general of varying quality.
Now please fuck off and go shill somewhere else.

>inane semantic arguments over whether int* is a type and why const int* doesn't guarantee immutability

Varying from Poo code too shitposting...?

C++:
1985 : first book
1989 : C++2.0 / first revision
1998 : C++98
2003 : C++03
2011 : C++11
2014 : C++14
2017 : C++17
2020 : C++20

initial -> C++2.0 : 4 years
C++2.0 -> C++98 : 9 Years
C++98 -> C++03 : 5 Years
C++03 -> C++11 : 8 Years
C++11 -> C++14 : 3 Years
C++14 -> C++17 : 3 Years
C++17 -> C++20 : 3 Years

Why the fuck they have such erratic time difference between each standardization until recently??
Couldn't they just settle on 5+ years standardization cycle?

You have to be fucking kidding. There is no point for the existence of electronJS. Is just another crappy desktop GUI library.

>Why the fuck they have such erratic time difference between each standardization until recently??
People have lives. Something you don't know about probably.

>C
>1972 -> 1989
17 years
>1989 -> 1999
10 years
>1999 -> 2011
12 years

But it doesn't matter since nobody uses C11 yet as the C committee isn't insane.

>const int* doesn't guarantee immutability
It doesn't, user :)
C doesn't even treat "const int"s like constants, e.g.

const int LENGTH = 3;
struct thing {
int items[LENGTH]; // error
};


What a garbage language

>programming languages users give themselves a dumb name

Instead of arguing that there isnt any discussion about programming here, how about you help kek

...

>works on clang, not gcc
fuck standards, right?

Isn't gcc the one that follows its own standard when it comes to C?

-std=c99

>works on c++, doesn't on c.
He just dumbgoofed.

According to C11 draft 6.6#10, "An implementation may accept other forms of constant expressions.".

>People have lives
This guy sure looks like he has a life.

The max/min value would be a field of the concrete class.

Use an interface
hastebin.com/ajohalelul.java

>C failing to differentiate between compile time constants and run-time constants
Okay, but what does that have to do with immutability, tard?

void const_example(void)
{
const int LENGTH = 3;
int a[LENGTH];
for (int i = 0; i < LENGTH; i++) {
a[i] = i;
}
for (int i = 0; i < LENGTH; i++) {
printf("%d ", a[i]);
}
putchar('\n');
}
It's all a matter of scope. As long as the const-qualified variable does not belong in the global scope, you can use it as if it was a literal.

$ gcc -std=c11 gay.c
gay.c:6:9: error: variably modified ‘items’ at file scope
int items[LENGTH];
^~~~~


Apparently if I declare the struct within the body of a function, it doesn't complain. So much for C being a simple and straightforward language.

Trying to show that "const" is practically meaningless keyword in C. Mutating a const reference is also trivial

I heard strlen() use magical wizardry to search the length of string, so it will be much faster than:
size_t length = 0;
while(string[length])
{
length++;
}


Is there any other magical sorcery implemented in stdlib that will run faster than any naive implementation?

memcpy and memset are often optimized into special instructions rather than a function call

>they proceed to explain how they came up with it when they give a talk

>Trying to show that "const" is practically meaningless keyword in C
Your snippet doesn't show that LENGTH is not immutable. If I had to guess, I'd say you're one of the spergs from the last thread, and you're still angry about getting ass-raped, so you're just trying to stir shit up now.

:thinking:

Meanwhile, in sane languages, you store the length instead of using a null terminator.

static const int LENGTH = 3;
int main(void) {
LENGTH = 4;
// error: assignment of read-only variable ‘LENGTH’
*((int*) &LENGTH) = 4;
// Segmentation fault (core dumped)
}


Clearly I can't touch the contents; why won't C (gcc) let me use it as the length of an array?

>Meanwhile, in sane languages, you store the length instead of using a null terminator.
Thereby wasting space on something that is either never used, or could be computed on the fly while iterating over the characters.

>getting ass-raped
Why are you so fixated with rape and ass? Do you have something to tell us, user?

>you are always iterating over every character when you use a string

>use it as the length of an array
How is that a requirement for something to be considered immutable?

Because const variables aren't actually constant expressions, because C is garbage

>implying false implications
You don't always iterate over every character when you use a string. How is that relevant?

sure user. Lets use uint or udouble which is 4 / 2 Bytes to store the lenght instead of a single character of char which is 1 Byte

THE CHAD COMPILER

>Why are you so fixated with rape and ass?
Because raping your ass brings me joy and satisfaction.

While you guys are saving 3 bytes, I'll be here avoiding dynamic heap allocations while splitting my string into substrings

fucking everything, a better question is
>Is there any other magical sorcery implemented in stdlib that won't run faster than any naive implementation?
musl's implementation is faster and shorter

There are operations which require the length that do not require iterating over every character. In these cases a C string is inefficient.

Technically, it is programming. It's just that it's nearly always a bad choice of languages.

>There are operations which require the length that do not require iterating over every character. In these cases a C string is inefficient.
Provide some practical examples and we'll see if it's as inefficient as you claim.

why does C have structs instead of tuples? Smh

What the fuck is a tuple and why can't you just return an anonymous struct of arbitrary length?

In place concatenation.

>why can't you just return an anonymous struct
How do you declare a function that returns an anonymous struct? Type inference is a sepples thing m8

>Technically, it is programming
No it isn't.

>anonymous struct
tell me

>In place concatenation.
Of what with what? I said "provide a practical example". How does one obtain a string of unknown length in the first place without having to iterate through its characters?

first tell me what a tuple does

You would expect a language in its early years to be receive new standardizations on a consistent schedule, when it was the fucking 90s?

Two strings? It's called strcat, you might have heard of it.

literally just a pair of things.

A tuple is a struct without named fields. C doesn't need 'em.