/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

github.com/search?q=BEGIN RSA PRIVATE KEY&type=Code&utf8=✓
github.com/bartoszgorka/PlantMonitor/commit/b4d4bd8d6c40ba3a50d954df00d47a4e3fd0e0bf
youtube.com/watch?v=bA4xvmH3WSQ
en.wikipedia.org/wiki/Simula
youtube.com/watch?v=RdE-d_EhzmA
yegor256.com/2016/08/15/what-is-wrong-object-oriented-programming.html).
twitter.com/NSFWRedditImage

Too soon, faget.

Sage and report.

how do I statically verify that my C++ sources aren't using [feature I find personally disagreeable]?

SmallTalk is love, SmallTalk is life!

Scheme is a pretty good LISP but Clojure is also good

Regex.

>JVM language
>good

can I run the programs I make in this independently, without bringing up the complete programming environment

Java is good

>tfw finding $15/mo api keys in a public repo

>Parsing c++ with regex
I wonder if there is some madman that did it.

>super used to write small ass programms with sublimetext
>workplace enforces eclipse
>everything feels annoying and shitty about it
I-I will get used to it right

watch this
github.com/search?q=BEGIN RSA PRIVATE KEY&type=Code&utf8=✓

there is. my former company used to have a custom version of google's cpplint which pythonshit regex soup

Is there a photoshop addon to make layers into a working Gui protoype?

>tfw finally getting interviews
I'm gonna make it guys.

I'm not a fan of OOP, but I can respect what the original innovators of that language tried to do before c++/java came and shit all over the concept.

sjws in action

kek

If the first case, the * binds to the identifier, in the second it binds to the return type.

//function that returns a pointer to an int
int*
function();

//pointer to a function that returns an int
int
(*)function();

>I can respect what the original innovators of that language tried to do before c++/java came and shit all over the concept.
Very much this. I don't think OOP as originally conceived by Alan Kay is as widely applicable as he wanted it to be, but that's precisely because there's some conceptual integrity and coherence behind it that gives it distinct properties that one can reason about to determine whether it's appropriate for a given problem or not. This is not even remotely true of Java/C++ OOP.

>it's another episode where some NEET thinks writing std:: 300 times makes him some leet hacker

Put JS in the "Why don't it die"-tier

>ctrl-f std::
1 result found. What did user mean by this?

github.com/bartoszgorka/PlantMonitor/commit/b4d4bd8d6c40ba3a50d954df00d47a4e3fd0e0bf

use libclang, brainlet.

>[feature I find personally disagreeable]?
Reminder: you're in /dpt/. You probably mean "feature that is objectively and universally bad and only retards would ever use", and you should specify what the feature is, to encourage productive discussions on the matter.

But then there's a tangential argument rather than a solution to my particular problem

Yet somehow everything that makes it into std still feels like a beta.

c++ is the greatest language of all time

fucking niggers and their barbaric sounds disturbing my peace when i'm attempting to think

Here's some thinking music
youtube.com/watch?v=bA4xvmH3WSQ

nah thanks i'd rather 10 hour looped pingas videos

does pypi/pip have any regulation? found a package that depends on a service form a third party site and it's behind a paywall, how is that shit allowed. made me wonder if there's more shady shit on there.

alan kay did no shit. Simula was the programming language which introduced object, class, interface, method, ... years before smalltalk. Kay, Stroustrup. Gosling, ... they all copied Simula.

Classes are cancer though.

en.wikipedia.org/wiki/Simula

Trying to reverse engineer some game

hash += A - B

why? it's one way to describe objects and probably the best for static typing.

trying to find the logic to calculate C*

you didn't give an equation containing C so as far as I know it's not even related
best bet would be to get 4 or 5 more examples of hash, A, B, C and then see if you can spot a pattern

What kind of drugs do you like to do for programming?

You obviously can't properly distinguish between controversy and true beauty, you completely switched them around.

Im trying to figure out the equation to calculate C

I know that C=303 based on that data set.

I know I have to reverse that bit shifting logic
but cant figure it out.

C also never exceeds 513.

Is it possible to implement a doubly linked list in Rust without reference counting or unsafe?

dicking around trying to invent the math that the software is doing is really not the right way to go about this
the only reasonable way to do it is to find the code that calculates C

>they all copied Simula
Uh, nope. Simula is trash for the same reason C++ and Java OOP is trash, but there's actually a much better concept further along the way which Alan Kay introduced.

Because classes pollute OOP with procedural concepts like implementation inheritance and static methods. We just want subtyping, so we might as well just replace them with types.

For example, instead of:
class Example
{
int x, y;
public:
Example(int a, int b) : x(a), y(b)
{
}
int Sum()
{
return x+y;
}
}

// creating objects
Example e1(17, 19);
Example e2(23, 29);

You'd have something along the lines of:
type Example
{
public:
int Sum();
}

// this creates an object
Example e1 = create Example(17, 19)
{
int x, y;
public:
Example(int a, int b) : x(a), y(b)
{
}
int Sum()
{
return x+y;
}
}

// creating another object
Example e2 = copy e1(23, 29);


Related: youtube.com/watch?v=RdE-d_EhzmA

>BEGIN RSA PRIVATE KEY

what can you do with this, if you found some?

so now you've polluted all your code with implementation details
that's horrific
even lispers believe in black box abstraction

There is no code for calculating C in there.
I just know for certain that C=303 under those circumstances.

and I know it must be a simple bit shifting operation

>Java
>not in complete mess tier

>There is no code for calculating C in there.
where do you suppose C is coming from, then?

Once self-referential data rolls around you should be able to do it with interior mutability, but that is dynamically checked with reference counting so I guess it still wouldn't count. Though it would be possible to turn off the dynamic checking for a release build, whereas it would not be possible to turn off the RC today because it's necessary to establish ownership in this case. If Rust ever gained the ability to have safely aliased mutable references through something like rely-guarantee logic, then you wouldn't need it at all.

>Defining and creating the object in the middle of the codebase
Fucking disgusting.

>implementation hiding is OOP
Closures and modules can do it just as well or even better.

How many Pentagons have you managed to hack into today, /dpt/?

Is this a troll image?

You idiots are thinking there's a difference between the "codebase" and "what goes inside an object", and that's why you don't create object oriented code, but procedural code.
The whole point of this is that EVERYTHING in your program should go inside objects. If you have such a distinction, you programming procedurally (or possibly even imperatively!).

Where are Idris and Agda?

I can't be bothered trying to convert people any more. Use whatever language you want. I won't work with you unless you're using a language that I don't mind using. I have better things to do with my life.

What the fuck are you talking about?
Classes let you define objects abstractly so you don't have 9000 fucking object definitions scattered all over the fucking place in the middle of your files.
Why the hell would you EVER define an object type in the middle of some random file?

Because it forces you to create this thing called software architecture and develop with architecture - which is something you obviously don't do because you're worried about having several too long object definitions inside very long files. Those are awful code smells, and they mean you're a terrible rookie """"""""""p(ajeet)rogrammer"""""""""".

Actually I suppose you wouldn't even need rely-guarantee. Basically, the back references in the list would be immutable. To actually mutate a node, you need a mutable reference to the list itself. Obviously the details of that would be internal so that the user only has to care about the capability to read/write elements, but I believe it could be entirely safe.

>random buzzwords and memes the post

Constructors are just functions that return objects. You would need exactly as many of these functions as you would constructors using classes, but without all the actual class boilerplate. Plus you would have the freedom to create a unique object without defining a constructor for it.

You're either a troll or an idiot, either way I'm not interested in you.

not an argument.

>Shoving object definitions in sporadically without any defined system or organization is "software architecture"
You're an idiot

Yes, but with class it is ORGANIZED, you're not defining a bunch of shit on the fly in the middle of nowhere. It's all in one place, consistent, for everybody everywhere. That's literally the point of OOP.

>Plus you would have the freedom to create a unique object without defining a constructor for it.
You mean one of the biggest reasons JavaScript is such an unmaintainable mess of bullshit and every major organization has tried to create a type strict framework to lay on top of it to stop people from doing that?

>software architecture means sprinkling implementation details about randomly throughout the code in a completely unmaintainable fashion

>Yes, but with class it is ORGANIZED, you're not defining a bunch of shit on the fly in the middle of nowhere. It's all in one place, consistent, for everybody everywhere.
Like putting it in a function?

Skipped the second part of the post, sorry. Now you're just ranting about dynamic typing. You don't need classes to make objects in OCaml, and yet it's got a good static type system.

Like having it in a class file, you dip.
Have you never worked on any production size codebase before? There's a reason everybody shills Enterprise OOP for incoming devs, it's because its universally managable and prevents people like you from declaring weird bullshit in some unindentified place that other devs have to hunt down over the span of 3 hours because MUH EFFICIENCY

Your classes with thousands and lines that do many things and are full of static methods and implementation inheritance are what's truly unmaintainable, you filthy street shitter.

You're only worried because you're used to big, pathological objects. How long are your typical object definitions, Pajeet?

Heisenberg's Uncertainty Principle says that you can't examine all the fine details of my post to determine whether it's an argument or not.
And besides, according to Schrodinger's Cat, you wont even know if it's valid because all arguments are simultaneously valid and invalid until the moment they are examined.
((((((They)))))) just don't want you to discover this truth.

Ah yes, the classic "industry standard" deflection.

OOP isn't done right on most enterprises though, which is why it's universally hated these days (see yegor256.com/2016/08/15/what-is-wrong-object-oriented-programming.html). What we're trying to show you here is how to do it properly.

I want to get more in depth into programming, i know already some python and java (i hate it). I want to start CLRS or SICP, which one should i read ? What is the biggest difference? I'm studying maths so the math part will not be a problem. Reading the SICP preface make it sounds like a fun book. Any idea from someone who read the 2 books?

Try making something in a language like EO that implements types instead of classes anytime and you'll understand this concept better.

>deflection
Not a deflection, it's a direct argument.

Any poorly written code will be impossible to understand. But even mediocre OOP is easily understandable because of its rigid structuring.

Except EO is borderline anti-OOP, so no thanks.

I'm just as qualified as anyone else here to give you a suggestion, as I, like most programmers, have read neither book.
I suggest sticking with python or moving to C++.

>everybody is as shitty a developer as I was, am, and always will be

>EO is borderline anti-OOP
You're clinically retarded.

>appeal to authority and tradition is a direct argument

>Projectiong

>I literally don't understand OOP paradigms

>Well defined practices are now a logical fallacy

I dont want to be a code monkey, i want to feel smart.

It's always funny how you can pinpoint the exact moment a POOP shill runs out of real arguments and has to resort to fallacies, name calling, and shitposting from there on.

CLRS is trying to do something different from SICP. SICP is a very general about how to program whereas CLRS is about how to algorithm which is different from building complete working programs. I'd recommend reading SICP first to get a good grasp on programming.

Is it the moment they start posting, because there are no real arguments that they could possibly have?

>I can't justify anything so I'm going to resort to name calling

In that case, SICP is the perfect choice.
For maximum snobbery you should consider shilling the book and placing it on a high pedestal, but never actually read it.
This way you can ascribe to it all kinds of mind enhancing characteristics that it may not, in reality, endow.
It's the path most of us choose.

>I literally don't understand OOP paradigms
I can see you don't, but you accidentally placed a meme arrow in the beginning of that sentence so it looked like you were quoting someone despite the fact that you weren't. You're welcome! ;^)

Be nice user, it's perfectly fine to have a reasonable argument even if it's wrong.

Calling you out on your non-arguments =/= name calling
I don't need to respond to a non-argument with an argument.

>such is life without types

Thank you, i will start SICP tomorrow, i just installed Lisp scheme

>I don't need to respond to a non-argument with an argument.
This line of thought is why there are still so many Republicans.

in c, what is the difference between a macro and a function?

what benefit is there in having the preprocessor expand a macro rather than just having inline functions

>Be nice user
Shan't. They're continuing a 25 year long running joke at the expense of the industry. It's not funny any more.

>overloaded operations

the macro guarantees that it will be inlined
an inline function is not guaranteed to be inlined, believe it or not