/dpt/ - daily programming thread

What are you working on, Jow Forums?

Previous thread:

Attached: principles-of-object-oriented-programming.jpg (600x689, 38K)

Other urls found in this thread:

youtube.com/watch?v=C-T4VVZrmkA
github.com/rust-lang/rust/blob/master/src/test/run-pass/weird-exprs.rs
twitter.com/SFWRedditGifs

Trying to get motivated to finish learning python as I have another shift at fucking mcdonalds for 8 hours soon. Why does Summer go to shit as soon as you graduate highschool?

Thanks. Now I have to read up on what the hell a stack frame is.

Haskell:
The unfortunate posterboy for FP

It's the set of local variables and parameters, as well as a return address, that corresponds to a certain function call.

When a function returns, it's stack frame is destroyed. So you can only refer to variables in the stack frame while you haven't returned from that function.

You're all just contrarians. And contrarians in the world of FP, which makes you double contrarians.

In the world of mathematics, FP is not contrarian, though we're mostly happy to just let you codemonkeys do whatever you do with the implementation.

currently hacking Jow Forums
*beep boop beep boop*
heh those nerds wont notice me here
*extracting information to my database*
*screeeet/*

Attached: 97ehwdgdis011.jpg (750x880, 115K)

quit your job, make video games
youtube.com/watch?v=C-T4VVZrmkA

Last week of my JS nanodegree course. Went from starting out disliking it, to having a sudden epiphany and loving the abstract functionality, to now just disliking it again because of how much goddamn boiler plating and caution tape laying you need to make debugging not so cancer. When the data structures get big enough and asyncronized I really start missing strict typing.

Are Go or Rust actually that bad?

C seems like such overkill since I don't give a shit about systems programming.

Go is fine. It's fine because it does what it sets out to do - allow brainlets and pajeets to write mountains of good enough code. Compared to alternatives like Java it's the best suited for that.

>JS nanodegree course
Friendly reminder that these people call themselves engineers. Absolutely laughable. Get a real fucking education you buffoon.

Not him but Prolog.

I don't think rust is that bad, I quite like it, but it can still be a bit immature, so it might not be ready for certain things, if you need support for some obscure platform or some library or whatever, or you're reliant on the great tooling a lot of bigger languages have in terms of editing. The code of conduct also isn't really that desirable, you might feel more strongly about that than I do. There's a few minor qualms, too, but I think the core language is pretty nice.

Attached: lolnogenerics.jpg (1438x788, 109K)

People hate it because it is made by unironic communists.

Rude.
I unironically take Nanodegree courses just for fun.

Okay, Go is off the list. Rust sounds alright though.
Communists as in political radicals or as in fat lesbians? The former sounds ironically funny.

Real honest to god commies/socialists. There are a ton of them at google. which i find pretty ironic considering you acquire an absolute shitload of capital from working at google.

both, really

Attached: 8zLqh.jpg (1200x825, 136K)

I'm unironically happy that cis-male neckbeards are falling behind :)

Going through this, it's pretty fun.
Probably will read the dragon book afterwards, too little theory for my taste but at least mentions things to look at.

Attached: Screenshot from 2018-05-29 18-40-19.png (274x282, 20K)

I would be willing to bet that if these were all straight white neckbeards, way cooler shit would be coming out of Google at much faster rates.

AT&T/Bell Labs already did it once.

Currently trying to get a grasp on the Android Data Binding library and learning the MVVM architecture because of all this buzz on how it makes test-driven-development easier. Is TDD a meme, Jow Forums?

>inb4 t. pajeet

I refuse to believe that people that look like those queers are good engineers

To be fair, Rob Pike was the guy who originally shat out Go, and openly admits to being the reason it's shit. If Google likes mediocrity, that's their choice.

what we need is more findommes and chastity slaves in SV
get that backed-up juice working overtime

What's this? Mind sharing?

Real research no Neckbeards.

craftinginterpreters.com
I hoped anyone interested would at least search up the title and opened the first link

Cmon you again? Seriously what is your problem?
How did haskell hurt you?

mvvm on android?

why can't haskellettes fathom someone into FP but finding haskell lacking?

This guy works for Google though, he's part of the Dart team

Yeap

Also wrote Game Programming Patterns, pretty good reading as well especially for beginners

Attached: Screenshot from 2018-05-29 18-56-05.png (554x278, 96K)

will dart be the future?

What is the point? How is it going to be pure mvvm with all the UI logic you have to do and interfaces, activities, intents...etc?
Just use mvp

Where is this quote from?

I want to be able to write drivers

Attached: flat,800x800,075,f.jpg (671x800, 80K)

I need to do the following operations:
>check if there is a value for a key
>write a value to a key
I do not need the ability to delete or edit. The key is the hash of the value.
What database do I use? On the order of 100m entries, 100k queries/sec, 1k inserts/sec, averaging 10kb/entry.
I'm considering direct mapped cache (bloom filter but only gives false negatives) + lmdb, but a straight ext4 file system might have better performance.
Any thoughts?
I would also like to log a few thousand events per second. Is a plain text/csv log file the best solution for this, or is it a better idea to log in the database?

We will see how fuchsia goes
Dart itself is a rape babby of java/c++ and most of it is JS

where is the C package manager

Yeah I'm kinda on the fence about this as well. I started learned Android originally with the MVC architecure, and figured that I needed to migrate to more widely-adopted one like MVP/MVVM. Still newish to this whole thing.

>he's never used conan

We need a language where programs are expressed as systems of rational agents.

A rational agent would occupy an environment, and have beliefs, abilities, and desires. Its beliefs and desires would be formal statements about its environment, expressed in a probabilistic fuzzy logic, and its abilities would be statements of the same kind, but concerning two environments: the current environment, and the environment that would result from exercising the ability.

A rational agent's behavior would be to use its abilities to construct what should be the most probable path to the hypothetical environment that most adequately satisfies its desires, assuming its beliefs hold, and assuming this with as much certainty per belief as that with which the belief is held.

Rational agents would be considered a part of their own environment, i.e. a rational agent would be able to hold beliefs about its beliefs, beliefs about other agents' beliefs, beliefs about desires, desires about desires, desires about beliefs, et cetera.

A program would then be expressed as a system of environment objects and rational agents, with some specified beliefs, abilities, and desires, such that the way the agents interact would result in the desired program behavior.

good idea y/n

Haskell is just math.
Just be good at logic and algebra and then you get haskell very quickly

So, C+= but unironically?

So basically what you're asking for is a language where you have a bunch of bots running around in a room and you accomplish every task by bossing them around

why do haskelltards assume that if you like FP, but don't like haskell, it must be because you had trouble learning it

How would I install Scala/sbt on a USB?
I've got JDK8 on it and can compile with NP++, but not sure how to get sbt working.

What's with your autistic crusade against Haskell?

What's a good FP language that isn't Haskell?
not clojure either, dynamic typing is bad

can you please tell me what you don't like about haskell? I'm sure we can work this out, come on

the fuck is c+=

Yes exactly! This is what a true "high level imperative" language would look like. Instead of giving imperatives to a routine, you give them to a little virtual robot that can kind of think on its own but not really because its thought process is pure reason divorced from any necessity for a notion of intelligence and is therefore easier to understand than real AI. Consequently, the imperatives you find yourself needing to give would be less cumbersome and less verbose, but still comprehensible with a close reading.

it's called India

Maybe not the right place for this question, but is Apache Hadoop worth getting acquainted with? My job is giving me the option to move onto our server administrator section but I'd need to know at least the basics of Hadoop/YARN and I'm not sure I should waste the time

Attached: 1507831677398.jpg (500x375, 12K)

college-aged, familiar with computers but hasn't done much actual programming, absolutely no language design
likely an english/art major

C# or java.
Best type system there is, and supports lambdas.

So I take it you think this would be a bad idea then

github.com/rust-lang/rust/blob/master/src/test/run-pass/weird-exprs.rs

Attached: 1522501717325.jpg (540x720, 50K)

/sqt/ is dead so I'll try here: What the fuck is the point of having private class members with public getters and setters? Why not just keep your data members public?

because making them public increases coupling. if anyone can change the variables at any time you end up with shit, unsecure code where anything can do whatever they want. that's pretty much the first thing you learn when learning how to write good code.

I don't have an opinion on it because it's just fluff, but I think you're talking about features that wouldn't benefit the language and in fact would make it hard to reason about.
It's fun to come up with ideas, but you should establish some stronger fundamentals of CS and compilers and languages

Attached: 1526637672916.jpg (297x169, 22K)

But what the fuck does that actually even mean? Like someone 5 years from now at my company is gonna open my code and intentionally fuck it up because i left some key data public? Seems like horseshit

Because you'd perhaps want to protect those members with a mutex one day, or remove a field and make its setter do something different that would result in the same behavior as observed from the outside. Encapsulation in general is used because we want to separate interface from implementation so that we can change the implementation at any time in the future.

>college-aged
yeah
>familiar with computers
yeah
>but hasn't done much actual programming
lots of programming, but indeed not much actual programming. i know c, scheme, and ruby pretty well. i wrote a shitty game framework in sepples with sdl once
>absolutely no language design
this one time i made an interpreted lisp which is pretty much the easiest kind of lang to make
everything worked except the gc
>likely an english/art major
comp sci major

>thinks it's a general poll
let me guess, autism too?

>lots of programming, but indeed not much actual programming

Attached: 1522111782978.jpg (297x297, 13K)

>>thinks it's a general poll
well no, I'm aware it was directed at the person it was a reply to
however, that person was me
yeah, what about it?

Which one is better? Does it event matter if I am sending variables as parameters or if I am accessing class variables from method?

this

class test{
int[] BigArray;

void Init(){
BigArray = new int[1000];
FillArray();
//do stuff with array
}

void FillArray(){
for (int i = 0; i < 1000; i++){
BigArray[i] = i;
}
}
}


or this

class test{
void Init(){
int[] BigArray = new int[1000];
BigArray = FillArray(BigArray);
//do stuff with array
}

int[] FillArray(int[] array){
for (int i = 0; i < 1000; i++){
array[i] = i;
}
return array;
}
}

just look at any class from any decent library; everything inside that module will be connected and reliant on each other. if someone dumbass can then access and change these members, not only would it fuck up how that class itself works, but also it would fuck up other parts of code which use that class.
google it. it's not just so everything looks tidy.

If no one is experienced with Apache Hadoop that's cool, but SQT doesn't help so I'd appreciate some kind of answer

Started my internship. Doing some android stuff for a startup. New to it and I'm pretty dumb so started out with basic shit like pulling down JSON and parsing it.

is there a reason why you decided not to use a constructor to initialize your class, a default argument for 1000 and an optional argument for a custom array of int size?

Neiher and lrn2indnt faggot.

Good on you.

The second one has several mistakes, there's no way it would compile.

You should ask yourselves why you're writing a class in the first place.

it is just example.

>wouldn't benefit the language
i mean it depends what you're trying to do with it
this kind of language would be for design problems where you know what you want to do but figuring out how to do it is not a humanly feasible task
if you have a task and you have an algorithm in mind or can imagine being able to think of one then this would not be the language for you, this is true
>and in fact would make it hard to reason about
harder than normal languages, for sure, like fp, procedural, poo
but it seems like it would be easier than figuring out how a neural network is going to behave

Writing a cli expense tracker in Rust, and a curses based chromecast streaming tool in Python.

What's it like?
I start mine next month and am shitting it because of how much they say they use. They've already stated they're using Java, Swift, Objective C, Kotlin, Go, Scala and A-Studio, and I know about 1/3 of them but I'm nervous that I'll be shit.

I'm a special case I guess, it's a guy I know from home that got me into coding. But I talked to him about how the classes I'm taking are mostly horse shit, and he said that all the students he's worked with go in not knowing anything and they have to basically be taught from the ground up.

I came in knowing basically just Java, which worked out for the Android stuff I guess. Might be doing some monogdb stuff later on. I had a hard time dealing with not knowing what the fuck I'm doing on Android studio, but I've been getting over it.

Android studio sucks major cock. Android OS is even worse.

Haskell is bad, though. Why limit yourself to only functional programming when many languages let you do whatever you want?

your BigArray variable looks like it would go out of scope once Init() is done. data should remain in objects so you can later specify when you want to clear your objects' data or delete the objects entirely.

(2nd example)

yes.
It got a job refused because they didn't feel in security with my cyber-jihadist portfolio.

>if i intentionally shoot myself in the foot, look what can go wrong!
because no other language has things like this

saved for later kek
anyone has C++ version of this?

I can't read/load files with Python! Whenever I run a program with any kind of reference to an external file, it always gives me this stupid error message. What the fuck!?

Attached: error.png (666x272, 7K)

haskell is easy to use but very hard to master. the only true "limitation" is in your head that is not used to actually thinking and not just slapping together few vars and a loop

only useful languages.

>is
in*

#include

int main()
{
char c;

printf("abcdefghijklmnopqrstuvwxyz\n");
for (c = 'a'; c

How do I write a program in Java the Script?

Attached: java-the-hutt.jpg (606x500, 64K)

idk why my post got nuked
thats not java
and
printf("%c%025c",c, c);

Find a clean street