[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: 318
Thread images: 26

What are you working on, /g/?

Old thread: >>59280552
>>
File: haskell quote.png (1MB, 790x960px) Image search: [Google]
haskell quote.png
1MB, 790x960px
>>
>>59288233
Haskell is a Jew?
>>
>>59288261
No, Haskell is a purely English, Anglican programming language.
>>
>>59287957
VB didn't get local functions or the new pattern matching features C# has now.

C# has the ability to play outside of the sandbox with the
 unsafe 
keyword. This alone is a massive difference between the two in terms of the language's power.

Toolset support differences and documentation/example availability. C# is obviously the first-class language for things like Xamarin.

No VB Interactive counterpart to the C# Interactive. IntelliSense and refactoring features available to C# are not all available in VB.

Now and future support and features: Mads "Skeet on Java Pajeets" Torgersen basically said that VB is going to be kept more stagnant than C# so they don't piss off VB's target audience: boomers who came from BASIC that get mad at new features.

Dim muhThing as Type
syntax is disgusting, however, that's just my own opinion. I like some of VB's syntaxes, but overall it's hideous to me.

I'm not saying VB is necessarily terrible, but it's no secret that there's much more support for C# across toolsets and it's going to be getting the lion's share of development cycles moving forward.
>>
File: sicp meme 29821.jpg (176KB, 1280x720px) Image search: [Google]
sicp meme 29821.jpg
176KB, 1280x720px
Friendly reminder that going to college for computers has been a fool's errand since 1978.
>>
File: test (10).png (2MB, 1484x1120px) Image search: [Google]
test (10).png
2MB, 1484x1120px
>>59288217
Why the fuck are the books sewn spine to spine? How the fuck do you read that shit?
>>
>>59288318
Why the fuck is that english book backwards?

these shitty shops have no fucking effort
>>
Is there anything in particular I should use to learn R?
>>
Can anyone share the haskell book with me? I'm too poor to buy it and I can't seem to find a free download link to this book.
http://www.haskellcraft.com/craft3e/Home.html

I'm looking to learn programming and I'm very at maths.
>>
>>59288334
She's using a translation of the Japanese translated English textbook you idiot. Duh
>>
File: test (4).png (532KB, 602x699px) Image search: [Google]
test (4).png
532KB, 602x699px
>>59288350
Try libgen.
>I'm very at maths
Same here.
>>
>>59288350
No, you must fight against degeneracy, lest you become a degenerate. Therefore, Haskell must never be used, and I will not share this book with you.
>>
>>59288350
gen.lib.rus.ec
>>
>>59288352
japanese can be written left to right down the page western style or down and to the left japanese style.

why do you think a textbook would be written like a japanese novel?
>>
>>59288350
There's a pdf somewhere.
The haskell wikibook is also good
>>
>>59288376
Don't reply to me ever again unless you're contributing to the thread
>>
>>59288316
>sicp meme 29821
post rest 29820 pics
>>
>>59288350

https://0x0.st/pbp.pdf
>>
>>59288374
Thanks
>>59288429
>1000p
Oh boi
>>
>>59288449
It does a load of stuff on lambda calculus first
If you already know lambdas then you can pretty much skip that entire section

I'd learn with the haskell wikibook instead
https://en.wikibooks.org/wiki/Haskell
What OS are you using?
>>
>>59288471
GNU/Linux
>>
>>59288497
Then you should probably follow what the tutorial recommends for installing haskell
>>
>>59288497
>Trash/Lincux
fixed that for you.
>>
File: 16387944.jpg (32KB, 552x446px) Image search: [Google]
16387944.jpg
32KB, 552x446px
>>59288523
What ultra sophisticated system are you using?
>>
redpill me on REST apis

is it a meme?
>>
Studying through K&R.

Some years ago I couldn't get past over like six pages. Now, after a programming course and a Data Structures course, I'm slowly reading through it, which feels great.

Funny, this really is not a book for newbies.
>>
>>59288550
It's not really sophisticated.
>>
>>59288669
Into the trash it goes
>>
>>59288630
C is a beginner language
>>
>>59288626
It's useful when you want to make several services based on the same data set. You don't acutally have to make everything super RESTful but it's a decent set of guidelines.
>>
>>59288699
>reading comprehension
>>
>>59288550
>that reddit image
>>>/r/ibbit
>>59288626
>"meme"
>>>/r/abbit
>>
>>59288720
Who are you quoting?
>>
i'm strapped for cash so i'm going to learn java
i plan on studying 8hrs per day and bought t430 thinkpad for this purpose
now, can i go from zero to being able to find a job in 2 months? a coding job, not becoming expert programmer

i don't want to go back to call centre tech support?

also give me resources its not like you're here because you have anything better to do atm
>>
>>59288700
What exactly does it mean to be "RESTful"?

I understand using HTTP "verbs" to represent certain tasks (e.g. GET to retrieve information without modifying and POST to add/update info), and using a URI but is that all there is to it?

I can't find a standard way to pass parameters to a POST request. Some people say you should pass parameters in the request body, others say that it's fine to pass them as URI parameters
>>
>>59288365
where should I begin if I want to be very at maths too?
>>
>>59288735
Good morning gate keeper.


How's that 4chen safe place protection mission going?
>>
>>59288788
I would reply if you didn't format your post in such a redditor way. You could delete it and make a new one though.
>>
Gatekeeper is a buttfrustrated redditor, right?
>>
>>59288808
Better dead, than redd.
>>
>>59288808
1 - it's not morning.
2 - why are you referring to me as if you know me? I don't associate with your kind.
>>
File: test (5).png (416KB, 612x892px) Image search: [Google]
test (5).png
416KB, 612x892px
>>59288804
If you're not stupid you can start with Halmos.
>>
>>59288804
Definitely algebra. Almost everybody had a decent grasp of arithmetic, but if you haven't been doing math for a while, your algebra is probably shoddy. If you ever want to be at maths, you're gonna need good algebra.
>>
>>59288850
it seems to be some sort of new reddit meme.
>>
>>59288852
But why aren't you able to keep reddit users away?


Why are you failing?
t. ribbit
>>
File: 1476920654887.png (65KB, 334x244px) Image search: [Google]
1476920654887.png
65KB, 334x244px
I have shitty windows 8.1,it's pretty bad for what I'm trying to do.
I want to change to either linux or ubuntu but I have some questions
>which one is better for a beginner level coder(I literally began learning this month and I haven't even started C,C#)
>can I play the games I play on windows,with or without an external program?
>which one is faster?
>>
>>59288885
why exactly would I be keeping your ilk away?
>>
>>59288924


Aww, that sounds so sad.


I thought you told ribbit users to go back to ribbit and leave your safe place alone. :P
>>
Big O is fucking with me at the moment.

>What I know
Big O defines upper bounds on an algorithm, given some input size. What this means is that it provides a guarantee that says 'given input size x, the algorithm's time complexity will never exceed this', where 'this' is expressed in some kind of mathematical expression like O(log n).

Apparently, this is not the same thing as best-case, average-case, worst-case. We can find the big O (and theta and omega) of best-case, average-case, worst-case. Are these cases directly related to input size? For instance, the worst case for some algorithm is some very large input. In that case, the big O is, let's say, O(n^2). However, the average case for the same algorithm has a big O of, let's say, O(n).

Is that correct? There's a lot of conflicting information out there. Sources that would probably be able to clear this shit up for me express themselves in language and notation that's too dense for a scrub like myself to fully grasp.
>>
>>59288864
What are the prerequisites for set theory? I know the very basics and I would like to learn more. I'm guessing his book on it is good?
>>59288870
Already on it.
>>
>>59288964
>Big O defines upper bounds on an algorithm,
Nah, bro, no. It's not about the upper bound, it's about a super simple, super rough approximation of how the complexity grows.

Read this: https://en.wikipedia.org/wiki/Big_O_notation
>>
>>59288471
>I'd learn with the haskell wikibook instead
Does it assume I know anything about FP?
>>
>>59288964
Big O is much more general than time complexity. It simply mentions an expression is bound, constant factors notwithstanding, by the expression between the parentheses. As such, you get different results for best, average and worst case of each algorithms. Usually when people talk about big O they talk about the worst case scenario. So you're correct.
>>
Ncurses based PDF reader
>>
>>59288821
it's pretty readable and properly formatted.
>>
>>59288801
POST is standard, it's just a string of parameters separated by & symbols being passed to stdin in whatever language you're using to write the backend software.
>>
>>59289001
Not really
>>
>>59288918
>>59284810
>>
>>59289029
>non-capital first letter
Discarded.
>>
>>59289029
it's not about readability. you are clearly from plebbit if you think that's the proper way to format posts here.
>>
What's the latest learning material for C++?
Like learning C++ the new way using C++17?
>>
>>59288918
>change to either linux or ubuntu
>either linux or ubuntu

hwat
>>
Can I write C++ on my resume and then get away with writing C with classes?
>>
>>59289096
Nigga no one has fully implemented C++17 yet
>>
>>59288918
Ubuntu is a Linux based distro. Ubuntu's kernel is called Linux. There are other Linux based distros such as Fedora, OpenSUSE, Arch, Gentoo, Mandriva, NixOS etc.

All perform the same, since they use the same Linux kernel under the hood.
>>
>>59289024
Godspeed you retarded bastard.
>>
>>59289131
GCC has you fucking retard.
>>
>>59289131
How about 14?

I don't want book from my grandpa, I heard about how C++ making mistakes in the past and trying to fix them with new versions.
>>
>>59289155
They're fixing C++ mistakes by adding MORE MISTAKES.
There's a reason everyone but gamedevs have moved away from C++ for general purpose programming.
Either learn C or learn a more modern language.
>>
>>59289178
If you want to see something really bad, look at std::optional and std::variant.

How did they manage to fuck that up?
>>
>>59288918
>I want to change to either linux or ubuntu
Typical dogmatic /g/ poster who has no fucking clue why they even want to use Linux.

Stay on Windows, and you should probably stick to Python.
>>
>>59289063
why in the world would i come to daily programming thread before? i only just now expressed my willingness to become a programmer of sorts.
>>
>>59289198
D doesn't have this problem
>>
>>59289219
it's pretty obvious that "here" means this board or this site.
>>
>>59289236
There are no complaints about D, probably because nobody uses it
>>
>>59288997
Best, worst, and expected cases describe the big O (or big theta) time for particular inputs or scenarios.

Big O, big omega, and big theta describe the upper, lower, and tight bounds for the runtime.
>>
>>59289252
Yes they do
>>
>>59289326
People complain about it despite not using it?
Sounds like Haskell
>>
>>59289363
Nope
I said people do use it
>>
>>59289249
you seem to have a tendency to overthink stuff

anyway hope someone answers, i installed 4chan x so i have ways of monitoring this thread until it's gone
>>
Who else /staticallyverified/, here?
>>
No, modern C++ is not even close to memory safe. This is my favorite meme to destroy over and over on HN. :)

Consider iterator invalidation, null pointer dereference (which is undefined behavior, not a segfault -- and you can't get away from pointers because of "this" and move semantics), dangling references, destruction of the unique owner of the "this" pointer, use after move, etc. etc.
>>
File: karen haskell.png (818KB, 1280x719px) Image search: [Google]
karen haskell.png
818KB, 1280x719px
>>59289503
muh type systems
>>
>>59289520
That book has 1k pages
>>
>>59289052
>>59289063
I see people talking about this all the time, why is a non-capital first letter reddit formatting? I understand the double spacing thing tho
>>
>>59289541
very thin paper
>>
>>59288788
if you're studying 8 hrs a day i would imagine you could get a job, the question is 1) if you know what to study and 2) if you will actually study (consistently and productively) for 8 hours a day
>>
>>59289572
>why is a non-capital first letter reddit formatting?
I never made this claim.
>I understand the double spacing thing tho
Which is what I'm talking about.
>>
>>59289508
Also, in order to move an object, its class needs to have a null object with a no-op destructor. Pathetic.
>>
>>59289572
The guy who is doing it in this thread is probably one faggot from /b/ or /v/ who clearly doesn't know fuckall about programming who decided to make /dpt/ his home because people respond to him. On the other hand, lower-case letters have always been indicative of "tk him 2 da bar" type posters from >>>/global/rules/3
>>
>>59288314
Man, from at it from the JVM world it seems like C# is ready to compete not just with Java 8 but with Kotlin and Scala. Is F# even worth it at this point?
>>
File: -n.png (9KB, 716x307px) Image search: [Google]
-n.png
9KB, 716x307px
>>59288217
god help us fucking all
(sorry, I can't draw curves on this touchpad)
>>
>>59289603
i quit my shitty call center job with enough savings to live off for 3 to 4 months so i have ample fine for that

i know what to study - java

i will - i have to support myself so i know the meaning of work

now the only thing missing is some worthwhile advice regarding resources and experiences with time needed to become somewhat proficient

take in account that i have average iq and all that.
>>
>>59289710
Shit formatting didn't read. And I'm not even the >>>/r/ibbat/ guy.
>>
>>59289647
Can we ban him yet?
>>
>>59289726
Should ban several other guys before him to be fair. The "type system with no IO" guy, the Melbourne Haskell compiler programer and the Rust turboshills come to mind.
>>
>>59289726
>>59289758
this! they do that all the time where i'm from (ribbit)
>>
>>59289758
all me
>>
>>59289771
Can you do a reddit AMA?
>>
>>59289758
That's all the same person. I'm currently working on a language which will help me hunt him down.
>>
Jesus Christ.
I made that image on /r9k/ over a year ago.
>>59288318
It was meant as a joke anon.
>>
>>59289758
>The "type system with no IO" guy
>the Melbourne Haskell compiler programer
Do you think if no-IO met compilerman he'd show him a type system with no IO?
>>
File: 16508094.jpg (14KB, 262x260px) Image search: [Google]
16508094.jpg
14KB, 262x260px
Is buying a book more wallet friendly than downloading free PDF and printing it?
>>
>>59289503
Don't give a fuck, I write Lisp all day everyday.
>>
=> 59289839
>>>/p/lebbit
>>
>>59289839
Just read it on the computer you dumb anime shit.
>>
>>59289791
i don't have a reddit
>>
>>59289839
If you're employed it could be at a significantly low or high price.
>>
>>59289857
I don't like reading on the computer, I tend to learn more comfortably with an actual book.
>>
>>59289857
>c*mmunism
Not anime.
>>
>>59289873
Then you clearly don't care about the book, you like the idea of reading more than learning what's written in it.
>>
My script reads the percentage every second. Now it should count the seconds until the percentage drops by 1. I don't know what to do.

percent = measurePercent()
oneLessPercent = percent - 1
time = 0

if(percent == oneLessPercent) then
time = time + 1

See that doesn't make any sense since percent will never be equal oneLessPercent. Does anybody know how you do this?
>>
>>59289791
yes, but I don't have a plebbit account.
>>
>>59289888
What are you on about? haha
>>
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice <= 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);

var compare = function(choice1, choice2) {
if (choice1 === choice2) {
return "The result is a tie!";
} else if (choice2 === "scissors") {
if (choice2 === "rock") {
return "paper wins";
} else {
return "scissors wins";
}
return "rock wins";
} else {
return ;
}
};
compare (userChoice , computerChoice);

kill me
now
>>
>>59289710
>i know what to study - java
There's more to it than just picking up a book on Java learning how to read and write code in Java. It's not like learning a foreign language. There's computing concepts that span across nearly all programming languages (data structures, algorithms, etc.) that you need to get a good grip on before you can expect to be good enough to get a job, or at least, a decent job.
>>
magic mirror-style catan board. Biggest obstacle so far is finding a monitor to use, keeping it actual size would need something like 1500x1388.
>>
How do I connect C# to postgresql? TIA.
>>
File: solve_2.jpg (208KB, 1280x720px) Image search: [Google]
solve_2.jpg
208KB, 1280x720px
>>59288994
Halmos is very introductory. If you understan logical reasoning then you can understand Halmos.
>>
>>59281250
>How is angular js ? Any experience ?
>>59286274
>it's one of the worst of the current generation of frontend tech.

How true is that ?
>>
>>59289901
old = measurePercent() //measure once
new = measurePercent() //keep updating this one
iterations = 0

if (abs(old - new) < 1) then
time = time + 1
>>
>>59290046
Use React instead. It's Angular but less bad.
>>
>>59290055
Typo, time should be iterations
>>
for (var i = 0 ; i < 120; i++) {
console.log(i);
}

:^)
>>
>>59289940
yeah yeah i just want to have a decent estimate on how long from beginning to average job in months
>>
>>59289901

while(//however long you want to do this)
int secs =0;
int percent = measurePercent();
while(measurePercent() > percent-1){
sleep(1);
secs++
}
printf("Seconds passed until 1percent drop: %d", secs);
}



something like this would work I think. I could probably write something more fleshed out if I knew how you were implementing this
>>
>>59290033
>How do I connect C# to postgresql?
1. Put
Install-Package Npgsql
in your project's NuGet console
2. Read package docs
3. ????
4. PROFIT
>>
File: 1444180068224.png (10KB, 327x173px) Image search: [Google]
1444180068224.png
10KB, 327x173px
>>59289503
   procedure Dedupe (Arr: in out Int_Array; Last : out Natural) with
Pre => Has_Duplicates(Arr),
Post => not Has_Duplicates( Arr(Arr'First .. Last) )
and then (for all Item of Arr'Old =>
(for some J in Arr'First .. Last =>
Item = Arr(J)))
-- Only duplicates removed
and then (for all J in Arr'First .. Last =>
(for some Item of Arr'Old =>
Item = Arr(J)));
-- Nothing new added
>>
File: 1469216589954.png (328KB, 1306x5702px) Image search: [Google]
1469216589954.png
328KB, 1306x5702px
/dpt/ I need your help

I am making a series of interconnected node.js servers. The servers will share some code, so I decided to isolate this code in its own node.js module.

The file structure, to clear up any confusion:
./firstServer
./secondServer
./sharedModule

So, no problem. I successfully installed the shared module via the package.json file:
"dependencies": {
"sharedModule": "file:../sharedModule"
}


But now, whenever I make a change to the sharedModule, the only way to make that change appear in the servers is by deleting the sharedModule from the node_packages!

What is the best way to go about fixing this problem? Is there a better way to do this using npm and node.js? Do I write a script which reads the package.json file and automatically deleted every package read from a file prior to updating? Please help!
>>
>>59290088
Cool program, keep it up :)
>>
>>59290177
for (var i = 0 ; i < 120; i + 5) {
console.log(i);
}
>>
>>59289912
that's some terrible code holmes
>>
>>59290106
That really depends on how fast you learn and how good you want to be.
2 months might be a bit fast paced considering you'd be trying to learn like at least 4 college Java courses worth of knowledge in that timeframe. Like I know you might be able to cover all the topics but you'd probably retain the shit better if you take your time.
If I were you I would keep working at your help desk gig, maybe reduce your hours a bit, and learn at a bit of a slower pace when you're not on the job. That would also probably be more impressive on a resume. But that's just my opinion.
>>
>>59290141
>"read docs"
>link to docs on their website literally doesn't even work
Open sores software in a nutshell.
>>
>>59289912
const choices = ['rock', 'paper', 'scissor'];

let usersChoice = -1;

while(usersChoice < 0) {
let usersPrompt = prompt('pick rock, paper or scissor');
if (usersPrompt == null) {
break;
}

usersChoice = choices.indexOf(usersPrompt);
}

let computersChoice = Math.floor(Math.random()*choices.length);

let result = (() => {
if (usersChoice == (computersChoice + 1) % 3) {
return "Win";
}
else if (computersChoice == (usersChoice + 1) % 3) {
return "Lose";
}
else {
return "Draw";
}
})();

console.log('Computer picked %s. You picked %s. Result: %s', choices[computersChoice], choices[usersChoice], result);
>>
>>59290273
http://www.npgsql.org/doc/index.html

You use it like literally any other RDBMS library.

They all work in a way that NpgsqlConnection is directly substitutable with MysqlConnection or SqlConnection.
>>
>>59290262
>>59290262
>reduce your hours a bit

nigger i do not own the helpdesk
>>
>>59290055
>>59290137
Thanks for the help. I will try to translate it into my script. I'm basically working on a rainmeter skin which uses a lua script. The rainmeter skin measures the percentage of the laptop battery every second, the lua script reads it. I wanted to calculate when the battery will be empty. For that I would first need to measure the time when the battery loses one percent.

[Rainmeter]
;DON'T CHANGE
Update=1000

[MeasurePercent]
Measure=Plugin
PlugIn=PowerPlugin
PowerState=PERCENT

[LifetimeLoadingScript]
Measure=Script
ScriptFile=#@#Battery.lua


function Initialize()
measurePercent = SKIN:GetMeasure("MeasurePercent")
time = 0
end

function Update()

--reads the percentage
percentNow = measurePercent:GetValue()

--code goes here

return(time)


end
>>
I don't know any coding language except basic javascript
should I learn any of the C's or python?
>>
>>59289888
Not him but I get terrible eye strain looking at a computer screen. Not to mention I tend not to be able to comprehend as well when I read from a screen. Computer screens just melt my brain after looking at them for a while. I need paper.
>>
>>59290531
>any of the C's
what did he mean by this?
>>
why do people declare variables that are in global scope private?
>>
>>59290303
def rock_paper_scissors_lizard_spock(player1, player2):

if player1 == player2:
return 0
victoryList = ['spockrock', 'spockscissors',
'scissorspaper', 'scissorslizard',
'paperrock', 'paperspock',
'rockscissors', 'rocklizard',
'lizardspock', 'lizardpaper']
state = player1.lower() + player2.lower()
if state in victoryList:
return 1
else:
return 2

validMoves = ['spock', 'rock', 'scissors', 'paper,', 'lizard']

while True:
player1in = input('Enter move for player 1: ')
player1in = player1in.lower()
if player1in in validMoves:
break
else:
print('Please enter a valid move!')
while True:
player2in = input('Enter move for player 2: ')
player2in = player2in.lower()
if player2in in validMoves:
break
else:
print('Please enter a valid move!')

finalState = rock_paper_scissors_lizard_spock(player1in, player2in)

if finalState == 0:
print('The game was a tie!')
else:
print('Player ' + str(finalState) + ' wins!')
>>
>>59290545
Take down notes.
>>
>>59290531
>any of the C's
Why don't you start with learning a single thing about any of the modern languages before you say something incredibly stupid?

C and C++ are very distinct. C# is in a completely different universe.
>>
>>59290531
keep using javascript for a bit imo. no need to branch out till you know one language.
I'd say Cs over Python because C is more different from js than python and the diffrences will be good for learning
>>
>>59290531
Learn Lisp.
>>
>>59290565
Explain "global scope" in this case, I think you'll get your answer.
>>
>>59290562
>>59290638
okay I'm going to kill myself
apparently python is good for a starter language and I don't know ANYTHING about C,C++ and C#,so it's kind of out of question for me
>>59290652
what is that?
>>
>>59289839
>ask to publishers to print my book
>"Your book is too THICC"
Back to square one
>>
>>59290662
>what is that?
A programmable programming language.
>>
>>59290662
>apparently python is good for a starter language
no, it's literal garbage and should be avoided at all costs.
>I don't know ANYTHING about C,C++ so it's kind of out of question for me
what kind of retarded logic is this?
>>
>>59290691
Learn to write concisely you shit.
>>
>>59290691
>>59289839
Is it even legal for them to reprint books that you don't own the copyright to?
I know students in third world shitholes just pay $10 for a photocopied staple bound copy of the textbook, but in australia?
>>
>>59290662
>what is that?
A shit "programming language", if it can even be called one.
>>
>>59290309
Thanks m8, this driver seems to work. I was just memeing a bit because their "API Documentation" link is just <a>API Documentation</a> for some reason.
>>
>>59290743
That's not for commercial purpose tho. I'm just talking about one copy of a free book
>>
>>59290713
>>59290650
>>59290638
should I learn C,C# or C++ then?
>>
>>59290743
As long as they don't charge based on the IP and if they were provided with the material and for non-commercial use, I don't imagine it would matter.
>>
>>59290662
>what is that
Its what you have that gives others awaya regarding your homosexuality
>>
>>59290851
You haven't supplied enough information for anyone here to answer that question.

Why do you want to program?

What is your end-game? What do you want to be able to do?
>>
>>59290851
C = Cancer
>>
What are lambdas useful for?
I seem to understand the concept, but I can't clearly say why lambda are so cool.
>>
>>59290880
>Why do you want to program?
>What is your end-game? What do you want to be able to do?
I want to make simple programs and maybe make a game(I actually always wanted to be a game developer)I don't want much stuff really,just be able to make simple programs and code.
I also know HTML and CSS,if that is important>>59290881
uhhh...ok
>>
>>59290884
They enable higher order functions to be useful. Instead of just abstracting over data with parameters, now you can abstract over code.
>>
>>59290884
>What are functions useful for?
>>
>>59290851
Nope. You actually shouldn't learn anything. Just become a manager instead.
>>
>>59290756
>>59290713
>>59290662

Ignore the turbo autistic C/C++ haxxors who insist on making everything harder on themselves by using an outdated language. C had its uses but it's not for everyone.

Python is great for beginners, but understand that you will be approaching programming from more of a top down perspective than C.
>>
>>59290930
>Using C when ASM exists
>>
>>59290884
substitution
>>
>>59290912
Either C# or C++ would get you where you want to go.

C# is a much easier first language to get started with, and you can use Unity for game development fairly easily.

Later on, if you're wanting to be an actual gamedev you'd be learning C and C++ to squeeze every drop of performance out of video cards.
>>
>>59290930
>Python is great for beginners
Disregard anything this retard has to say. He has shown himself to be completely incompetent or he is just acting with malicious intent.
>>
>>59290884
Lambdas allow you to do succinct and powerful set comprehension, with relation to its elements and attributes of those elements.
>>
>>59290956
I'd suggest D. It has the best book for introduction to programming.
>>
>>59290949
>Not re-writing Doom on binary punch cards.

kys yourself
>>
File: staris.jpg (422KB, 1024x576px) Image search: [Google]
staris.jpg
422KB, 1024x576px
Just put http://iomha.eu up, beta right now, doesn't work on mobile. feelsgoodman
>>
>>59290992
>I'd suggest D
Don't suggest any extremely unknown and rarely used language to a newbie. That's just cruel. Less tools, less documentation, less community, less stack overflow answers.
>>
C# = C-sharp

;^)
>>
>>59290930
>Ignore the turbo autistic C/C++ haxxors
It's true that they're claiming a lot of ground here. But the gains from using something like python is minimal.

C and C++ are not the most pleasant to work in but they're good enough. They're all you have if you want some reasonable performance. I wish this would change but it doesn't seem to be happening any time soon.
>>
>>59291047
Wrong. "see hashtag"
>>
>>59290851
Ada is bordering on perfect
>>
>>59290972
Give me a solid, non meme response then? /g/ has such a huge boner for making things harder than they need to be. Have fun while you go back to reinvent the wheel in vim with C you stupid cunt, I'll be getting actual work done.
>>
>>59289198
What's bad about them? People seem to cherish both to no end.
>>
>>59290884
autism
>>
>>59291035
>less documentation
Beg to differ.
D is not really extremely unknown. And the #d channel in IRC makes stack overflow useless.
D's documentation is absolutely top class:
https://dlang.org/phobos/index.html
https://dlang.org/phobos/index.html

>Less tools
Dlang has Coedit, DLANG IDE, Visual-D, VS code-d, Vim dutyl etc.

>Less community
Just enough for most users.

D is a very good programming language. It is the easy, better and robust C++.
>>
File: davidicke.jpg (33KB, 615x408px) Image search: [Google]
davidicke.jpg
33KB, 615x408px
What language would he use?
>>
>>59291073
>meme
If you want a serious response try rewriting your post.
>making things harder than they need to be
Who are you quoting here?
>Have fun while you go back to reinvent the wheel in vim with C you stupid cunt
I don't use C(ancer).
>I'll be getting actual work done
Not an argument.
>>
File: output2.webm (479KB, 1262x931px) Image search: [Google]
output2.webm
479KB, 1262x931px
>>59291003
Bug report.
Chrome Version 56.0.2924.87 (64-bit), windows 7 64bit.
Not to be picky or anything.
>>
>>59291090
>>59291035
>>59290992
I'm that guy who asked and I think D is just a meme.
>>
>>59291117
Define "a meme"
>>
>>59291090
Yeah, too bad it's OOP garbage.
>>
>>59291117
D is a good language, but it certainly shouldn't be your first, particularly if you're interested in being employed.
>>
File: 7phuJaq6.jpg (42KB, 512x512px) Image search: [Google]
7phuJaq6.jpg
42KB, 512x512px
>>59291117
You're making uncle Andrei upset.
>>
>>59291087
No higher order functions for them, except that absolutely fucking garbage completely inexcusable "visit" for variant, obviously inspired by some fucking OOP retard
>>
Why haven't you learned ASM???
>>
>>59291133
I'd suggest Rust then, it's procedural-imperative, linear language.

Alas it is
1. NOT a beginners' language
2. lacking a beginner/intermediate programmer friendly book
>>
File: 1486578507035.png (538KB, 978x998px) Image search: [Google]
1486578507035.png
538KB, 978x998px
REMINDER THAT IN C++17 THE FOLLOWING THREE CODE SNIPPETS WILL BE PERFECTLY POSSIBLE:

if (init; condition) { }

auto [a, b] = getTwoReturnValues();

pair<double,boolean> myPair = pair(5.0, false);


WHERE WERE YOU WHEN C++ BTFOD EVERY SINGLE LAST OTHER LANGUAGE?
>>
>>59289178
>everyone but gamedevs have moved away from C++ for general purpose programming
Can't imagine being this deluded
>>
>>59291160
welcome to 2005
>>
>>59291160
>[a, b]
Disgusting
>>
>>59291160
Meanwhile:
> no concepts
> no modules
>>
>>59291160
>if (init; condition) { }

does this mean i can do
if(boolean yes = true; yes) {}


?
>>
>>59291160
Not entirely sure what you're bragging about here.

What part of this doesn't exist in other modern languages?
>>
File: XLR2BNC.jpg (78KB, 600x787px) Image search: [Google]
XLR2BNC.jpg
78KB, 600x787px
What's the best Python book for a beginner-intermediate? Don't say LPTHW, because I won't read it
>>
>>59291160
>auto [a, b] = getTwoReturnValues();
lawl both rust and golang has builtin multiple return functions
>>
>>59291160
Following snippet is valid(and works as intended) in Python:
a, b = b, a
>>
>>59291160
>auto [a, b] = getTwoReturnValues();
Always thought it was interesting that it took so long for languages to start doing multiple return. It's very useful, and really not hard to implement either.
>>
>>59291189
Yeah, but why.
>>
>>59291090
It doesn't support users who wish to do manual memory management well at all. Constraining yourself to that in C++ is relatively easy. In D it's a nightmare.

I don't have faith in the language after past decisions either, to try base it on GC is just ridiculous.

Waste of time. I understand you want to get away from other crappy languages but this is just a slight upgrade (for people who can stand the GC). It's not enough to motivate a move. I doubt they will ever get to that point since the influences are largely from functional programmers and C++ programmers who are trying to cope. There's no practical programmer perspectives.
>>
>>59291202
I wouldn't call it built in to Rust. It's just returning a tuple, and Rust has "destructuring let" in general.
>>
>>59291115
Thanks bro :)
>>
>>59291213
if(boolean test = you.suck(); test) {}
>>
>>59291160
C# can do the latter two with much more tasteful syntax.

I'm not entirely certain why you would want to do the first.

Put me in the screencap.
>>
>>59290930
>Ignore the turbo autistic C/C++ haxxors who insist on making everything harder on themselves by using an outdated language
Literally the only autists here are those who spend their spare time shitposting about C and C++ instead of doing something productive.
>>
>>59291214
>new user
>manual memory management
oh okay

There are clear instructions on how to avoid GC in D by the way
>>
>>59291231
Why would you not just do
if(you.suck()) {}
?
>>
>>59291251
Why D over e.g. C#, then?
>>
>>59291265
you can do that? i thought you could only put booleans in if tests
>>
>when you neatly abstract functionality from two functions into one
>now the code is easier to understabd and more obviously correct

>now i have to write extra test cases
Why is software dev so shit
>>
>>59291217
I would have to assume that by the time LLVM is done with it the actual assemblage produced is just like classical multireturn
>>
File: 1483905725228.jpg (64KB, 736x682px) Image search: [Google]
1483905725228.jpg
64KB, 736x682px
>>59291284
>Writing test cases
>>
>>59291285
By that logic everything is built in.
>>
>>59291284
Test it in your head. :^)
>>
>>59291273
Holy shit, you are fucking stupid.

If you can do this:
boolean test = you.suck();

then
you.suck()
ostensibly returns a boolean already, or something that can be implicitly coerced to a boolean.
>>
>>59291160
>furfag
>likes C++
no surprise
>>
>>59291160
if (init; condition) { }

Not sure what use this is really. It feels like i'm missing something because if it's the equivalent the for loop has then I don't get the point.
else if (init; condition) { }

would be cooler.
>>59291210
>Always thought it was interesting that it took so long for languages to start doing multiple return.
Except it didn't take long at all for a lot of languages. It's just languages like C++ that aim to not move anywhere that have been dragging their feet.
>>
>>59291284
>abstract
Stop using this word.
>>
>>59291210
It's especially jarring to anyone who have used stack based languages before. It has literally zero overhead, just put more values on stack.
>>
>>59291270
D is great for programming video games and mobile apps.

Literally all it's good for.
>>
>>59291202
>>59291285
"multiple return values"
"classical multireturn"

literally retarded
99% of the time this is just like a tuple, but way more fucking limited (as opposed to, for instance, the two values being returned at different times)
>>
>>59291306
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0305r0.html
>>
>>59291293
>>59291295
Its for a shitty Java class

>points taken off for not needlessly testing helper methods with little to no real functionality
I'll just write shitty code then, takes less effort :) thanks prof :)
>>
>>59291201
Please respond.
>>
>>59291306
But anon, you CAN do else
if(init; condition) {}
else if (init; condition) {}
>>
>>59291270
.NET is not completely multi platform. Which is why you are confining yourself to Microsoft.

F# and C#, as a language is very nice, (Nicer than D). However they require a full fledged Virtual Machine to run, the produced binaries is objectively slower than D. D's memory management model follows RAII primarily.

D works anwhere LLVM works. D's binary speed is on par with C++ in some cases. Not as fast as C and Rust but definitely has a good performance. If I were to write a video player I would prefer D to C#.
>>
>>59291335
back to your subreddit
>>
>>59291321
>who needs strings I'll just use
 immutable char (int) []
>>
>>59291306
>Not sure what use this is really.
For stuff like this:
if (auto x = find_thing(); x != nullptr) { ... }
if (auto pos = string.find(chr); pos != std::string::npos) { ...}
>>
>>59291339
Not the same anon, are there any advantages of D over Rust?
>>
>>59291307
I'm using it perfectly correctly.
>>59291349
???
>>
>>59291374
Not complex. Rust is NOT beginner friendly at all. Anyone who says otherwise is autistic.
>>
>>59291321
> (as opposed to, for instance, the two values being returned at different times)
haha what are you DOING
>>
>>59291381
No you're not. You should do as he said and go back.
>>
>>59291385
He probably means yield.
>>
>>59291396
you have to go back, pahjeet
>>
>>59291265
What do you mean? C/C++ wasn't able to do that up until now?

LMAO
>>
>>59291384
what do you consider to be a "beginner"? I started learning it about 2 months in.
>>
>>59291384
I wouldn't call Rust complex per se, but it's definitely not beginner friendly. Rust has many orthogonal, individually simple things going on, while e.g. C++ (which I would definitely call complex) is a spaghetti heap of features that may be incompatible with each other in subtle ways.
>>
>>59291402
Well now that's a whole other stick and ball game isn't it just. Bless the poor soul for trying though.
>>
>>59291416
kys
>>
>>59291296
i did not know you could do this but i just tried it and it works

thanks anon
>>
Multiple return is literally equivalent to tuples, thats basically the point.
Yield has to do with streams, which is basically returning a lazy evaluated list, which is not close to the same as multiple return or tuples.
What are yall smoking?
>>
>>59291433
kek
>>
>>59291356
... what?

>>59291385
>>59291402
Yield would be an example.
And even then, it's better to encode this as a single return.
>>
>>59291450
Yield is completely different retard.
>>
>C/C++
So many retards here. Notice how shittier this thread gets when Reddit, Dfags and Rustards show up.
>>
>>59291423
For starters, you have to explain what a macro is before teaching a hello world program.
>>
>>59291439
Be honest; how long have you been programming? That is literally day one shit.
>>
>>59291461
C(++)
>>
File: temer-foto-oficial.jpg (162KB, 603x905px) Image search: [Google]
temer-foto-oficial.jpg
162KB, 603x905px
I want to work on something but I don't know what to do.
>>
>>59291432
>>59291456

>that's completely different!
>oh but multiple return values are totally the same as tuples!

Yielding IS returning multiple values
>b-but it's not called multiple values by XYZ language!
So fucking what, it's still returning multiple values.
>>
>>59291424
Rust may be axiomatically """simple""" (horribly complex compared to lisp or lua, not as complex as C++ which doesnt mean anything), but in practice you need to get a shitload of the standard API under your belt to do useful things without wanting to kill yourself
>>
>>59288217
OOP php is useless?
if yes why?
>>
>>59291461
>Resident JavaScript """CODER""" telling C/C++ computer scientists that they are dumb for using a strictly superior language
>>
>>59291483
*autistic screeching*
>>
>>59291474
four years

i have a university degree
>>
>>59291251
>There are clear instructions on how to avoid GC
Yes well that's not the problem. MMM is one of those things that tend to be easy to start doing. We haven't had a lot of tools to help us out in the past so we're not asking for much. D makes it hard to do though, it puts up obstacles. That's really all it shouldn't do for me to be OK with it. It'd be nice to not be considered a second class citizen in a language but still.
>new user
I'm looking at the grander picture here of how decent a programming language is. I think a new user should go with something popular so he/she can feel like they have something to contribute. Or find projects to contribute to and feel like an enabled programmer with.
Popularity is very important when you're new, D certainly does have an exceptional userbase considering its lacking numbers but I'm not sure that's enough.
>>
>>59291480
Kill yourself.
Alternatively pick a cool (small) program you've seen and try to reproduce it in your language of choice. Like a downloader, a parser or some other thing.
>>
>>59291483
>>oh but multiple return values are totally the same as tuples!
*totally different

>>59291497
Fuck you, you fucking child.
You made a fucking claim, that tuples and MRVs are different, but that yield isn't MRV, defend it you piece of shit.
>>
>>59291483
Calm down lad it's alright to be wrong
>>
File: 2xz0km9.jpg (98KB, 750x600px) Image search: [Google]
2xz0km9.jpg
98KB, 750x600px
>>59288217
Thanks to the kind advice of a tripfriend in the last thread, I was able to fix my code and get my program working. Any other suggestions to improve it?

require 'io/console'

def patternGenerator()
blockArray = ["▓", "▒", "░", "█", "▞", "▚"]
blockArray.sample(6).join
end

def printCarpet()
heightIncrement = 0
carpetWidth = (IO.console.winsize[0] / 6)
carpetHeight = (IO.console.winsize[1] - 1)
until heightIncrement == carpetHeight do
carpetWidth.times do print(patternGenerator)
heightIncrement += 1
end
end
end

printCarpet()
>>
>>59291491
>C/C++
I'm complaining about the retards like you who lump C and C++ together. But you are obviously too dumb to notice.
>>
>>59291510
Find me a single example, outside this thread, of multiple return referring to yielding.
>>
>>59291519
Don't, move on.
>>
programming is easy lulz. I read SICP once and have installed gentoo so I know more than professional software engineers and computers scientists. I could easily get a job making good money but I choose to be unemployed, living at home and jerking off on anime figurines all night
>>
>>59291520
C(++)
>>
>>59291463
that's not really relevant at that level and only a retard would do that.
>>
>>59291497
>>59291512
samefag

>>59291522
>referring to
>>59291483
>>b-but it's not called multiple values by XYZ language!

If you can call returning a tuple (or pretending it isn't a tuple, for some stupid reason) "multiple return values", then why can't you call yielding MRV?
Does yielding not give you back multiple values?
What about systems that yield AND return a regular value?
>>
>>59291501
What the actual fuck?

What university? I'm morbidly curious now. This shows a fundamental understanding on how strongly typed languages treat methods and their return types.
>>
>>59291541
People won't ask what what ! is?
also
>'str
>>
>>59291557
First of all, yielding is not returning.
>>
>>59291519
Oops, small error I just spotted. The end statement for heightIncrement should be inline and the iterator statement outside of it.
>>
>>59291510
Yield returns an indeterminate number of results, possibly infinite. Possibly none. Never at the same time.
Tuple/MRV returns a specified number of values at the same time.
In a typed language, streams will be homogenous, due to their dynamic nature, while tuples have a fixed heterogenous type.
In an untyped language, the two could be used as substitutes for eachother, but destructuring a stream doesnt make as much sense as a tuple. And you could dynamically destructure a tuple immediately based on its size, without having to "wait" for elements like in a stream
>>
>>59291564
>'str
You haven't even used Rust, fuck off.
>>
>>59291439
holy shit fucking kill yourself. most of us /g/ coders were golden from day one and never made a single mistake or wrote a single shitty line of code.
>>
>>59291461
The thread was garbage well before that
>>
>>59291568
Says you

>>59291574
>Yield returns an indeterminate number of results, possibly infinite. Possibly none. Never at the same time.
That sounds like multiple to me.
I never said yielding and tuples are the same, I said that yielding is a form of returning multiple values.
But people say "RMV" and mean returning a tuple.
>>
>>59291587
It's usually fine during the afternoon (so 8-12 hours earlier). At this time it's just good for fun.
>>
>>59291580
let magician2: &'static str = "Gandalf";
>>
>>59290429
Ok, I did it. Thanks again for the help. That gives me the time in seconds until the percentage drops. Now I can calculate when the battery is empty next.

function Initialize()
measurePercent = SKIN:GetMeasure("MeasurePercent")
time = 0
percentOld = nil
end

function Update()



if(percentOld == nil) then
percentOld = measurePercent:GetValue()
end

percentNew = measurePercent:GetValue()

if(percentOld == percentNew) then
time = time + 1
end

if(percentOld > percentNew) then
time = 0
percentOld = percentNew
end

return(time)

end
>>
>>59291585
Nice false flag, retard.

You should be able to figure out that
bool this_returns_true() {return true;}

can be used directly in an if statement
if(this_returns_true()) {}
on day one.

If you can't, programming isn't for you.
>>
>>59291160
Welcome to the 1980s.
>>
>>59291626
You're pretty retarded. You do realize that you don't need to write type signatures for a hello world program?
>>
>>59291600
So thats your argument? That yield returns multiple things?
Of course it does, why is this a fucking argument.
Tuples and streams have their place, in fact they play well with eachother.1
Fuck this place
>>
>>59291668
>Fuck this place
I agree. Now back to your "subreddit" as you call it.
>>
>>59291334
>>59291306
Yeah ok.
>>59291363
I guess I see slightly more use for declarations in the if statement but I doubt I'd ever seriously start using it.
>>59291160
auto [a, b] =

You can do:
[a, b] = twoReturnValues();

Where a and b were already declared right?

Never know with C++, its been a language with so many stupid limitations in the past.
>>
>>59291668
>So thats your argument? That yield returns multiple things?
>Of course it does, why is this a fucking argument.
Why are people disagreeing with me then?

Languages that say they have "multiple return values" and mean tuples should immediately change to having actual tuples and "single return values"
>>
Also: the reason shitlangs like Go have MRV without tuples is because of "performance" at the cost of flexibility. Gotta love these C folks
>>
>>59291562
university of hasselt, belgium
>>
>>59291686
>I guess I see slightly more use for declarations in the if statement
>>59291363
Dipshits.

if (find_thing() != nullptr) { ... }
if (string.find(chr) != std::string::npos) { ...}


wow such good feature, we really need it
>>
>>59291739
>Can't do anything with the found thing
>>
>>59291686
https://godbolt.org/g/WKnEQ9

Nope, heh.
>>
>>59291113

You're the one making a claim contrary to the common/popular consensus that Python is a good language for beginners, so it's up to you to back it up. If someone is just starting out, Python is good because it abstracts away a lot of the most tedious/confusing stuff, and allows beginners to start actually making stuff that they might find useful without spending a whole bunch of time learning low-level stuff.

Be honest, is the low-level stuff actually that helpful to know if you just want to write a few scripts and learn some basics? No, it fucking isn't. It's helpful for professionals who work at a high-level and work on cutting edge stuff, but for a beginner it's completely pointless to learn, and is just a hurdle between them starting out, and actually being able to do something.

Oh wait, your just shitposting and trying to make things harder for beginners, because of 'MUH SECRET CLUB'. Because I refuse to believe that someone would be so unhelpful/pretensions while simultaneously claiming to know the ultimate way for beginners to start out.
>>
It's confirmed. The pedophile (>﹏<) mac faggot works for the CIA

https://wikileaks.org/ciav7p1/cms/page_9535650.html
>>
what books do cool kids read about C++ these days? Sutter, Alexandrescu? been a while for me
>>
>>59291626
let magician2 = "Gandalf";
>>
>>59291739
>Dipshits
With the multiple-expression if, the result of find_thing() is bound in the body of the conditional, so it is useful.
However, I think its very superfluous syntax sugar and that the commitee has much more important things to be considering for the language. And C++ doesnt need to be bloated up any more. They shouldn't add it.
Destructuring bind is nice. It's only been around in Common Lisp for lets see... 30 years? It could be interesting if it is overloadable
>>
>>59291784
>common/popular consensus that Python is a good language for beginners
Maybe on plebbit, certainly not here. Anyway, this isn't even slightly relevant.
>abstracts away
Stopped reading right there. Learn to use your words correctly before you decide to make a similar shitpost.
>>
>>59291795
The last good one was written by Meyers.
>>
>>59291795
C++ is garbage. Don't use it.
>>
>>59291795

Sutter's blog is great for little nuggets. I love reading his posts.
>>
>>59291697
Tuples are structs, holy shit.
>>
>>59291816
hello reddo
>>
>>59291824
(((structs)))
>>
New thread:

>>59291825
>>59291825
>>59291825
>>
>>59291160
With all these new features, will C++17 BTFO Haskell's compile times?
>>
>>59290169
Use npm link
Thread posts: 318
Thread images: 26


[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.