/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread: >also, ITT: Why haven't you come to your senses and embrace C# as the king of programming languages?

Other urls found in this thread:

godbolt.org
twitter.com/SFWRedditGifs

OP is a POOfag and C# is just Java++.

c#?
OP is a faggot.

þe mæst good bitreckonerspræc for leornian in 2018 eart ænglisc idris.

Megan gets the job because she's a woman.

>bitreckonerspræc
this is some uncleftish beholdings tier shit

C# is trash.
LINQ is trash.

why didn't you add this
to the OP?

yeah!

Is there any fucking difference between writing
inline bool isEmpty() const noexcept {
return this -> _head == nullptr;
}

and
bool isEmpty() {
return this->_head == nullptr;
}


Do these qualifiers like inline, const and noexcept even matter? Speaking about const, I mean type qualifier after function, and not about variable defintion, etc.

They wouldn't be part of the language if they had no effect.

inline means the symbol will have vague linkage so it can be used in multiple translation units, which makes it much easier to inline a function used in multiple translation units.
const means that the member function can be called on a const object.
noexcept means that it won't throw (if it does, std::terminate is called)

godbolt.org is your friend.

func() const is useful if you ever need to use a const instance of that class; you can't call non-cost methods of that class in that situation. "noexcept" probably doesn't do what you think it does, I don't use it. "inline" also has a tricky meaning and you don't need it most of the time, mostly only when implementing functions in a header.

yeah, like this guy said

to graduate and have enough knowledge for a good tier job:
how well does one need to know programming?
a) really good at banging out code?
b) talk eloquent about the principles and shit
c) both req'd
d) neither req'd
e) _______________

e) quick at copypaste

I would expect both. Theory is useless without code and code is shit without theory.

e) ænglisc scile

e) wear socks

dumb fag can apparently read english, but replies in irish such a soyboy thing to do

>wear socks
recommend me some /dpt/ socks

That's Welsh you shitter

>irish
hwæt

>ænglisc scile

redpill me hardcore on C Hash

the red pill on C hash = it's shit

e) is able to write and explain bitonic sort on a whiteboard when asked

Easy starting lang. Good balance between low-level C meme and memelangs like crust and shit

Lad, I know what Irish looks like. That isn't it. Google Translate isn't perfect.

handle hit ne, for hit eart þe feondes bitreckonerspræc

what's the upper level of learning programming language by yourself?

contributing to open source projects

Agda is a great language to learn.

Depends on your IQ

then your welsh is so bad, that this is the result

test

Thanks doc

Yes, Megan?

not meant for consumption, just need to link it from the g board.

in 10 years when it's actually at 1.0

What the fuck is Google Translate doing?

He's writing in pseudo old english.

Welsh is just shitty Irish, so it makes sense that you confuse the two from time to time.

Yes but the translation is completely wrong.

That's because it's not actually old english and words like bitreckonerspræc don't exist.

Hear undernead dis laitl stean
Lais Robert Earl of Huntingun
Near arcir der as hie sa geud
An pipl kauld im Robin Heud
Sic utlaws as hi an is men
Vil England nivr si agen.
>back to /lit/

kill yourself faggot

...

I am VERY confused about this code

#include
#include
int main(){
int a;
int* p;
p = (int*)malloc(sizeof(int));
}

So if the return type of malloc is of type (void*)
Why should I cast (void*) as (int*).
Should not p treat that address (void*) as an int* anyways!!!!!!

code tags

That would be true if C# was much better or much worse, but it's just mediocre.

Are tech jobs only 1 year in the US?
Here they have do complete a apprenticeship and school totaling in ~ 3-4.5 years
They usually get paid while working although a lot less than people who have completed their training.

simply, gorgeous!
I

you don't cast malloc nigger

Because she sucked off the hiring manager.

Forgot that part.

It does in C, it does not in C++.

It wasn't me it was a youtube tutorial and I don't even know what you're talking about. Just answer the question...

what the fuck is a malloc?
please?!

this is not me I am tanis c++

A function that allocates memory and returns a pointer to the start of the allocated memory block

it returns a pointer to however much memory you asked for.

Malloc return the location of the allocated memory you requested. You store it in a pointer. That's it.
No more spoonfeeding your retards. Figure it out yourselves

retard lmao

not sure what that means...
but /sounds/ like it is NOT a part of C# - right?

halpOk so let me know if I am correct...based on what you said..

in c++, if i have type int*, and I feed it an address... that address MUST be of type int*? and this is the sole reason we are casting here ... (please disregard the codes usefulness i can't remember where I got it from)

I'm going to a technical college in Canada. Courses here are generally 1-2 years with options for extending courses if you can't be a full time student. I know the sheet metal fabrication course is one year. There's a course on electronics repair that's one year. My course is two years, I've only finished my first semester and I've already been scouted by Michelin and they gave me $3k and a job in the summer.

>if i have type int*, and I feed it an address... that address MUST be of type int*?
>and this is the sole reason we are casting here
Yes

Also for the record, in C++, you should be using "new" instead of malloc. The code you posted earlier should be more like
#include
#include
int main() {
int* p;
p = new int;
}

There is no retarded scrupulous memory-managment in C#, it has GC that does it for you.
That being said, if you REALLY want, you can use unsafe codespace and pointers

>he can't into selfteaching without paying useless tutors
TOP FUCKING KEK
You should stop now user

It might be a part of C#'s unsafe but it's not something you usually do.

thanks.
are these other things not C# as well?
monad
lambda
tuple
sepple

Ok.
So let me know if I am correct...based on what you said..these are my assumptions

1-malloc(size(int) actually allocated 4 bytes of memory and returned the first bytes address?
2-then why is it returning a type void* why wouldn't it just return a type int*
3-i should be using the new keyword which will infact instead of returning void* will return int*

t/f?

>sepple

This is user's wife, you caused a seizure. I have your information and have called the police to report the assault.

Technically it is a part, because it supports it. Do you NEED to do that? No.

That's it I'm filtering you you fucking useless retard

>2-then why is it returning a type void* why wouldn't it just return a type int*
malloc doesn't know anything about types.
malloc(4);
What is the type returned by this? There's no reasonable answer.
>3-i should be using the new keyword which will infact instead of returning void* will return int*
This is correct. operator new is smarter and is aware of types.

>lambda
>tuple
C# has both and quite a bunch of tuple variations

>monad
There are nuget packages that realize such functionality

>sepple
not familiar

>malloc(size(int) actually allocated 4 bytes of memory and returned the first bytes address?
Yes
>then why is it returning a type void* why wouldn't it just return a type int*
malloc has a single type signature and must always have the same return type regardless of what is being allocated. It also has no knowledge of what type you plan to store in the data you allocated. malloc only knows how many bytes you wanted allocated and allocates it.
This works fine in C, because you can implicitly cast a void pointer to any other pointer type. C++ is stricter about the implicit casting, but it doesn't matter because you should almost never use malloc in C++.
>i should be using the new keyword which will infact instead of returning void* will return int*
Yes

>lit
I do feel lit when i see a cuck language nobody cares about.

*passes a function as a first order object*

The true solution to memory allocation
template
T *malloc()
{
return malloc(sizeof (T));
}

apologies and Sonkei
My tutor hasn't responded to me and i just started studying yesterday
-tanis

I took the education for electrician.
It was 4 years in total, with yearly incremental pay from the company I trained at, I got about $12k/year to $20k/year when training regardless of when I was in school or not.
The school consists of 1x20weeks course before you can get started and 4x10weeks follow up courses which is placed about once per year.

Are we starting language wars again?

*passes a polymorphic value as a first class object*

Yes. all C-eninle should be moved to /lit/

*passes a programming language as a first class object*

*parses a programming language*

thank you
Sonkei
-tanis

*Uses an arrow in place of a monad*

Wars require two war-ready forces.
What i wage with you is not a war, but a simple and inevitable one-sided genocide.

Is Rust the ugliest language?
fn map_rss_url Result

>rhetorical questions

*-XTypeFamilies -XTypeInType -XConstraintKinds -XExistentialQuantification -XMultiParamTypeClasses -XGADTs*

lifetimes are the worst part here
Is there a reason why you need the empty pattern in lambdas? Why can't I use ||
The rest is pretty good

Rust, Erlang or PHP

oops, Ocaml* not erlang

No, you cannot use ||. You'll get the following error message:
error[E0593]: closure takes 0 arguments but 1 argument is required
--> src/main.rs:31:10
|
31 | .map_err(|| url)?
| ^^^^^^^ ------ takes 0 arguments
| |
| expected closure that takes 1 argument

Oh, I see. Yeah that makes sense.