/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

tutorialspoint.com/cprogramming/
programiz.com/c-programming
pastebin.com/D5jgVdxQ
pastebin.com/taDtc2BV
stackoverflow.com/questions/4603717/stopping-function-implicit-conversion
drawy.io/r/ssezs6c3ejh29xuw
twitter.com/SFWRedditGifs

First for D

nth for b

refurbing a macbook pro to resell. switching out dvd drive for a hdd caddy. bought a new battery off ebay, etc

Lisp is the most powerful programming language.

That's not programming you mong

It can't even solve its own halting problem. It's garbage.

What languave can sol e its halting problem?

Any total language. But they are all trash.

Any non-shit one can do that trivially.

Are this languages memes?
>GoLang
>Rust

Yes. The only programming languages worth learning are JavaScript and Java.

Both are, yes.
One for being good or useful over anything else.
The second for already being c++ levels of bad in its infancy. And the daycare mentality of its community.

What is this non-shit language?

wew
not being*

name one(1)

What happens if we remove pointer arithmetics from C?

Any language in which you can write only terminating programs.
λΠω and anything based on it.

Halting problem is unsolvable on any turing machine. Non-turing complete languages are garbage.

>Non-turing complete languages are garbage.

I'm studying C in-depth. I'm doing my own DS libraries and I'll start my final project from college soon. Also solving coding challenges to train for the programming marathon, which will happen later this year. Studying C using Ritchie's book made me realize how shitty my programming teacher is.

If a language isn't useful, it is destined for the trash bin.

getting naked and playing in the sun

I've been assigned the task of building a secure browser for work so new hires can't watch YouTube all day.

>useful
For whom? In what way?
Saying "useful" without any further clarification is pretty retarded, since you could easily claim that absolutely anything is useful.

Non-turing complete languages are useless for everyone.

first for Go

javascript is the same as java dumbass

@60025945
There exists at least one person who finds them useful, therefore this is false.

This is completely impossible.

Can't they just block websites like everyone else?

Anyone know of any good resources for starting out with C? I learned python for about a month, this last few days I've been learning c++, but after reading about C, I really want to give it a try. I think it will give me a strong understanding of the fundamentals to build off of before I go to college. I talked to a guy in the comp sci program there, apparently they start with Java, which I figure will be a walk in the park if I can get a decent foundation built before the semester starts.

Picture not related:

>This is completely impossible.
I think you need to re-examine your assumptions.

>tfw paying $20/month for Codecademy Pro
>tfw realized that there are tons of step-to-step codecademy tutorials on youtube
at least i get the extra practices and an access to a tutor, shit

Why on earth would you do that? Also, by doing that, you would literally make arrays useless.

I don't need to, because the assertion is obviously true.

Perhaps if you're using some retarded definition of "useful". You haven't defined it yet.

>Non-turing complete languages are garbage.
explain

Non-turing complete languages do not follow any universally accepted definition of the word "useful." They serve no practical purpose. Therefore they are useless.

tutorialspoint.com/cprogramming/
programiz.com/c-programming

Here you go fukboi. Get cracking

Post the exact definition of "useful" you are using.

>SQL

I like your take on anime picture thread OP

I'm not doing your work for you. You're an adult. I do hope you come to this realization eventually.

I see, so you can't even properly define the things you claim to be true. As expected of a subhuman.

You can put your head in the sand and pretend it cannot be, but eventually you'll have to accept reality.

@60026154
this pic is really really cute

Thanks!

>you would literally make arrays useless
Well, leave pointer arithmetic for arrays only?

right now I'm designing a heap in C++ using vectors and string rather than int and I have no idea how to implement it, do i just use void Insert(string element) rather than int?

if i hate CS in university, will I hate the CS jobs for the rest of my life? I don't know what else to do though.

Yes.

damn i don't know what else to do though.

i really wish i went into engineering instead, i could've done chem eng

Not necessarily, they are different kinds of bad.

can you share your experience?

Then you would remove the ability to pass an array to a function and use anything but the first element.
I don't know what you have against pointer arithmetic. It's just something that beginners/idiots complain about because they don't understand it or why its useful.

Don't do C, it's old and nobody uses it.
Use C++, its old and everybody uses it.

>American education

I find ASCII useful, and it isn't Turing complete.

Provide a "universally accepted definition" of the word "useful".

>not using templates for your data structures

>nobody uses C
t. Microsoft

Did you reply to the wrong post?

pastebin.com/D5jgVdxQ
The assignment doesn't want me to use templates, i get an error when i try to use void insert(string element) also

What went so wrong? Why is Pascal not popular anymore?

Is it worth learning Rust at this point? Are they still breaking syntax or have they settled down? Also anyone have the git themed expanding your mind pic?

becase its shit

Since v1.0, they have been retaining backwards compatibility

You have to be at least 18 to be posting here. Get out.

>lisp is good because its old

Who the fuck would use C? If you are not burdened with using legacy codebase there remains 0 reasons to use that garbage

>0 reasons
You clearly know nothing about C and why people use it.

>le good
>le shit xDDddDxD
Oh? Let's hear your reasons for using it.

Does your mum know you browse 4chen?

>le

I came across this snippet in python and am absolutely mystified as to how it works.

Supposing that types is an array and x is a list of strings equal in length to types. Each entry in x corresponds to an entry in types and only one will be a non-empty string.
the next() call returns the index of the non-empty element in x, which is then used as an index for types.
types[next(i for i, e in enumerate(x) if e)]


As far as I can see next() takes an iterable object and optionally a default value to return if the end of iteration is reached. The arguments given here really don't make sense to me, and yet it works.

Why are you linking me to /r/?

Python was a mistake.

>types[next(i for i, e in enumerate(x) if e)]

Looks cool post source?

I'm just going to bring up the simple (and extremely important) thing C has had over every other language, and that is a feature that so many other languages seem to miss for some reason:
It has a stable ABI.

>His language doesn't even have Generics
Is Go and C meant for brainlets?

>What is void and void*

Sorry excuses

What's a good book on operating systems? I see a lot of jobs I want to apply for when I graduate asking for knowledge in operating systems, but not sure what they want employees to know specifically.

hey Sup Forums Im working on a little quasi ai, and im having some trouble doing read at write functions into and from 2-d arrays. trying to read from a text file at the start, then write back at the very end. Any help would be nice
pastebin.com/taDtc2BV

Although I have a lot of issues with Go's lack of generics, as I'm an Ocaml programmer, it's lightyears ahead of C.

>C has had over every other language
>stable ABI
The C++ ABI includes the C ABI. In addition, it covers the following features:
> Layout of hierarchical class objects, that is, base classes and virtual base classes
> Layout of pointer-to-member
> Passing of hidden function parameters (for example, this)
> How to call a virtual function:
> Vtable contents and layout
> Location in objects of pointers to vtables
> Finding the adjustment for the this pointer
> Finding base-class offsets
> Calling a function via pointer-to-member
> Managing template instances
> External spelling of names ("name mangling")
> Construction and destruction of static objects
> Throwing and catching exceptions
> Some details of the standard library:
> Implementation-defined details
typeinfo and run-time type information
> Inline function access to members
Your next reply will be
"Well C and C++ are the same"
Lol

>"Well C and C++ are the same"
No. I certainly do NOT think that.
>The C++ ABI includes the C ABI
And you can't use any of your shitty C++ features over it.
What you have is a shitty FFI, like basically every other language has.

C is an easy target. Anything is light-years ahead of C

I don't get this post. Who are you replying to?

You are joking, right?
Does it look like I was replying to anyone?
Also,
Are you used to being called a brain dead idiot?

Let's say I have a function in C++ that takes a class as a parameter:

class MyClass
{
int x;
MyClass(int i) : x{i} {}
}

void function(MyClass whatever){}

How can I make it so that calling function with a integer value like function(5) won't work?

You quoted nonexistent text.

What are you going to do about it?

About what?

CRY LIKE LITTLE BABY

stackoverflow.com/questions/4603717/stopping-function-implicit-conversion

I just pushed a new version of my collab drawing web app.

Here's a room I created for you guys:

drawy.io/r/ssezs6c3ejh29xuw

Let me know what you think!

bump, i know one of you find this shit simple

I'm pretty sure anything that allows you to do that costs money other than the hosts file which wasn't a really plausible solution. So instead my program just blocks every other web browser and limits web use to only a few sites.

Said birds

if your constructor takes a single parameter, you should (almost) always put 'explicit' before it

>Lambdafags who don't understand the concept of compilation think that machine code is lambda calculus just because it was compiled from lambda calculus.

I guess x86 machine code is also Java source code, since the JVM JITs to it.

Who said this?

My thoughts did.