[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 317
Thread images: 27

File: 1480546174720.png (102KB, 1000x1071px) Image search: [Google]
1480546174720.png
102KB, 1000x1071px
Old thread: >>57784398

What are you working on /g/?
>>
>>57791122
/dpt/ anime is the best. OOP meme GTFO.
>>
An express app. Ridiculously simple, I'm surprised I've made it this far. Deploying it using docker and a raspberry pi with resinos, which is fucking amazing.
>>
I downloaded all banners from 4chan.

#include <stdio.h>

int main(){
FILE *fp;
int i;
char FCDN_LINK[] = "wget http://s.4cdn.org/image/title/";
fp = fopen("./wdown.sh", "w");
fprintf(fp, "#!/bin/bash\n");
fprintf(fp, "mkdir 4chan_banners\n");
fprintf(fp, "cd 4chan_banners\n");
for (i = 0; i < 251; i++) {
fprintf(fp, FCDN_LINK); fprintf(fp, "%u.png\n", i);
}
for (i = 0; i < 252; i++) {
fprintf(fp, FCDN_LINK); fprintf(fp, "%u.gif\n", i);
}
for (i = 0; i < 223; i++) {
fprintf(fp, FCDN_LINK); fprintf(fp, "%u.jpg\n", i);
}
fclose(fp);
return 0;
}
>>
>>57791122
Delete this please
>>
Real thread here guys:

>>57790993
>>57790993
>>57790993

>>57791122
pls delete you faggot
>>
>>57791306
>not infinitely making requests to the website constantly and ripping the randomly selected image and comparing it to all previous unique images before storing it locally
>>
>>57791306
>One space indent
Burn your hard drive asap
>>
>>57791339
for you
#include <stdio.h>

int main(){
FILE *fp;
int i;
char FCDN_LINK[] = "wget http://s.4cdn.org/image/title/";
fp = fopen("./wdown.sh", "w");
fprintf(fp, "#!/bin/bash\n");
fprintf(fp, "mkdir 4chanban\n");
fprintf(fp, "cd 4chanban\n");
for (i = 0; i < 251; i++) {
fprintf(fp, FCDN_LINK); fprintf(fp, "%u.png\n", i);
}
for (i = 0; i < 252; i++) {
fprintf(fp, FCDN_LINK); fprintf(fp, "%u.gif\n", i);
}
for (i = 0; i < 223; i++) {
fprintf(fp, FCDN_LINK); fprintf(fp, "%u.jpg\n", i);
}
fclose(fp);
return 0;
}
>>
>>57791407
why would you write a c program to create a shell script?
>>
>all these nerds writing pages of unnecessary error handling code
Feels good being intelligent enough to know that your progrem works flawlessly.
>>
>>57791435
I didn't know bash at the time of this script.
Now I still don't know it, but I have all banners downloaded.
>>
>>57791459
Start over in snakescript
>>
>>57791487
okay
import os

f = (wdown.c, 'w')

f.write("""#include <stdio.h>

int main(){
FILE *fp;
int i;
char FCDN_LINK[] = "wget http://s.4cdn.org/image/title/";
fp = fopen("./wdown.sh", "w");
fprintf(fp, "#!/bin/bash\n");
fprintf(fp, "mkdir 4chan_banners\n");
fprintf(fp, "cd 4chan_banners\n");
for (i = 0; i < 251; i++) {
fprintf(fp, FCDN_LINK); fprintf(fp, "%u.png\n", i);
}
for (i = 0; i < 252; i++) {
fprintf(fp, FCDN_LINK); fprintf(fp, "%u.gif\n", i);
}
for (i = 0; i < 223; i++) {
fprintf(fp, FCDN_LINK); fprintf(fp, "%u.jpg\n", i);
}
fclose(fp);
return 0;
}
""")

f.close()

os.system('gcc wdown.c')
os.system('./a.out')
os.system('./wdown.sh')
>>
>>57791681
Well memed anon, here is a (you).
>>
>>57791789
Am pleased.
>>
File: out.png (47KB, 741x896px) Image search: [Google]
out.png
47KB, 741x896px
>Not having your gold stars yet
>>
>>57792356
Is that ASCII GTA?
>>
File: 1479637757558.gif (800KB, 500x500px) Image search: [Google]
1479637757558.gif
800KB, 500x500px
How shit is Visual Studio Code on linux? I'm currently trying to migrate from Windows to Linux and I need a decent editor (just editor. Not full IDE).

Should I use VSC or something like Atom instead?
>>
>>57792673
emacs
>>
>tfw your (non-trivial) prolog program works on the first try

I honestly feel like a wizard, I could cry, this is too amazing. I am one with the computer. My legs hurt from sitting all day and my mind is broken from not being able to stop working on this project, but this moment, I lived for it.
>>
>>57792673
As far as I know, VSC is no different from Atom in terms of what it uses. They are both JS-applications, so you aren't going to have a significant difference between VSC and Atom.
Emacs can be your friend, since it's easily expandable editor. As far as I know, Vim is expandable too now (but not since long ago).
Emacs script language is Emacs Lisp, Vim uses Lua. Also, with Vim you'll get experience of using a universal UNIX editor, if that matters.
>>
>>57792673
It's... okay. I like it better than Atom out of the box. It's more polished and feels less janky, but it has a weaker add-on ecosystem.

They're both shit, though.
>>
>>57791306
Why a C program that makes a shell script?
If you know shell scripting why not write a shell script?
If you know C why not write a C program?
>>
>>57792673
vim, hands down
>>
>his lang can't do this
(define nigger
(case-lambda
((nigger) (+ nigger 1)
((dick cuck) (+ dick cuck))))
>>
>>57792813
>>57792794
>>57792770
Thanks guys. Real answers. Thats nice
>>
lets say you have a hypothetical synchronous service, what would be the best approach to make an asynchronous middleware? what are some good examples of asynchronous code?
>>
>>57792999
Nice trips.
Care to explain?
>>
>>57791122
First for D
>>
>>57792795
I hope he posted it just to laugh.
>>
>>57792999
>))))
>>
>>57792673
It would be fine if it didn't crash Xorg every once in a while. I can't even find anything about it online but after a little while of using VS code my entire system freezes to death. I have 4gb swap, 8gb ram and it certainly isn't capping it, and yet I must do a hard reset of my PC since not even sysreq or switching TTYs works. reee
>>
thank god its not that annoying as piss web-um again
>>
>>57792999
F# can. But you would never ever ever want to write code like that. Jesus fucking christ.
>>
>>57794022
>If you're mocking in units tests, you didn't abstract correctly.
Not true at all.

The "abstract everything" line of thought is pajeet thinking. Automatically abstracting everything with interface boilerplate is just as dumb as not doing it at all. Contrary to the widely held belief among Java developers, you actually can't shortcut around good design with boilerplate.
>>
>>57792999
>(((()()(()())))
>>
messing around with servers.

how come when i bind a socket to a known port such as 80/http i run an nmap on my localhost it shows it being an open port - but when i bind it to just a random number or known torrent client port such ast 6881 do an nmap no open ports?

is the port still open and ready to process connections or is something wrong?
>>
>>57792999
))))))))))))
>>
>>57794133
port is firewalled?
>>
>>57794107
>Automatically abstracting everything with interface boilerplate is just as dumb as not doing it at all.

I didn't say "abstract everything", nor did I imply it at all. If anything, I'm implicitly arguing against it, because those forced abstractions are the exact bullshit for which you have to mock. You have serious reading comprehension issues.
>>
>>57794144
>I'm saying that as long as the language can enforce a single mutator and no observers
Everything in the scope of the class can "observe" the mutation of the local state. If you don't make any bugs related to local code interacting with that changing state, then yes, it will behave the same as the functional version. But that's the whole point of the functional version, it removes the possibility of those classes of bugs happening.
>>
>>57792356
>solved the 1st puzzle in Lua in hours
>got both stars
>I'm not in the leaderboard

Who thought having Midnight EST as the starting point was a gr8 idea?
>>
>>57794188
in F# this is just
printfn "Hello World!"

Haskell and C++ confirmed for SHIT
>>
>>57794231
in Ruby it's just
p "Hello, World!"
>>
In English this is just Hello, world!
>>
>>57794253
Doesn't print out the same output. Ruby confirmed for SHIT
>>
>>57791306
>Programming in an outdated language
Here, I fixed it so it runs in Python instead
#/usr/bin/env python
from subprocess import call
with open('code.c', 'w') as f:
f.write(r"""#include <stdio.h>
int main(){FILE *fp;int i;
char FCDN_LINK[] = "wget http://s.4cdn.org/image/title/";
fp = fopen("./wdown.sh", "w");
fprintf(fp, "#!/bin/bash\n");
fprintf(fp, "mkdir 4chan_banners\n");
fprintf(fp, "cd 4chan_banners\n");
""")
for i in range (0, 251):
f.write(r"""fputs(FCDN_LINK, fp); fputs("{}.png\n", fp);""".format(i))
for i in range (0, 252):
f.write(r"""fputs(FCDN_LINK, fp); fputs("{}.gif\n", fp);""".format(i))
for i in range (0, 253):
f.write(r"""fputs(FCDN_LINK, fp); fputs("{}.jpg\n", fp);""".format(i))
f.write("fclose(fp);return 0;}")
call(["cc", "code.c"])
call(["./a.out"])
>>
File: 2016-12-01-160036_1366x768_scrot.png (204KB, 1366x768px) Image search: [Google]
2016-12-01-160036_1366x768_scrot.png
204KB, 1366x768px
>>57794153
nope im on linux and ive not declared any rules in my iptables.

wait never mind figured it out i guess it was a os permission thing with nmap once i ran nmap with sudo it showed the port as being open.
>>
>>57794270
Of course it does, you numnuts
>>
>>57794267
In Australian it's just "Oi, cunt!'
>>
>>57794300
That is literally the most retarded thing I've read on /dpt/ all week. Fuck me...
>>
>>57794278
Certain ports require root privileges but I thought it was below, not above.
>>
>>57794284
Master race F# outputs:
Hello World!


Peasant tier Ruby outputs:
Hello, World!
>>
>>57794325
That's because I added in a comma, m8
>>
>>57794286
In Russian it's just "Э бля"
>>
>>57794133
nmap doesn't to all ports by default. If you didn't specify you get something like "All 1000 scanned ports". Notice is is MUCH lower than all the ports. Make sure you're scanning what you're intending to scan using the '-p' flag.
"-p -" will do all ports.
>>
>>57794224
Got to cater to the neets.
>>
>>57794404
I also should add that its easier to use
"lsof -i" if you just want to check if something is up on your local machine.
>>
>>57794300


>>57794231
>>57794253
This doesn't do the same thing.
I could also have said
>>
>>57793381
it chooses which function to be based on arg count
>>
"puzzle oriented lang"
what did scheme fag mean by this
>>
>>57794466
He means that it's a puzzle why anyone would use Scheme
>>
>>57794231
>f#

in racket, this is just
(printf "hello world!")
>>
>>57794483
lmao
>>
>>57794505
In Python, this is just
(lambda _, __, ___, ____, _____, ______, _______, ________:
getattr(
__import__(True.__class__.__name__[_] + [].__class__.__name__[__]),
().__class__.__eq__.__class__.__name__[:__] +
().__iter__().__class__.__name__[_____:________]
)(
_, (lambda _, __, ___: _(_, __, ___))(
lambda _, __, ___:
chr(___ % __) + _(_, __, ___ // __) if ___ else
(lambda: _).func_code.co_lnotab,
_ << ________,
(((_____ << ____) + _) << ((___ << _____) - ___)) + (((((___ << __)
- _) << ___) + _) << ((_____ << ____) + (_ << _))) + (((_______ <<
__) - _) << (((((_ << ___) + _)) << ___) + (_ << _))) + (((_______
<< ___) + _) << ((_ << ______) + _)) + (((_______ << ____) - _) <<
((_______ << ___))) + (((_ << ____) - _) << ((((___ << __) + _) <<
__) - _)) - (_______ << ((((___ << __) - _) << __) + _)) + (_______
<< (((((_ << ___) + _)) << __))) - ((((((_ << ___) + _)) << __) +
_) << ((((___ << __) + _) << _))) + (((_______ << __) - _) <<
(((((_ << ___) + _)) << _))) + (((___ << ___) + _) << ((_____ <<
_))) + (_____ << ______) + (_ << ___)
)
)
)(
*(lambda _, __, ___: _(_, __, ___))(
(lambda _, __, ___:
[__(___[(lambda: _).func_code.co_nlocals])] +
_(_, __, ___[(lambda _: _).func_code.co_nlocals:]) if ___ else []
),
lambda _: _.func_code.co_argcount,
(
lambda _: _,
lambda _, __: _,
lambda _, __, ___: _,
lambda _, __, ___, ____: _,
lambda _, __, ___, ____, _____: _,
lambda _, __, ___, ____, _____, ______: _,
lambda _, __, ___, ____, _____, ______, _______: _,
lambda _, __, ___, ____, _____, ______, _______, ________: _
)
)
)
>>
>>57794533
It's like reading pseudo code. Beautiful.
>>
>>57794533
wtf I hate haskell now
>>
want to use dataframes in C#
what's the best package to use?
>>
>>57794103
Looks like a Metroid map.
>>
>>57794533
can you run this code
>>
>>57794664
it would be extremely painful
>>
its midnight and my brain isnt working, is this retarded?

i basically want to take signed and unsigned integers in bison

type    : INTEGER
{
$$ = create_node($1, INTEGER, NULL, NULL, NULL);
}
| "-"INTEGER
{
$$ = create_node($1 + $2, INTEGER, NULL, NULL, NULL);
}
>>
>>57794664
http://ideone.com/dr7i8E
>>
What are some must read books for beginner compsci ?
>>
File: ideon01a.jpg (44KB, 640x480px)
ideon01a.jpg
44KB, 640x480px
>>57794730
>ideone
I can't stop associating it with actual Ideon. Hope I'm not alone with this.
It would be fun if some makes a picture for /dpt/ based on Ideon, though.
>>
>>57794829
sedgewick - algorithms
>>
>>57794829
K&R 2nd edition and SICP. the prior teaches C, the latter teaches Scheme. you will likely use neither C nor Scheme if you get a job programming
>>
File: CueO6MpXYAA3-CG.jpg large.jpg (52KB, 543x524px) Image search: [Google]
CueO6MpXYAA3-CG.jpg large.jpg
52KB, 543x524px
I've been programming in my spare time for over a decade and I'm fucking poor and I don't have a degree. I want to nab a programming job somehow.

What do?
>>
what are contracts in racket
>>
>>57794963
where are u from?
>>
>>57794942
>you will likely use neither C
What if he's going for embedded?
>>
Mutable state was a mistake.
>>
>>57794978
The United States of America.

Maine, specifically.

(So I'm in the right country for this shit but very much the wrong state.)
>>
>>57794963
upload to github, make a skills resume, include specific major projects as experience in your experience section, then apply. if you're an old fart they might discriminate against you for an entry position... they'd probably want fresh blood so you'd better be good
>>
>>57795000
shart in mart
>>
>>57795012

You can't talk to me that way anymore! Trump is going to cancel your H1B
>>
>>57794981
i just said "likely", which is true since embedded is a minority
>>
>>57795009
lol

then you don't need help
>>
>>57794829
CLRS
>>
>>57795023
i don't even have a H1B

seriously though, is it any good applying for one in USA?

i'm from europe, and had friend who went to work in San Francisco via H1B
>>
>>57795055
good reference, awful textbook
>>
>>57795072
drumpf will be sending the immigrants to a concentration camp soon so i would recommend you wait a couple years for him to be impeached first
>>
>>57795109
xD
>>
>>57794963
apply to jobs. don't let your lack of professional wagecuckery hold you back. If you know your shit you know your shit, if you don't you don't.
I wouldn't list projects on resume unless they were paid for by someone else, but do mention them in your cover letter
customize your cover letter, i've got a damn good reply rate for job postings and i attribute it to writing a customized cover letter for each position. Sure there will be people that tell you a cover letter is useless; ignore them 100% of the time. It's just as important as your resume. Address it to the entire company if you don't have a specific name. e.g. "Dear X Corp. Hiring Team"

I suppose you could update your resume with programming projects if you don't have any professional experience. I don't know how to best do it though. It's hard to say. It's hard to convince people you know how to program if you haven't had a job doing it for years already.
>>
>>57795109
>drumpf is a fashis ecks dee he's going to be in peach!

git out

>>57795072

That depends -- are you actually ANY good at what you do? If so, please come and take the jobs away from the poo-in-loos.
>>
>>57795141
>That depends -- are you actually ANY good at what you do? If so, please come and take the jobs away from the poo-in-loos.


even if i was, how do this things work?

you just go to their website and appy for a job even though you're from europe?

btw, what do you consider a good programmer?
>>
>>57795164
>btw, what do you consider a good programmer?

Gotta be a VB6 pro.
>>
File: 1479286874867.jpg (174KB, 633x758px)
1479286874867.jpg
174KB, 633x758px
>no one still described advantages of FP over OOP
Why is it allowed to meme around without any responsibility?
>>
>>57795230

Just use a multiparadigm language. Then you get to steal some of the benefits.
>>
>>57795230
Name your language of choice
>>
>>57795288
C
>>
>>57795333
C with built in algebraic data types would be much better, e.g. tagged unions and pattern matching.
>>
>>57795230
High capacity memes have to be restricted for the public's safety
>>
>>57795356
And what do I use them for?
>>
>>57795425
Have you never used discriminated/tagged unions in C?

And tuples would be very useful for C
>>
>>57791306
>>57794277
Why the fuck are you guys using one language to write in another language? Use, C, python, or bash, stop being ignint
>>
>>57794725 anyone?
>>
>>57795486
To get (You)s
>>
>>57795514
I would give the world for (You)
>>
File: 1479278448527.png (83KB, 235x235px)
1479278448527.png
83KB, 235x235px
>>57795437
Analogies don't work.
Get straight and tell, what does OOP have bad and what does FP have for OOP disadvantages.
I don't want to read "Let's have A for language B". Languages are constructed that way or another to fulfill needs in their own fields (idealistic statement, though)
>>
>>57795643
>analogies don't work
What analogy?
I gave a feature associated with functional languages (in fact, that traditionally OOP languages have been adopting) that would be useful
>>
>>57795437
>And tuples would be very useful for C
Structs already fill this role pretty well. It doesn't really seem that necessary.
It's not like other languages where you can't declare unnamed aggregate types, or declare types where they're used.
>Have you never used discriminated/tagged unions in C?
I suppose it would be nice to have in-built syntax for dealing with these. Although it's pretty easy to do it yourself, so it's unlikely the standards committee would add it.
>>
>>57795661
there exists a bot that reposts posts made on /g/ with updated post numbers for what it's replying to. if a post doesn't make sense, you can google it and see if it's been posted before
>>
>>57795669
structs need to be declared and you can't use patterns to extract their values easily

(int,int) quotRem(int x, int y) {
return (x / y, x % y);
}

int randomFunction() {
(int quot, int rem) = quotRem(3, 7);
return quot + rem;
}
// a silly use


as a bonus you could treat regular sets of function parameters as being tuples
(int x, int y) is just (int, int) but pattern matched into x and y


>>57795669
>it would be useful
it would indeed
>>
>>57792673
Both Atom and VSC are shit , because the languages they are programmed in are also shit , reason why they run slow.


Use Sublime text or if you're suicidal vim, emacs.
>>
Probably going to start game programming or some shit. I end up doing too much interesting networks shit at work to have anything to work on at home.
>>
>>57792673
i'm using atom as my haskell IDE and it took a little bit of setting up but it's really comfy
>>
>>57795700
>you can't use patterns to extract their values easily
C doesn't have that, obviously. You would need pattern matching for tuples to be of any use.
>as a bonus you could treat regular sets of function parameters as being tuples (int x, int y) is just (int, int) but pattern matched into x and y
These are huge, fundamental changes to the language. They would never get added.

Tagged unions are less of a stretch.
>>
>>57795762
that's because it's the only thing you can really call a haskell ide
>>
>>57795762
this, desu
>>
>>57792999
(defun nigger (dick &optional (cuck 1))
(+ dick cuck))
>>
>>57795774
it bops me on the head all the time about how my code has redundant parenthesis and can be made point free etc. they're not errors, just suggestions. it's like having a haskell sensei
>>
>>57795772
>you would need pattern matching
Yes, that's what I mean.

>huge fundamental changes
Perhaps because of how arguments are passed, but other than that it isn't a huge change, it's just a "now this is classed as that".

They could at least add tuples, tagged unions and pattern matching, without the other change.
>>
Implementing caesar's cypher in C. And practicing vim.
>>
>>57795803
Lint is pretty nice, except when it recommends what you don't want
>>
>>57795806
Make a proposal to the C standards committee then.
They're currently working on the next standard.
>>
File: CvqRzsvUMAA9BMX.jpg:large.jpg (128KB, 680x992px) Image search: [Google]
CvqRzsvUMAA9BMX.jpg:large.jpg
128KB, 680x992px
Has anyone ever used Imgur's api? https://api.imgur.com/#authentication

I don't know what to choose between code, token or pin because the response I get to the url is a webpage, how the hell do I get something like json so I can navigate and get the code/token/pin I want without opening a browser.

I just want a simple tool to upload images to imgur
>>
>>57795855
well you can hardly go to them and say "add all this shit pls"

parametric polymorphism (perhaps via void pointers) and lambdas would be nice
those two alone could reduce the size of C code significantly
>>
today's phptard story
==============
prof: "The questions i give you aren't difficult. The reductions will generally be a case of reducing from a general case to a specific case or something similar"
phptard: "how about what's 2+2? you should ask us that"
prof: "well, the problems have to be related to the course"
phptard: "i was being facetious. faa see shus."
*php tard storms out of the room and throws a piece of paper in the trash, misses, has to walk back int he room and put it in the trash, and then continues out*
>>
File: 1461389842104.png (386KB, 1436x1652px) Image search: [Google]
1461389842104.png
386KB, 1436x1652px
>>57795911
>, misses, has to walk back int he room and put it in the trash
>>
>>57795823
that sounds like exactly the opposite of when it'd be nice
>>
>>57795924
yeah sometimes it's like

why don't you use xyz
and i'm like
muh formatting
>>
>>57795923
can't make this shit up. the question was to reduce from the hitting set problem to the vertex cover problem, and i didn't get it correct either because it didn't occur to me to give it a list of EDGES as the input, and i was stuck on a list of nodes. but i could admit afterwards it wasn't a hard question. it was a 1 line reduction. the dude thinks he's really hot shit and is mad that he doesn't understand
>>
>>57795875
>well you can hardly go to them and say "add all this shit pls"
I don't know exactly how the proposal system works, and I think you would have to go through a national standards body, but I think anyone is actually capable of making a proposal for them to look at.
It doesn't mean they'll add it, and they would probably go through several iterations of if they were going to, but I think it can be done.
>parametric polymorphism
This can introduce all sorts of problems with C's ABI. Also, the committee doesn't to like to add seemingly "simple" features that lead to an explosion of generated object code.
>lambdas
There is a proposal for closures in the next C standard.
>>
>>57795958
>parametric
i mean it would just be syntax for void pointers
no object code bloat, just void pointers

templates aren't the only way to do parametric polymorphism
in languages like Haskell you can have infinitely recursive parametric types (i.e. the type is List of List of List of List of List of List ... )
>>
>>57795875
Replying to myself:
>>57795958
>What I said about parametric polymorphism.
For some reason, it didn't register that you said "via void pointers". I can think of that having it's own issues though.
How would you tell the function what type it's actually dealing with? It would probably require something quite non-portable or slow.
Also, nobody wants to do that shit at runtime. We're talking about C.
>>
>>57795993
>How would you tell the function what type it's actually dealing with
It would just entirely be compile time type checking.
Types wouldn't need to exist at runtime, it would just be void pointers and when you get out of the parametric type and into the specific type it gets a void pointer and knows what it has.

though void pointers are an indirection ofc
>>
In ansi compliant C, is it possible to have a function macro execute a return statement in the function from which its called if a certain condition is met, but just continue otherwise? example

Without any other code than the macro call in the caller function.

#define IS_CIANIGGER(a) (...)

int random_function(...){
...
IS_CIANIGGER(some_struct);
....
}
>>
>>57796023
Yes. Macros are just text replacements, so you can put whatever you want in there.
#define IS_CIANIGGER(a) if(some_condition(a)) return 0;
However, it is considered extremely poor style to put anything control flow related in a macro.
>>
trying to fit all of this on 2 pages of notebook paper for the final
http://www.cs.ecu.edu/~karl/4602/fall16/notes.html
wake me up
>>
somebody explain named lambdas in racket
>>
>>57796460
oops
I mean, named (let)'s
>>
>>57796162
why don't you just write down the things you don't know
a lot of this is trivial
>>
Learning concurrency with c++. I have a function inside of an "image" class which creates image data from a file, and then sets its own image through a different function. I'd want to lock the set() call with mutex, to prevent multiple calls to set() interleaving, but NOT lock the create function which creates a temporary object local to the function, since it can and should be executed in parallel, and there is no conflict between the functions. Does that sound right?
>>
>>57796162
Print it really tiny and bring a magnefying glass
>>
>>57796483
but what if i forget Q_Q
>>
>>57796502
he specifically doesn't allow magnifying glasses and it has to be hand written
>>
>>57796463
>>57796460
What about them? Just like any other let, you bind a name to values only within the scope of the let. They also look kinda like recursive functions since you can call the name you gave it from within. Like this:
(let loop ([a 0] [b 5])
(cond ((equal? a b)
(print "done"))
(else
(print a)
(loop (add1 a) b))))

This prints 01234"done".
loop, a, and b only exist inside the scope of the let.
Looking at this, do you have any questions?
>>
>>57796564
I should note that the square brackets are completely equilivant to parentheses and using them like that is a purely stylistic choice on my part.
>>
>>57796564
ok, so, its like a procedure that calls itself on the cadr's of the pair list?
>>
>>57796666
yeah pretty much.
>>
>>57796564
also
whats with the naming conventions such as
something/whatever
cuck!

key chars here are / and !
>>
File: autocomplete-2.png (72KB, 1256x358px)
autocomplete-2.png
72KB, 1256x358px
Has /dpt/ applied to quantitative finance firms with their meme Haskell knowledge?
>>
>>57796769
this shit is unreadable
at least haskell has the decency of having nice, concise syntax
with many short form constructs
ocaml is all _+:>>:ASDW in their sgnatures
>>
>>57796769
>let everywhere
>>
>>57796681
also, quasiquoting
>>
>>57796701
These threads go over a few of them.
https://lists.racket-lang.org/users/archive/2011-September/048043.html
https://lists.racket-lang.org/users/archive/2011-September/048049.html

also http://docs.racket-lang.org/style/Textual_Matters.html#%28part._names%29

For those specifically, / can be read as "with" and ! indicates that the procedure has a side effect.

>>57796839
see https://docs.racket-lang.org/guide/qq.html
>>
I think that perhaps my interests within computer science could be combined under a single umbrella: application platforms. I like studying operating systems, virtual machines, emulators, and programming languages and CPU architectures in general. Kind of wondering what I should do a PhD dissertation on...
>>
>>57796970
Quantum Computer: Operating Systems
>>
>>57796989

I think before you can even ask what an operating system for a quantum computer is like, it is more important to ask what an instruction set for such a machine is like.
>>
>>57796564
(do ((a 0 (1+ a)) (b 5))
((= a b) (princ "done"))
(princ a))

pshh
>>
>>57796989
Quantum Computing is such a dull fucking topic
Who cares? Just the latest "s-science is cool!" meme
>>
>>57797015
Except that doesn't explain named lets.
>>
>>57796970
Do it on programming languages
>>
>>57794402
In Polish, it's just "cyka blyat"
>>
>>57796970
wtf, I thought you just a neet.
>>
>>57797002
That could be a section for your PhD dissertation, though
>>
>>57797059
He's just as bad as a neet, he's refusing to enter the workforce because it scares him so he's staying in school and getting a doctorate.
He'll either burn out or be stuck in academia forever.
>>
>>57797059
>Thinking Ruby-senpai is a NEET

Newfag detected.
>>
File: end my life.jpg (75KB, 640x640px)
end my life.jpg
75KB, 640x640px
So in Java, if I declare a variable as type Animal, what instances of classes can be assigned to to that variable at runtime?

pls help. I'm having trouble understanding.
>>
Think I'm gonna re learn from the basics when I graduate, this time with C. I feel like my university fucked me and put me in this hole. I know there's a concept I'm missing I'm just not sure what it is so I'm going back to the basics. I'm choosing C because it's well documented. Maybe add some math as well.
>>
>>57797111
why not learn a real language instead
>>
>>57797089
An instance of the Animal class or any subclass.
>>
>>57797115

Is there a language that's better documented than C and will help me grasp the basic programming concepts?
>>
>>57797111
Do discrete maths! A lot of that's very enjoyable to put into programming terms.
>>
>>57797138
Haskell
>>
>>57797076

To be fair, my original intention was to get a few years experience in the workforce, and then go on for a PhD. After some words with my professors, they have recommended going straight into a PhD due to the sheer amount of students coming into computer science, causing universities to have need for professors, combined with the fact that corporate research institutes keep stealing up PhDs.

And whether or not I decide to enter corporate research or just work as a professor at a university, I'll at least be contributing more to society than someone with no job or education.
>>
>>57797111
>I'm choosing C because it's well documented.
I'm all for more people learning C but you're going to have a fun time realising that "well documented" just means "this case is undefined behavior". Good luck.

>>57797115
>C
>not a real language
>>
>>57797138
All relevant languages today borrow heavily from C.
Nearly every modern programming construct can be traced back to C.
>>
>>57797171
This post couldn't be more wrong
>>
There is no downside to knowing C
Every programmer should know it
Even if you never plan to use it for a serious project
>>
>>57797203
There is no upside to knowing C
>doesn't remotely cover modern programming
>hardly added anything unique
>isn't even that portable
>awful to write in
>>
>>57797211
You know how I know you don't know C? ;)
>>
>>57797222
It's just obviously shit bait.

Just don't bother responding to it.
>>
>>57797222
>>57797228
Sorry I'm not part of the Cult
>>
File: K&R anime edition.jpg (174KB, 792x1000px)
K&R anime edition.jpg
174KB, 792x1000px
>>57797239
They make books aimed at 12 year olds about learning C, are you stupider than a 12 year old?
>>
>>57797247
I haven't bothered to learn it.
It offers literally no advantage to me.
If I wanted to use C I'd use C++
>>
>>57797171
Wew
>>
>>57796970

I like that stuff too. It's more fun than crud, 2bh
>>
>>57797286

Really? I would have pegged you as being more interested in image processing...
>>
In C, what are the use cases for symbolic constants with #define vs const variables? When should I use one over the other?
>>
>>57797286
>>57797304
who are you guys
why do you have a trip?
>>
>>57797313
use enum
>>
>>57797304

I like image processing too, but writing those meme languages gave me an interest in PLs, VMs, emulators, etc.
>>
>>57797313
When it's just a couple of magic numbers, not much difference really, as long as you stay consistent in using only one over the other, but a case where I'd use const over #defines would be where if I have a large table of constants and making a list of #defines is retarded.
>>
>>57797030
It explains that they are useless.
>>
>>57797348
for every constant I should use an enumerator? That seems a bit dumb
>>
>>57797316
The senseis of /dpt/.
>>
for someone with no programming experience and is less-than-apt at mathematics, but decent at (mathematical) logic and an extensive background in computers, is SICP a good starting point or is it a bit too abstract to start with?
>>
File: 2016-12-01-232151_333x54_scrot.png (5KB, 333x54px) Image search: [Google]
2016-12-01-232151_333x54_scrot.png
5KB, 333x54px
why is this true?
>>
>>57797402
>senseis
senseitachi desu senpai
>>
>>57797416
sicp is high school tier math
>>

boolean answeredYes = true/false;

if (answeredYes) {
current.yes = new QuestionNode(object);
current.no = nodeToChange;
} else {
current.yes = nodeToChange;
current.no = new QuestionNode(object);
}


How do I optimize this piece of code.
>>
>>57797416
If you understand basic logic, you should be able to go through SICP just fine.

You don't need a college degree to understand or use most programming languages. Even the pretentious ones like Haskell or Rust.
>>
>>57797442
>Haskell
>pretentious
>>
>>57797442
>pretentious
only applies to c-fags, btw
>>
>>57797423
fuck if I know
>>
>>57797423
The innermost commas are evaluated first. Only level 2 commas are evaluated, the others are quoted.
>>
>>57797435
Keep an array of two elements, instead of yes and no.
current.ans[answeredYes] = newQuestionNode(object);
current.ans[!answeredYes] = nodeToChange;
>>
>>57797435
>>57797471
I feel like whatever this guy is doing, they are doing it wrong and needs to redesign if this is how the code is going to look like.
>>
>>57797180
All relevant languages today borrow heavily from Javascript.
Nearly every modern programming construct can be traced back to Javascript.
>>
>>57791122
So I did some small projects ranging fro Hello World to Hangman on C++, C#, and Java, and learned how to use git to make repositories for them on GitHub.

What now? I'm aiming for a portfolio that can get me at least an entry level job, but the textbook projects I'm practicing only have these kinds of challenges and I'm not sure how to get into open source work or make something actually useful.
>>
>>57797124
Thanks. got another question.

when the method is actually called, does the compile-time class or runtime class get executed?

Thanks for your help.
>>
>>57797629
Don't think of it in terms of the class, think of it as the object itself. A class is a type + a blueprint for making objects. So if B is a subclass of A, an object of B is still an object of B (i.e. has the methods from B) but it can be used wherever an object of A is expected.
>>
>>57797654
...So the compile-time class gets executed? is that what you're trying to say? Sorry if I'm retarded
>>
>>57797675
Well it's not exactly the correct thing to say but it's the method from the "runtime class" of the object that is executed. I know what you mean.
>>
>>57797576

Do you have any small problems in your own life that could be solved with a program? If so, create it! People like useful software.
>>
>>57797313
#define is a messy thing for languages to interface with. For this reason you should avoid them, most of the time.
>>
>>57797166
after some words with bums on the street, do you decide to take out a loan to give them thousands of dollars too?
>>
>>57797706
That seems like the next step, but I'm a bit lost on how to cross that bridge. I understand the basics of data types, classes, functions, I/O and recursion, and that's enough for me to make, like, a GUI calculator in C# using Visual Studio, but it feels like a big leap from that level of work to writing something more robust. For now I was thinking of a text calculator to parse long equations since I ran into the problem of not having my old TI calc on hand and suddenly having to use the basic Windows one, but that's about it. Hopefully I can figure something out after that, but a lot of problems I think might be solvable with programming feel like they're way beyond my skill level.
>>
>>57797576
What you need is experience. Not just job experience but experience writing code and solving problems so you get an intuition of what you can/cannot do with specific languages and available tooling. A lot of well-known projects are born just from somebody wanting to make something that was useful for them personally or because they wanted to do it for fun.

Work on random shit that you feel like working on. Like if you needed a script or program to do something, write one. Maybe make a simple game you like just because you can.

Try out competition programming shit like Advent of Code going on right now ( http://adventofcode.com/2016 ) or other shit like TopCoder (though TopCode personally annoys me). Maybe if you're more into low level stuff, you could check out CTFs. I think there are noob-level CTFs that are available for people who are starting fresh and want to get into them. Then there's also puzzle shit like Project Euler.

Technical interviews usually grill you on the basics because they're trying to filter out idiots who tried to memorise a Programming For Dummies book and think it's good enough. If you can say to yourself that you can reasonably solve simple questions that somebody could throw at you like doing some file I/O, string processing, basic math / algorithms, you are pretty set and just need to work on getting noticed.

Go out there and code.
>>
>>57797348
Any reason not to use enums over #define constants?
>>
>>57797166
This >>57797755
It doesn't make much sense to listen to professors tell you 'we need professors' and basing your decisions off that.
Unless your goal in life is to serve these professors then you shouldn't consider it proper motivation for going that route.
>>
>>57797745
I only ask because K&R introduced symbolic constants used like this right off the bat
>>
>>57797435
>how do I optimize this piece of code
What do you really mean?
I'd say if this is a linked list or similar structure get rid of that first.

Then write something that handles multiple questions at once.

Then profile again and find a bottleneck. But really if you haven't profiled and found this to be your biggest issue then you're not really sure if you're optimising or not until you have.
>>
@echo off 
:b
SET m=%m%memes
SET /A c=c+1
IF [%c%]==[10] SET /A c=0
COLOR 0%c%
echo %m%
goto:b

rem for /L %g in (1,0,5) do ( cmd.exe /K "for /L %m in (1,0,5) do ( echo snake%m > game%m )" )


memes -> ∞
>>
>>57797810
Thanks. I think what's bugging me is that it feels like everything I know so far is incredibly basic compared to the wizardry I see in actual projects on github, down to the lingo, organization, source control stuff, and documentation. I think I'm loaded up on nothing but beginner textbooks and bookmarked online tutorials that all go over things like loops and arrays and never get much further than curiosities.

Is there a standard intermediate level text that could help?
>>
File: tree2.png (53KB, 593x482px) Image search: [Google]
tree2.png
53KB, 593x482px
>>57797512
This is just to determine where I should attach a new node.
>>
File: 387927d3ce4e293dc7a40dd020ce17cd.jpg (343KB, 2134x1200px) Image search: [Google]
387927d3ce4e293dc7a40dd020ce17cd.jpg
343KB, 2134x1200px
What programming things (books, devices) do you want for christmas
>>
>>57798023
Lain
>>
>>57798023
SICP. Alternatively, a book about writing drivers or about kernels focused on Linux or Unix.
>>
how is this uncomputable? can't you just try all combinations and see if any of them pass? shouldn't this just be NP?
>>
>>57797755

The university I am currently attending does not offer a PhD program. My professors cannot stand to benefit monetarily from me getting a PhD. Also, with regards to loans... the university I am applying to offers all of its PhD candidates an ability to do a TA or RA position for full tuition plus $2600 a month in a stipend. Not a ton of money, considering it's Seattle, but it basically pays for itself.
>>
>>57797844
I think it's best to avoid the preprocessor at all costs
>>
>>57798126
you're still taking up a bunch of professor's advice on becoming a professor. if you read a book, even if it's not very good objectively, you're more likely to recommend it to someone than a book you haven't read. you should've probably gotten advice from people who don't have PhD's as well on whether to get a PhD or get a job
>>
>>57798097
You can't try all combinations because there are infinite.
>>
>>57798097
exhaustive search is not computation. Turing's "on computable numbers" was an answer to the entscheindungsproblem, which is the problem of finding a general way to solve diophantine equations (for example, Fermat's last theorem). We can, with very good machines, simply exhaustively search as many numbers as we want, but this isn't computation, this is as good as guessing.

And, as Turing concluded, there is no way to generally solve these types of problems; the entscheindungsproblem is not computable
>>
>>57798097
Infinite combinations because you're allowed to copy the dominoes indefinitely.
>>
File: captcha.jpg (4KB, 300x57px) Image search: [Google]
captcha.jpg
4KB, 300x57px
>>57795661
>I gave a feature associated with functional languages (in fact, that traditionally OOP languages have been adopting) that would be useful
a) It has no explanation why OOP is bad
b) It has no explanation why FP is good
Proper strings would be awesome for C too, but that doesn't explain anything.
>>
>>57798173
ah didn't see the part where you can have copies
>>
>>57795643
The OOP mindset, where you design software as systems of actors that send messages between each other, simply does not fit realistic programming. It is so far removed from what actually happens when a program is run on a computer that it cannot be used whenever performance and safety is necessary. Its one big claim to fame is that it makes it easy to prevent large teams of stupid programmers from stepping on each other's toes.

Although saying OOP is bad has nothing to do with saying FP is good or finding reasons that it's better, while FP still provides a high level abstraction, it never fundamentally loses sight of what a computer does - takes input, does some processing, and gives output. It's a logical improvement on procedural programming whereas OOP comes out of left field.
>>
File: check em.png (22KB, 327x312px) Image search: [Google]
check em.png
22KB, 327x312px
Who has their stars so far for day 2 of Advent of Code?

Today was bretty easy.
>>
>>57798334
Is it too late to start? What's the schedule like? I wasn't good enough last year but I'll give it a shot this time if it's not too late.
>>
>>57798334


To play, please identify yourself via one of these services:

[GitHub] [Google] [Twitter] [Reddit]

hmmm
>>
File: 2016-12-01-215416_295x91_scrot.png (7KB, 295x91px) Image search: [Google]
2016-12-01-215416_295x91_scrot.png
7KB, 295x91px
>>57798346
Not too late. You can start any time. I'm pretty sure you can still start last year's if you want.
>>57798357
Make a throwaway twitter.

>>57798334
Today is a good day
>>
>>57798371
Nice job, man! I got home too late to qualify for the leaderboards. Maybe one of the days I'll be free right at midnight but that seems unlikely.

>>57798357
you can make a throwaway reddit account fairly simply and anonymously my dude
>>
>>57798313

Not the last anon.

Even SICP states that FP's substitution model eventually breaks down. We can make procedural applications on the data, but ultimately mutable data fucks everything.

So why have mutable data? It makes things easy. Try to make a website from a functional standpoint.

Abstract concepts like a header, body, and footer or "design elements" are very difficult to describe as having any kind of set procedure, although there may well be one.

OOP sucks for programming but for coding it's basically 100% necessary. So basically OOP on the streets, FP between the sheets I'd say. :^)
>>
>>57798423
So? FP doesn't pretend you can make everything immutable, or that there's no state at all.
>>
>>57798155

Keep in mind though, that the end goal was a PhD anyways. The question is one of timing -- whether to work for some number of years first, or to go for it straight away. And yes, many of my professors have worked in industry before getting their PhDs, which is why I was considering doing so originally.
>>
>>57798423
>>57798436
And how exactly is a website made from an object-oriented standpoint? A website is mostly static content, that's just data and not programming at all.

JQuery is extremely functional, just so you know.
>>
File: c8dis.png (19KB, 910x573px) Image search: [Google]
c8dis.png
19KB, 910x573px
Wrote a chip8 disassembler. :^)
>>
>>57798313
THAT'S WHAT I CALL A REAL TALK
>It is so far removed from what actually happens when a program is run on a computer that it cannot be used whenever performance and safety is necessary.
Well, that's why Python and Java are never known to be fast languages, isn't it?

>Although saying OOP is bad has nothing to do with saying FP is good or finding reasons that it's better, while FP still provides a high level abstraction, it never fundamentally loses sight of what a computer does - takes input, does some processing, and gives output. It's a logical improvement on procedural programming whereas OOP comes out of left field.
Well, it's a popular opinion here, that FP > OOP, and I want to find roots of such opinions.
High-level abstraction? Does it involve taking functions as parameters?
As for me, I never found any problems with OOP, and I was using it as some properties of some super-variable (methods and properties). Even more, when I got to learn C, I understood that I could reimplement classes and objects in plain C perfectly, the only problem would be is reimplementing polymorphism - even inheritance isn't a big uncoverable thing.
>>
>>57792673
Any of the jetbrains porducts, depending on your languge of choice

>ib4 shill
I do it for free
>>
File: shobon on a computer.png (7KB, 284x284px) Image search: [Google]
shobon on a computer.png
7KB, 284x284px
In Java, when can an object variable refer to different types of objects during the course of a program?

and
>How do you declare the object to make this possible?
>>
>>57798538
>High-level abstraction? Does it involve taking functions as parameters?
Abstracting over functions is one thing, yes.
>>
>>57798530
that's awesome
>>
>>57798560

It's actually [spoiler]fairly trivial[/spoiler], just a bunch of typing, double checking, and then realizing that it was borked due to endianness.
>>
>>57798436

No but it strongly wants you to avoid state changes. Scala for eg making its Lists immutable

It's fair enough, any change should be the result of a procedure and map does that pretty well in most cases.

I personally find it makes more sense, but a lot of my colleagues take the code monkey view of "why can't I change this here and now".
>>
>>57798449

I don't know if you've done php before but that uses a lot of parent-child relations and other OOP concepts very strongly.
>>
>>57795792
>&optional
(define (nigger dick [cuck 1])
(+ dick cuck))
>>
>>57798530

Great, now write a JIT compiler for Chip8 to ARM.
>>
>>57794081
>>57794109
>>57794136
>hahahahaha so funny, it has jewish constructs, hahah lmao
you faggots don't know that parenthesis are needed allow for the god-tier macros lisps offer
>>
>>57798588

"ARM is fucking garbage!" - Linus Torvalds

That said, wouldn't even know where to start with something like that.
>>
>>57798582
>PHP
If anything that's another point against OOP.
>>
>>57798192
One, I wasn't trying to argue against OOP
Two, what the fuck? A good FP feature isn't a reason FP is good?
>>
>>57798538
>Well, that's why Python and Java are never known to be fast languages, isn't it?
Funnily enough neither of them are functional, either.
>>
>>57798192
functional programming can incorporate principles of good OOP design like modularity, reusability, etc. just as OOP languages can incorporate functional aspects
>>
>>57798545
pls respond
>>
>>57798545
Are you talking about abstraction/polymorphism? A variable with a certain object type of A can point to an instance of a different type B, if A is a superclass of B. A is implemented by B
>>
>>57798613
>modularity, reusability
Since when did OOP have a claim over these? This is just good programming practice no matter what.
>>
>>57797052
I thought it was "Kurwa!"
>>
>>57797898
The reason I say you need experience is because all the textbooks in the world won't make you a better engineer.

It's like following recipes online for things all the time. Eventually you're going to have to develop an intuition on how things should look / smell / feel for something you want to do that isn't in an online recipe.

After the syntax tutorial books, there's nothing much left except higher level algorithms / math. You need to go build shit on your own.

Like I said, go try out the coding challenges like Project Euler and Advent of Code. Those problems are designed to be solved by computers and algorithms, not math, so you have to use what you know to solve them.
>>
>>57798570
doesn't need to be technically challengeing to awesome imo.
>>
>>57798640

Got the inclination to do it after talking about MIPS instruction formats for a few minutes in my digital logic class the other day. Chip8 is fairly non-threatening, and not too hard to pick apart for what it is.
>>
>>57798632
not saying they're not. go read some OOP literature if you' don't think oop proponents think they have a claim on it though
>>
Having a really hard time understanding the for macro in racket.

There's too much going on
Aside from the simple
(for [i 10] (proc i))
>>
>>57798661
Why did you say it, then? I might as well go ahead and say that I just made up a new paradigm and its principles are using variables and not crashing so everyone is already using it or at least trying to.
>>
>>57798620
Yeah.

How would you declare it though? Would you just declare the object as abstract?
>>
>>57798677
you sure are defensive about functional programming
>>
>>57798749
Did I say anything about functional programming?
>>
>>57798759
when you sperged over me implying OOP has better modularity than functional programming
>why'd you say it bro? huh? why? i can say my shit is gold bro why the fuck you say it?
>>
>>57798788
No, I just have a problem with OOP fags widening the definition of OOP to contain every good thing they can think of. Maybe I shouldn't, because whenever you do that you also diminish it, and saying "you should use OOP" becomes meaningless.
>>
Dear /g/ why is a clean install of cabal unable to set up a simple package?
>>
>>57798803
Install the dependencies first?
>>
>>57798681
ClassA var = new ClassB();

It could be a number of cases:
>Class A and ClassB are classes or abstract classes, and B extends A like what you said
>A is an interface and B is a class that implements A
>>
>>57798798
OOP has greater modularity than functional programming. if you don't like that fact, that's a you problem
>>
>>57798604

ehh maybe

php still runs most things. Like it or not without php was the answer that worked for the www and basically still runs a good 70% of it or something large anyway

there was a graph a while ago on /g/, don't have it now

I'm not saying it's good but it did work for people
>>
>>57798858
I don't understand this at all. As far as I can tell, it's much easy to program functionally in a non-functional language than it is to do OOP in a non-OOP language.
>>
>>57798858
Enlighten me, then.
>>
>>57798836

Just declare everything as object. Works a treat.
>>
File: womenincomputing.png (469KB, 714x1000px) Image search: [Google]
womenincomputing.png
469KB, 714x1000px
>>57798869

not the previous anon

on a funny sidenote, I witnessed a colleague last week make 22 java files, one for each class when all he needed was one.

It's amazing how some people grasp neither concept
>>
>>57798892
>he routinely violates the one-class-per-file rule

giddout
>>
>>57798884
Literally pajeet
>>
>>57798892
what the fuck? What's his pay?
>>
>>57798914
I try to keep to the 0 class per file rule, because I've not fallen for the OOP pyramid scheme
>>
File: 1478070131861.png (373KB, 600x600px)
1478070131861.png
373KB, 600x600px
Fuck it Haskell's package repo's are absolute garbage, I'm going back to Lisp.
Cabal you had your chance and you blew it. It's a shame, Haskell would have been fun.
>>
>>57798605
>A good FP feature isn't a reason FP is good?
I want to know why FP is good in overall, not part by part.
FP features don't make OOP language an FP language by miracle, so OOP features don't make FP language an OOP language by miracle.
>>
>>57798959

Yeah well you're stupid
>>
>>57798602

It's just like writing a regular compiler, but instead of writing to a file, you put it into an executable section of memory, throw a function pointer at it, and let go.
>>
>>57798969
Cabal is fucking easy to use
Are you retarded?
>>
>>57798973
You can't fucking make your mind up
When someone gives you a feature, "too specific"
When someone gives you general advantages, "too general"
>>
>>57798973
Trying to divide languages into disjoint groups is really pointless.
That being said, there is both theoretical and empirical evidence that FP paradigms are extremely useful for software engineering.

>>57798984
>clean install
>try to install package off of wiki
>impossible to resolve dependency loop that requires downgrading my entire haskell install
>try a different library
>compilation errors
Package managers are supposed to fix these fucking issues
>>
>>57798977
>It's just like writing a regular compiler

Which I definitely have a ton of experience with. I promise!
>>
>>57798998
Have you not considered that maybe you were trying to install an outdated package?

Anyway, there's stack
>>
File: 1480187247997.jpg (39KB, 600x619px)
1480187247997.jpg
39KB, 600x619px
>>57798914
This was small scale shit, not production. I meant more that he just needed one class period for what he was doing but he somehow managed to make 22 classes. It was just a Java .NET test server for checking functionality. How he made 22 I have no idea.

As for the one-class-per-file, yeh I can see how in the age of pajeets that would be a thing.

>having infinity tabs open in your IDE/text-editor
pass
>>
>>57799022
I have never once had errors installing from pacman or the AUR, or from pip.
What functional-reactive package should I install to do UI work? Why should I have to step over a fucking minefield of outdated packages?
>>
>>57799051
>As for the one-class-per-file, yeh I can see how in the age of pajeets that would be a thing.

It's got nothing to do with pajeetism, lad.
>>
>>57799055
Apparently that's what grapefruit is for
>>
>>57799067
It's too bad that grapefruit is impossible to install :)
$ rm -rf .cabal/

$ cabal update
Config file path source is default config file.
Config file /home/-----/.cabal/config not found.
Writing default configuration to /home/-----/.cabal/config
Downloading the latest package list from hackage.haskell.org

$ cabal install grapefruit-frp
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: semigroups (dependency of grapefruit-frp-0.1.0.5)
rejecting: semigroups-0.18.2/installed-Abb..., semigroups-0.18.2,
semigroups-0.18.1, semigroups-0.18.0.1, semigroups-0.18, semigroups-0.17.0.1,
semigroups-0.17, semigroups-0.16.2.2, semigroups-0.16.2.1, semigroups-0.16.2,
semigroups-0.16.1, semigroups-0.16.0.1, semigroups-0.16 (conflict:
grapefruit-frp => semigroups>=0.8 && <0.16)
trying: semigroups-0.15.4
trying: semigroups-0.15.4:+hashable
trying: semigroups-0.15.4:+unordered-containers
trying: unordered-containers-0.2.7.1/installed-5IN... (dependency of
semigroups-0.15.4:+unordered-containers)
trying: semigroups-0.15.4:+text
rejecting: semigroups-0.15.4:+deepseq (conflict: unordered-containers =>
deepseq==1.4.2.0/installed-1.4..., semigroups-0.15.4:deepseq => deepseq>=1.1
&& <1.4)
rejecting: semigroups-0.15.4:-deepseq (manual flag can only be changed
explicitly)
Dependency tree exhaustively searched.


https://www.fpcomplete.com/blog/2015/05/thousand-user-haskell-survey
"Package management with cabal is the single worst aspect of using Haskell. Asked if improvements to package management would make a difference to their future choice of Haskell for a project, 38% said it would be "crucial" and a further 29% said it would be "important". Comments connected cabal with words like hell, pain, awful, sucks, frustrating, and hideous."
>>
>>57799087
I haven't had this problem, try manually installing a compatible version of semigroups
Or try stack
>>
>>57799051
Pajeets are the type of disorganised assholes who'd shove multiple class definitions into one file.
>>
>>57799087
>>57799110
With cabal that is, I haven't tried grapefruit
>>
>>57798869
previous anon, possibly true but it's still an ordeal programming functionally in nonfunctional langs. you need things like partial application and functions as parameters to program functionally effectively
>>
>>57799110
I think semigroups IS the problem, with the older version being impossible to install due to fucked up recursive dependencies.
I'll give stack a shot.
>>
>>57799138
If it doesn't work, you still have the option of using a general FRP library and integrating it with a graphics libraries
>>
New thread

>>57799306
>>57799306
>>57799306
Thread posts: 317
Thread images: 27


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.