/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: sustainable.jpg (637x482, 27K)

Other urls found in this thread:

kristaps.bsd.lv/ksql/
better-dpt-roll.github.io/#143
yegor256.com/2016/07/14/who-is-object.html
twitter.com/NSFWRedditImage

master/slave flip flops

Second for multiparadigm languages

how hard is to work with databases in C?

depends on the database and what you're doing with it. biggest pain points in C are always getting your memory usage correct and making sure you check for and properly react to the variety of errors you can get. There's no letting some shitty exception float up your stack causing everything to put itself away nicely. and string manipulation in C usually sucks a big one, too.

>work with databases in C
woe is you

Couldn't be easier.
kristaps.bsd.lv/ksql/

databases are written in C

well, Finnegans Wake is written in english and it isn't easy to read

/lit/ is leaking again...

of course, every engineer is a /lit/ and I want to be one

OOPsies are adorable, they think their "insights" are novel, useful, or insightful. Really they're just slight ameliorations of their own self-inflicted problems, and if you try to offer them real solutions then they throw shit-fits.

thoughts on javafx scene builder? is it the best way to use javafx?

Attached: Romanadvoratrelundar.jpg (261x300, 16K)

Nice larping, but you're not an engineer, you're just an indebted good-for-nothing hippie with buyer's remorse over your useless English degree who's desperately trying to shoehorn yourself into STEM, but you have zero math skills, so the best you can do is shitpost-larp on /dpt/.

>using javafx
I'm sure it's as good (bad) as any JavaFX thing. Fucking thing runs like shit on every platform I've used it, if you want a website write a website.

What's an OOP?

100% projecting. Anyone with half a brain can effortlessly discover that FP has been dead in the water and irrelevant since the late 80's, when LISP was completely abandoned after previously having promissingly been the 3rd most popular programming language, and that FP is now desperately trying to spring back to relevance by duplicating the stuff OOP was doing ages ago, calling it "dynamic languages" and then cynically claiming it was OOP languages that copied FP ones. Posts like yours should be automatically permabanned for underage posting.

Attached: 1523366112141.jpg (1450x975, 523K)

Nobody can define it. Bad programming is often described as it.

And this marks the end of my homework marathon. This time I'll buy a Galaxy Note 9 with the money.

Attached: Screenshot from 2018-09-13 22-08-11.png (3840x2160, 527K)

We already eviscerated both your image and your text earlier this week. Next.

how good do you actually have to be at math to be good at programming?

With the loosening of the "programmer" appellation this century, you can probably get away with zero math knowledge.

If by "eviscerated" you mean "had a meltdown over it", then yeah, sure. Next!

> public static void main(String... args) {
You learn something new every day

Attached: 1535441585738.png (1890x1630, 725K)

So even programming has weird enigmas lol.

NEET filter

Attached: 1535935817856.png (1000x1000, 58K)

>OOPsie doesn't know what "eviscerated" means
Why am I not surprised?
>no original thoughts, merely a bad imitation of my post
Ditto. I guess it's not your your turn to have the OOPsie half-brain today.

>if you want a website write a website
nah im just messing around with it to quickly put together some apps for a portfolio, thanks for the tip though

Not really a neet just interested in programming as a hobby.

What difference does String... args make vs String[] args?

I'm guessing the first one is a vararg while the other is explicit array. I never saw it before either.

>700 scratch jobs
what the hell?

Javascript is functional, you brainlet.

>Javascript is functional
"No"

>but you're not an engineer
but I want to be one, that's why I study engineering
reading is a nice hobby, you should try it.
STEM for work, arts for life. Economy to survive

If Java is OOP, then Javascript is functional, moron!

not really.

He's a brogrammer, he doesn't need words, math is for losers who don't just import math in python/node

>"No"
"Whatever lets you sleep at night"

>scratch
i would like to know where the fuck they got this info from

>reading comprehension
>below 0

Java isn't OOP.

JavaScript isn't functional no matter how much you want it to be.

you got me, i didnt know "Indeed" was a thing

You just don't want your super secrit club to be associated with JS, everyone knows that already.

>scratch

Teacher positions, schools that integrate Scratch into the curriculum would want someone with knowledge of how to do so.

sadly, there is a CS guy at my job that really thinks like that

Attached: 1512694917956.jpg (356x400, 18K)

It doesn't matter what my thoughts on JavaScript are. It's simply not functional. You can claim it is until you're blue in the face but it won't make it true.

Then what do you call this?
array.filter(x => x % 2)
.map(x => x * 2)

>It doesn't matter what my thoughts on JavaScript are.
>It's simply not functional.
Yeah, no need to state the obvious. JS is and always will be functional, your thoughts do no count indeed.

>supports first class functions
>supports lambdas
Sounds functional to me.

>b-but it doesn't support algebraic data types
Then neither is Erlang a functional programming language.

Heck, Javascript is even more functional than Erlang, since it supports functional composition and Erlang does not!

JS also has lenses.

"ooh I'm using maps and filters" =/= functional. baka the absolute state of parrots today

Erlang is not functional either.

Evidently your reading comprehension is poor. JavaScript is not functional regardless of whether I think it is a good language.

java is definitively object oriented.

that's ecmascript

Good for JS. Doesn't make it functional.

"OOP" doesn't exist.

>Sounds functional to me.
by being based on lambda calculus, functional programming forbids any statement.

what is functional programming then

Made a web scraper for an assignment
What would you use to display this data as a timetable on a webpage?

Attached: file.png (1920x1080, 373K)

I didn't ask whether you think JS is a good language or not. Why did you just bring that up?

I'll propably do this: better-dpt-roll.github.io/#143 and generalise it to work for any type of file. It seems like it has some uses (like tagging mp3 files by genre), so it'll propably be the first useful thing I'll make

>what is functional programming then
functional programming is when you compose expressions by using functions. it's declarative and anti imperative. a functional program is a big one expression composed of sub expressions.

Greetings niggers

Defining paradigms by what they lack is a poor way to define them because it precludes multiparadigm languages (read: most of them) from being examples of them.

Negresses*

Programming with functions, which are guaranteed to be
>total
>deterministic
>pure
JS provides none of those guarantees. Sure, you can do functional programming in it, but it is definitely not a functional language.

As an explanation of what I meant by "my thoughts on JavaScript". That much would have been clear to any intelligent person.

>As an explanation of what I meant by "my thoughts on JavaScript".
In context of JS being functional or not? Do you suffer from autism?

Actually don't answer that, I know already know you are.

Haskell is not functional because it does not provide totality checking.

>functional programming is when you compose expressions by using functions
Javascript can do that.

either you have something declarative or you have something imperative but you can't have both, they are mutually exclusive.

>total
>deterministic
>pure
lol that makes functional programming not even Turing-complete lmao

javascript has procedures, not functions.

As you are no doubt well aware, in the context of . Please at least try to follow the conversation. I know it must be difficult for you.

>java is definitively object oriented
If we follow these guys 's logic, then it certainly isn't, since it isn't pure OOP.

Correct!

Correct!

OOP doesn't exist.

Attached: hx4Prda.jpg (228x221, 5K)

by enforcing object as the base data abstraction technique, java is definitely oop.

>but I need a Turing-complete language to run on my linear bounded automaton!

OOP doesn't exist.

>can't even grab the most basic concepts of PLT.

Attached: brainlet.jpg (1218x1015, 212K)

>declarative
Same could be said about OOP. It's declarative and doesn't mingle with imperative and procedural programming, hence Java and C++ aren't really OOP.

Except Java doesn't really enforce it, since it allows for imperative and procedural programming.

>Except Java doesn't really enforce it, since it allows for imperative and procedural programming.
do you even know java? every program must be defined by a class.

oop can be either declarative or imperative, an object is nothing else than a data abstraction technique.

Is anyone familiar with flatpak or Snap? I'm writing a C++ application and I don't want to go through the pain and suffering of deploying C++ dependencies.

Attached: 1536636142018.jpg (500x500, 33K)

>every program must be defined by a class.
... and? Classes aren't objects. You're obviously completely clueless.

>oop can be either declarative or imperative
Nope. It must be declarative.

>an object is nothing else than a data abstraction technique
Nope, that's an anemic object. An object is much more than that.

in java, an object is always the instance of a class; a class defines an object.

>Nope. It must be declarative.
right. smalltalk, java, python, ruby, ... all of them are declarative programming languages.

>objects are just a way to abstract data
You know jack shit about object-oriented programming, you idiot. The core of object-oriented programming isn't boxing data, it's message-passing.
Read yegor256.com/2016/07/14/who-is-object.html
>a class defines an object.
Classes are a concept extraneous to object-oriented programming.
>all of them are declarative programming languages
What languages allow you or disallow you to do doesn't define the paradigm. A paradigm is an abstract definition. Smalltalk and Ruby can be declarative, which is incidentally how you obey the object-oriented paradigm. If you don't program declaratively, you're not following the paradigm.

>unironically linking to yegor

>in java, an object is always the instance of a class
Which is why Java isn't OOP

>smalltalk, java, python, rub
Smalltalk is the only one of those that is truly OOP, and it doesn't have classes. You brainlet.

>genetic fallacy

im too much of a brainlet for programming tbqh

Everyone ITT is, user. Don't worry, just LARP along.

Attached: it's_okay.png (989x741, 352K)

smalltalk is class based where an object is always the instance of a class. both java and objective-c borrowed their object model from smalltalk.

What's a good algorithm that can tell which cells on a square grid are intersected by a line (a mathematical function)?
And no, this is not my homework

I managed to write something on my own, but it's very slow and kinda shit

>implying

Post yours

maybe looking at rasterisation, scanline rendering, and raycasting (but not raytracing) would help you.

Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians.

Take the top left and bottom right x coordinates, take their mean, calculate the function for that, check if it's between their y coordinates. I know it's inaccurate for more complex functions

Yeah, that's what I wanted to avoid. It's for just a silly visual effect

Message passing is shit.
If you want to invoke behavior, the proper way to do so is to call a function.
If you want to invoke behavior that can vary, the proper way to do so is to call a function stored in a variable.
If you want to invoke one of many behaviors of the same family that can all vary, the proper way to do so is to call a function stored in a module, record, or data structure.
In all of these cases, the function itself handles the behavior, regardless of what you're accessing it through.
There is simply never any reason for the medium of access to also handle the behavior requested. Direct read access to the behavior itself is always desirable without exception.
Even if, for example, you're working with someone else's API, where message passing is NECESSARY because the actual data and behavior exist on a DIFFERENT COMPUTER, message passing is STILL undesirable, and should be kept to a minimum, because in that case, more message passing means more network communication, which means more points of failure. At that point it's a much better philosophy to only pass messages twice: once on API login, to request a module containing the complete data and behavior to which access is authorized; and once at the end of the program, to send updates back to the API. This narrows down possible points of failure to only two, and minimizes data loss in the event of failure at the latter point, since all program state is still maintained on the client and can be reliably serialized.

>he doesn't write his kernel modules in scratch
Fucking 1xers, I swear