/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

youtube.com/watch?v=n4ie7tPMXOQ
twitter.com/SFWRedditGifs

kys faggot

anime imageboard

take your trap shit to faggot

Here's a fun game.
Change your compiler from gcc to g++ in your build script and tell me how many compiler errors you get.

Any of you have experience in online courses?

I've seen Udemy, but is there something that's a bit more involving? I'd be ok with spending a bit more (in the hundreds rather than the thousands though)

...

>build script
but i don't have one

paid programming education is a scam
just download a pdf of any entry-level textbook and get to work

I guess I should just do Udemy then, the courses are like 10€.
Still, not sure which to choose

Are you even listening to me?
Don't pay for programming lessons.

I use CMake like an actual developer

PluralSight is the best videos I've seen, but I'm unsure about "involved" courses.

You're retarded if you pay even a cent for programming courses

we are moving EVERYTHING TO DOCKER. EVERYTHING, inclusing legacy apps in php 5.4.
And i was designated to check each and every one for dockerizing (removing files upload, making volumes and fucking tons of ENV to be accessible from docker line)
I am suicidal, fucking CTO

Is Ruby a meme?

yes, it's shit

How? I want to learn!!!

why is Ruby a shit meme?

Why everyone is using that shit?

Dynamic types and POO-focused
>inb4 ruby or ruby without his trip mysteriously appears

becouse they want to the same production and development env and stateless.
But fuck this shit, it sounds good it is a good idea, but execution up to date, went horrbile wrong, including huge downtime, errors,tons of menpower.

What does that mean. Why are these bad things

daily reminder c and assembly are the only languages a rockstar programmer needs to know

just shut off your brain and get to work.
there is no argue with the tech-illiterate piece-of-shit CTO

daily reminder that rockstar programmer is a forced meme

(You)

>there is no argue with the tech-illiterate piece-of-shit CTO
Depends on the company, really. Generally speaking, you're right; sometimes you shut up and do your job because the boomer thinks they know best. (And sometimes they do; the issue is they maintain this thought process even when they could be wrong.)

This is what's known as a racket.
You invent a "solution" to a problem that nobody had, people start using your "solution" and it's so complex that it creates tons of new problems and so a new job category crops up full of overpaid people whose sole job it is to fix problems caused by the new software.
Once you have any large company sucking on your teat, totally dependent on your new software, you've cornered the market and the cash flow will only grow exponentially.
Don't forget to sell books and consultancy services, that's where the big money is.

Docker is literally a racket.

dynamic types mean types are not a concern and the language will cast behind the scenes when needed. This is shit, and will often result in you debugging run-time errors where there shouldnt be.

POO is Object Oriented Programming

What's wrong with OOP? Most colleges require it

>What's wrong with OOP?
Nothing. Brainlets are upset they cant grasp it.

It's only a bad thing when taken too far. It can increase complexity in situations where it isn't necessary. However, Sup Forums will have you believe that it should be avoided at all costs.

It's dogmatic.

It's not even hard to grasp. It's just more cool to be as contrarian as possible here.

Go is very fast language! Yes!

Nobody can agree what is "true OOP"
Nobody understands what it is, and they think certain languages are incapable of OOP design patterns.
Most OOP design patterns that people agree are "true OOP" should be avoided like the plague, like polymorphism and abstract types.

The "Anti-OOP" religion here is more dogmatic than those who occasionally use a simple OOP design pattern in suitable situations.

so should i not learn ruby? i just want to be as cool as dpt and program

Once you learn the functional paradigm, you'll realize traditional POO and imperative are backwards. You're writing code and structuring everything with the intention of stuff failing so you then write try catches and exceptions. But with a more pure approach, youre getting rid of most errors in the first place. And you won't need an abstract proxy_singleton_manager_factory. And all that other nonsense.

tldr; stick with 1 layer of inheritance and try to write pure functions.

So?

Learn C#

Can someone explain futures and promises to me?

>polymorphism should be avoided like the plague
Hello Clet.

What if you're more of a disruptive code ninja, delivering transformative, groundbreaking content to engage the end user?

why are there so many animeNEETs / NEETsexuals on /dpt/?

Is assembly a defunct language?

if youre talking about the trapposter, it's literally just one mentally ill shitter

Programming attracts mentally ill people.

On a scale of 1-10, how bad is it for me to use a few global variables in a game I am making? And by a few, I mean literally 3.

"First programming language" is a meme, my first was Scheme and look at me now.

Learn whatever you want and you'll be better than most people on dpt

Might be fine.

That's completely retarded. It makes as much sense to change it to gfortran.

You can't make a game with local variables only, you retard.

I've seen it done.
I hope it was machine generated tho.

>retard
Yeah, you're probably right. Thanks.

What are they?

Sure you can.

are you fucking retarded
yes you are fucking retarded

If you don't count constants as global variables, yes you absolutely can.

Why whenever i commit my change with git, git always reply with addition of
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author


is that means my commit unsuccessful or there is any problem with the git configuration?
(i'm still new with git)

Let's say you want to store the current HP of the player somewhere in memory, how would you do that without using a global variable?

Not to have to explain the whole thing, but one keeps track of turns left in the game, amount of money, location (And eventually health), another is the inventory and the last i just realized that I don't need as a global. I feel like that just 2 would be fine. And I just realized that I could get it down to a single variable.

One of those is a property of the round and the rest are properties of the player. Why do they need to be global?

The whole game state is stored in one place and the each cycle of the game loop creates a new game state that is a copy of the old one with some changes applied. The state is then passed to a render function that redraws stuff on the screen based on the new state. That's a very basic functional programming approach, it's used primarily for web-based JavaScript games.

your name and email are fucked or something.
you should use a git repo service that has actual auth.

Do you not know the difference between global and mutable or something?

I'm trying to learn A*.

When the algorithm finishes, I end up with a closed list and an open list, and the closed list contains every visited node up until the last node.

How am I supposed to build the shortest path from this?

No, the idea is that each function takes the state as a parameter and returns a modified state / calls another function with the modified state. You might have something like
function doShit(state){
state.mychar.x += 3;
if(!gameOver) doShit(state);
}

Just started obscuring my python program for some reason.
Here is the first import.
class x:
def ai():pass
def cp():pass
def do():pass
def bm():pass
def ft():pass
def er():pass
def gx():pass
def it():pass
def hz():pass
exec(''.join([x[1] for x in sorted(list(x.__dict__))[ord('\x04'):ord('\n')]])+'stseuqer '[::-1])

could it because I use local repo, and didn't connect my git to any remote repo backup service?

If you don't care about immutability you can leave the "copy of the old one" part and the principle still holds. The state is still passed, modified and returned on each loop cycle.

Where can I download ml.exe (Microsoft Macro Assembler and Linker)? When I downloaded Visual Studio on my windows 7 pc, I had the file, but when I downloaded it on windows 10, it wasn't there. Granted I only installed part of Visual Studio, so I might have not included it when I choose the install options. Help me lads, I want to learn a meme language

But why the irrelevant statements about copying as opposed to mutation?

You could have just said that things are passed around as opposed to being globally accessible.

It's for learning purposes only for the most part. Consider this, on the TIOBE index, ASM ranks as the 16th most used language, which means that the totality of ASM languages are below 15 high level languages in terms of use

Since you are passing the state around explicitly, you might as well make it immutable to make use of the nice benefits that come with it, such as time-travel debugging, referential transparency, memoization and all the other mumbo jumbo that comes with functional programming

youtube.com/watch?v=n4ie7tPMXOQ

>tfw no grandpa walter to teach you templates

Mutation has a nice benefit of being more efficient. Also, referential transparency is not necessarily broken by mutation.

>62732800
The way I have it set up it has to be mutable.

>Mutation has a nice benefit of being more efficient.
If you are targeting speed you wouldn't program in a functional way anyway.

>referential transparency is not necessarily broken by mutation
Mutation breaks referential transparency by definition. If I call an incrementing function with the same state object reference it's going to return a state with different values every time.

A future represents a T that might not have been computed yet. You can inspect the future to determine if it's finished or compose futures to build up more interesting asynchronous computations, such as taking the first of several futures to complete, which can implement a time out. A promise is how the computation signals that it is finished, and is a C++ specific construct.

You store it in the game object representing your player, duh.
Do you not know how to into game engines?

>If I call an incrementing function with the same state object reference it's going to return a state with different values every time.
Which is why you use linear types to prevent an old reference from being used again.

>object

But school is paid programming lessons?
Actually to be quite honest school is much more than that.

That being said, should I switch programs to CS from Cybersecurity if I wanna work in Infosec? My program only has basic scripting, web design, and SQL/database. I could teach myself programming or get a Master's in CS later, maybe both.

Holy fuck I hate OOP and Java guys. How do I get through this semester

What can /dpt/ tell me about D? I'm curious about learning it.

Friendly reminder that saying "I'm a C programmer" is just an indirect way of saying "My IQ is below 100".

Don't it's shit and its GC is shit.

Thanks for your help, guys. Helped me think clearly about what I needed to do.

ok i have a problem
Sup Forums has repeatedly told me that clang is superior to gcc. in fact i heard that clang is the fastest and most efficient compiler out there.
therefore i decided to look at its source code to figure out why it is so fast
i come across this

bool LTOCodeGenerator::writeMergedModules(StringRef Path) {
if (!determineTarget())
return false;

// We always run the verifier once on the merged module.
verifyMergedModuleOnce();

// mark which symbols can not be internalized
applyScopeRestrictions();

// create output file
std::error_code EC;
ToolOutputFile Out(Path, EC, sys::fs::F_None);
if (EC) {
std::string ErrMsg = "could not open bitcode file for writing: ";
ErrMsg += Path;
emitError(ErrMsg);
return false;
}

// write bitcode to it
WriteBitcodeToFile(MergedModule.get(), Out.os(), ShouldEmbedUselists);
Out.os().close();

if (Out.os().has_error()) {
std::string ErrMsg = "could not write bitcode file: ";
ErrMsg += Path;
emitError(ErrMsg);
Out.os().clear_error();
return false;
}

Out.keep();
return true;
}


how is this acceptable code in a modern compiler? :thinking:

>ASM
>used on virtually every machine
>defunct

What did he mean by this?

D is great. You're shit

What kind of things would an interviewer ask for a developer/soft. engineering job/internship?

is it your first time programming?

Call me when stop the world is gone.

No

Writing an 8080 emulator. So far, pic related has been the biggest draw on my motivation

What's wrong with it?

why is it bad?

This is absolutely horrible code. I suggest you stop and read a proper programming book. The C Programming Lang. for starters. If you continue like this you won't make it anywhere

What are you doing? Stop that. You're doing it wrong.