[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: 306
Thread images: 24

File: is your son a computer hacker.png (334KB, 791x3224px) Image search: [Google]
is your son a computer hacker.png
334KB, 791x3224px
What are you working on, anon?

Infuriating OP image edition
>>
File: file.png (45KB, 371x479px) Image search: [Google]
file.png
45KB, 371x479px
My bible came in the mail today.
>Pic related
>>
File: jbmsc.png (46KB, 582x327px) Image search: [Google]
jbmsc.png
46KB, 582x327px
>he compiles any code with MSVC
>>
>>56413761
This statement catches an exception
>>
>>56413817
>JBlow's hot opinions episode 300

Oh wow, it's nothing. And to think, I was looking forward to blowlang.
>>
File: relibraries.png (31KB, 569x206px) Image search: [Google]
relibraries.png
31KB, 569x206px
>>56413830
you probably use libraries too. fucking retard
>>
>>56413837

REEEEEEEEEEEEEE!
>>
File: we wuz mongols.jpg (313KB, 1280x960px) Image search: [Google]
we wuz mongols.jpg
313KB, 1280x960px
>>56413789
>infuriating
>>
>>56413830
You can blowlang me anytime bb
>>
File: csharpcucks.jpg (129KB, 1024x997px) Image search: [Google]
csharpcucks.jpg
129KB, 1024x997px
>>56413869
enjoy your meme language, kid
>>
>>56413924
SHART
>>
>>56413924

This is an issue of user error and not necessarily a language problem.
>>
File: 42195194891230.png (80KB, 598x575px) Image search: [Google]
42195194891230.png
80KB, 598x575px
>>56413949
Any language that requires functions be coupled to a "class" is a meme, face it.
>>
How do i learn EVERYTHING that matters about a certain language?
>>
>>56413789
The old thread is not over the bump limit you fucking asshat niggerian.
>>
>>56413992
what's this _meme_?
>>
>>56413992

There's no requirement for that. C# has structs which can just be composite data types.

The only thing it really doesn't have is free functions, which I don't like.
>>
>>56413924
Yeah, C# and Java cucks should just end themselves.
>>
>>56414027

Some people use ALL CAPS on certain words to convey a certain tone, and others use underscores. Mostly because they are autistic.
>>
>>56414033
There is literally no reason to not just allow free floating functions. Otherwise you wind up contorting your architecture in ways that don't really make sense when you have a function that needs to be shared between several different classes, but doesn't require any state of its own.
>>
>>56414058
>There is literally no reason to not just allow free floating functions.

I agree, but it seems that (((Hejlsberg))) does not.
>>
what is up w/ the javascript world and dependencies

https://raw.githubusercontent.com/bertho-zero/react-redux-universal-hot-example/master/package.json
>>
>>56414058
>what are static methods
>>
>>56414132
It's because javascript is a hot mess that cannot be undone.
>>
>>56414279
>MyCustomMathClass.doTheMathThing(); vs doTheMathThing();

This is what namespaces exist for, not classes.
>>
>some languages add hack features to classes instead of properly supporting modules
kek
>>
>>56414367
>what is static import
and how the flying fuck is MyCustomMathClass::doTheMathThing() better than MyCustomMathClass.doTheMathThing() you insufferable autist
>>
>>56414436
I can do using with namespaces, you retard
>>
>>56414492
>what is static import
kys retard
>>
>>56414498
Still a bad design decision. Why not just let me write code instead of wrapping everything in a class?
>>
>>56414546
fuck off and die you horrible idiot
>>
>>56414546
Are you _autistic_?
>>
>a class is a blueprint for an object
>so it's a constructor?
>well no it's also used to look up methods for dynamic dispatch
>so it's also a vtable?
>actually there's reflection too
>classes are constructors, vtables, AND objects, gotcha
>you forgot about static methods
>...and modules
>yeah
>>
>>56414559
>>56414564
>all these boilerplate apologists in my /dpt/

How's New Delhi this time of year, Pajeet?
>>
>>56414579
So you are you _autistic_.

Gotcha.
>>
>>56414579
The monsoons are probably making their bowels crankier than usual.
>>
>>56414579
you're fucking delusional i bet you're the retard who whined that GLSL wasn't compatible with C lmfao
>>
>>56413789
>Our son has a future in programming
>Fuck! let's bring that to a screeching halt
Fucking soccer moms man. I hope that kid at least fucked his sister out of spite.
>>
Python is just a lisp with no macros and a simpler syntax and set of tools. Prove me wrong
>>
>>56414599
Is that article even real? it reads like lol so 00's fanny article
>>
>>56414599
>>56414635
i think it's satire/bait, that poll is ridic
>>
>>56414649
>ridic
>>
>>56414625
They're both memeguages.
>>
>>56414662
>'tism
>>
>>56414667
Only scientists use Python (and that's because they're all too lazy to learn a real language like Java). LISP has literally no users, it's a total meme language. No one gets paid to write LISP, but there are TONS of Java jobs and TONS of Javascript jobs.
>>
>>56414492
>>56414546
>>56414579
>replying to the carposter

>>56414598
>i bet you're the retard who whined that GLSL wasn't compatible with C lmfao
1: That was me
2: This is not what I argued about, what is that supposed to mean anyway? Pajeet
>>
File: Ferrari-F12tdf-2.jpg (312KB, 1600x1066px) Image search: [Google]
Ferrari-F12tdf-2.jpg
312KB, 1600x1066px
>>56414730
well thanks for sharing your hot opinions here's your (You)
>>
>>56414625
It has no proper lambdas and bad scoping.
There, proved you wrong.

>>56414729
">muh payment" is not an argument. Moreover if you want to work on a company as a pajeet with a language you do not know, you just learn the language in a week. Learning new languages is trivial.
>>
>>56414760
literally kill yourself pajeet carposter
>>
How do i legitimately crash a C++ program without it giving any errors?
>>
File: blah.jpg (23KB, 295x451px) Image search: [Google]
blah.jpg
23KB, 295x451px
Is there a tidier way to do this in c#? Trying to assign a sun sign based on the players birthday
>>
>>56414760
I shared no opinions actually, Pajeet.
>>
>>56414787
wat
>>
>>56414773
shart in mart
>>
>>56414810
imma huge memer and want to pretend im killing myself
>>
>>56414797
Dictionary<int,string> StarSigns


assign the key/value to each then just

starsigns[birthDate.Month]
>>
>>56414798
if (You) say so sperglord
>>
>>56414787
*(int*)0;
>>
>>56414787
delete this;
>>
>>56414824
Yeah but star signs are retarded and start in the middle of a month, would that method still work?
>>
>>56414773
FOY
>>
I used a %d to print a float, hoping it truncates the mantissa, but it just prints 1, why?
>>
File: tfrgyuhio.jpg (94KB, 968x815px) Image search: [Google]
tfrgyuhio.jpg
94KB, 968x815px
>>56414797
I need to do what's written at the bottom in white.

I try to do it, and I don't have the options.
What should I do?
>>
>>56414846
i saw this just a while ago.
cant remember where.
>>
>>56414797
>>56414824
>>56414848

Oh never mind just actually looked at your code properly.

Not really no, because you've gotta deal with the offset nuance.

I mean you could do the dictionary thing and use `DayOfYear` and then just quickly work out what days of the year it flips over to the next star sign and use that instead.

It'd take you a bit of time to work out all the days exactly, but it'd be a lot more compact.
>>
>>56414865
maybe in /dpt/ i posted it at least once before. not sure where i got it from or if i thought of it myself (derived from the "DELETE THIS" meme but it also kind of means kill yourself)
>>
>>56414866
Allright, thanks for the help
>>
>>56414918
private string GetSunSign(DateTime birthdate)
{
int i = birthdate.DayOfYear;
if (i <= 28)
return "Capricorn";
else if (i <= 50)
return "Aquarius";
else if (i <= 87)
return "Pisces";
return "";
}


Here's the first 3 as an example.

http://disc.sci.gsfc.nasa.gov/julian_calendar.html

that's what I used to make my life a bit easier.
>>
>>56414946
That looks a lot nicer, but how come you use the 28th day of January for the cut off point for Capricorn? It ends at January 20
>>
>>56414635
I don't know, was Lunix really invented by the Soviet computer hacker Linyos Torvoltos?
>>
>>56414436
>>what is static import

To be avoided.
>>
>>56415034
I don't know the first thing about that astrology horseshit, and your image was lowres as hell, It looked like an 8 to me.
>>
>>56415050
using static System.Console;


I don't think I could function without this anymore. Writing CLI stuff is painful without it now.
>>
>>56415048
maybe.
how do you know for certain that lunix doesn't exists or if that name is an alias?
>>
>>56414918

You might be able to do with it TimeSpans. The year doesn't matter, but you could match the given month/day.
>>
>>56415076

I'll vomit.
>>
when can I use sizeof without parentheses?
>>
why was i born?
>>
>>56413803
Get the other bible to go with it:
http://csapp.cs.cmu.edu/

tip: you can go on Abe Books and find the International Edition which is 10% the price of the full edition.

That will teach you C plus Computer Arch/Assembly in 64bit for amd64 (linux). Like when you come across structs in K&R and would like to know how exactly they are implemented in hardware.
>>
>>56415166
Thanks! Noted.
>>
>>56415166
oops, you want 3rd edition which is 64bit instead of prev editions which are 32bit.
>>
>>56415122
you shouldn't unless you're an asshole
>>
who here only /C89/
>>
>>56415245
no

>>56415122
When you have structs or variables

>>56415193
Faglord
>>
>>56415050
global-namespace functions are also to be avoided
>>
>>56415245
how's that unemployment handling you?
>>
>>56415122
when you have an expression as opposed to a type
>>
What Java version do I need If I want to develop for android?
>>
>>56414760
>>56414797
>>56414787
>>56415304
pajeet
>>
>>56415304
JDK 7 i think but if you get major.minor version problems in your IDEs just try different versions until it werks
>>
>>56414760
That looks like a Hot Wheels car.

Let me guess, you're pretty into "cool bikes" and "hot bitches" too.
>>
>>56415447
>"hot bitches"
lol fag
>>
You guys are long fags
>>
File: 1472917906309.webm (247KB, 853x480px) Image search: [Google]
1472917906309.webm
247KB, 853x480px
Gonna try starting this udacity course all over again because I can't understand shit. Why does android development feel like some behemoth
>>
i miss that akarin guy
he's the only anime poster I like
>>
>>56415533
because you interface with more or less the entire OS and the hardware features of the device
>>
why is it called a manifest constant and not just a constant
>>
>>56415562
Where is he now?
How is his C board doing?
>>
internship i applied to just emailed me back after i took their hackerrank test but i don't want to look because i only finished 3 of the 5 questions
>>
>>56415594
idk
last time I checked, it had avanced pretty well
it now has 4chan like looks
>>
File: wew.png (10KB, 546x241px) Image search: [Google]
wew.png
10KB, 546x241px
Why is there still no simple way to initialize a list of tuples that ships with the language? It's literally 2016.
>>
>>56415686
How would you simplify that?
>>
>>56415707

Well, for starters, I wouldn't need to be using a dictionary incorrectly.
>>
>>56415707
It's already simplified.
>>
>>56415720
I meant syntactically. It's pretty obviously a shit solution, although it's probably an example of something rather than a solution to a problem (I hope)

>>56415729
Oh, is that not valid code? I don't know C#.
>>
>>56415686
SHART
>>
>>56415735
>It's pretty obviously a shit solution

You're excused.
>>
>>56415752
Why are you doing beginner-tier exercises anyway?
>>
>>56415779

Just fucking around because I haven't actually got anything better to do right now.
>>
>>56415785
you don't need a dictionary just a small array of day numbers, then you find the relevant array index by comparing the input day number with the numbers in the array, then you look up the star sign string in another array
>>
>>56415830

I mean, sure, you could also do that.
>>
>>56415785
hone your typing skills

http://www.keybr.com/
>>
>>56415902

My WPM is already pretty good. I'd rather work on my personal projects, but I can't be bothered at the moment.
>>
>>56415931
>I have nothing to do
>here, do this
>No need to, and I'd rather do the thing I'm not doing
>>
>>56415947

Yes, that's correct. It's called procrastination, or, being lazy.
>>
>>56415955
Nah I understand, half just jerking you off; I'm in a similar state
>>
how do you code like hackers in the movies?

do you prepare the code then manually copy it over as fast as you can?
>>
>>56415981
Sometimes if you already know what a module is going to do and you've done something similar before or have already planned it out in your head, you can write up the first draft typing quickly etc.
>>
>>56415981
live and breathe code. dream in code
>>
>>56415981
If you "write code" by slamming all your fingers into your keyboard at high speed, maybe you should find a language that doesn't require so much boilerplate. I spend at least 5 minutes thinking about every line of Haskell I write.
>>
>>56415981
see the script command
>>
>>56415981
Smash my hands and face against the keyboard as hard as I can.
>>
>>56416055
$ script
Script started, file is typescript
$ vim typescript
$ vim typescript
$ vim typescript

lol
>>
File: wew laddy.png (10KB, 509x255px) Image search: [Google]
wew laddy.png
10KB, 509x255px
Look, ma! It's all better now. No more LINQ hacks and no more incorrectly used dicts.
>>
How would you combine these two functions and what would you call the function?

func decrypt(data []byte, key []byte, cipher cipher.Block) []byte {
blk := cipher.BlockSize()
padding := blk - (len(data) % blk)
var buf = make([]byte, len(data)+padding, len(data)+padding)

for i := 0; i < len(data); i = i + blk {
cipher.Decrypt(buf[i:i+blk], data[i:i+blk])
}

return buf
}

func encrypt(data []byte, key []byte, cipher cipher.Block) []byte {
blk := cipher.BlockSize()
padding := blk - (len(data) % blk)
var buf = make([]byte, len(data)+padding, len(data)+padding)

for i := 0; i < len(data); i = i + blk {
cipher.Encrypt(buf[i:i+blk], data[i:i+blk])
}

return buf
}

>>
File: ultra fedora.jpg (45KB, 476x476px) Image search: [Google]
ultra fedora.jpg
45KB, 476x476px
>I spend at least 5 minutes thinking about every line of Haskell I write.
>>
pls don't reply to him
pls don't reply to him
pls don't reply to him
I beg you, haskell anon, don't reply to him.
>>
>>56416219
>t. code monkey
>>
react and redux are fucking fun
>>
File: file.png (222KB, 363x401px) Image search: [Google]
file.png
222KB, 363x401px
>>56416219
This looks like Logan
>>
>I code in hasklel

lmao
>>
In general, if you have a programming problem, you can solve it with monads.
>>
>>56416132
id call it a nop
>>
>>56416353
Not always. Sometimes you need applicatives, and sometimes you need arrows.
>>
The important thing is that none of us are PHP programmers.
>>
>>56416427
sometimes you need to kys
>>
>>56416445
I'll gladly kiss you, anon. C'mere for a smooch.
>>
If your language can implement
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
, then it may be a useful language.
>>
Scala has the potential to be a useful language: https://github.com/scalaz/scalaz/blob/series/7.3.x/core/src/main/scala/scalaz/Foldable.scala#L77
>>
Java, C#, F#, and Rust do not have the potential to be useful languages.
>>
Has anyone used OpenStreetMaps API or a something similar (that's still free) before? Want to grab a small map but with several markers/selected locations and download it as an image, preferably through C/C++ and cURL.
>>
>>56416500
If useful things are done with a language, is that language then useful?
>>
>tfw your program finally Just Werks (tm) after 1 hour of debugging
>>
>>56416500
haskell does not have the potential to be a useful language
>>
>>56416581
Useful things are often done in spite of a language being useless.
>>
>>56416617
You should apply this philosophy to your life then.
>>
>>56416617
I think that if something useful is done with something deemed "useless" that that thing is no longer useless. Perhaps the expression you're looking for is "inefficient in creating usefulness"
>>
Your life is useless
>>
>>56415562
>>56415594
I've been busy these last few days that I haven't even touched my computer.
>>
>>56413789
>Lunix
Surely that picture is a joke
>>
>>56416801
>hurr durr what is satire
Did you even bother to look at the poll on the right?
>>
>>56416810
seems like your standard 2016 poll
>>
>>56416781
why, work?
>>
    public Organism mateWith(Organism mate) {
return new Organism(this.identifier + generation,
(ArrayList<Genotype> p1, ArrayList<Genotype> p2) -> {
ArrayList<Genotype> ret = new ArrayList<Genotype>();
for (int i = 0; i < p1.size(); i++) {
ret.add(p1.get(i).getName(), new Genotype(p1.get(i).getRandomAllele() + p2.get(i).getRandomAllele()));
}
return ret;
}(genome, mate.getGenome()),
this.generation + 1
);
}

public Organism mateWith(Organism mate) {
ArrayList<Genotype> childGenome = new ArrayList<Genotype>();
String childIdentifier = this.identifier + (this.generation + 1);
int childGeneration = this.generation + 1;

for (int i = 0; i < genome.size(); i++) {
childGenome.add(this.genome.get(i).getName(),
this.genome.get(i).getRandomAllele() + mate.getGenotypeAt(i).getRandomAllele());
}

return new Organism(childidentifier, childGenome, childGeneration);
}


Which one?

t. Rajeesh Patel
>>
>>56416781
Post some Akarin please
>>
Why didn't you tell me programming in Linux was this comfy?
>>
>>56416932
We did.
>>
>>56416833
>>56416801
https://en.wikipedia.org/wiki/Adequacy.org
>>
Is Haxe a meme language? It looks like it was designed by a committee of web-addled retards, but people at work are shilling it and I'm starting to get scared
>>
Neater code or quicker runtime?
if (toggle) {
for (int i = 0; i < length; i++) {
//.... operate on some array for example
}
} else {
for (int i = 0; i < length; i++) {
//... operate on same array but do something else
}
}

or:
for (int i = 0; i < length; i++) {
if (toggle) { // toggle is independent of i
// .... first operation from above
} else {
// .... second ''
}
}
>>
File: 1280x720-scaled.webm (1MB, 1280x720px) Image search: [Google]
1280x720-scaled.webm
1MB, 1280x720px
xdotool to automate things is annoying but cool to see the final result
>>
>>56417094
Haxe?
Is it a new meme language I'm not aware of?
>>
>>56417132
What are you downloading?
>>
>>56417135
It looks generic as shit, and I don't mean type generics, I mean literally 0 point in it existing generic

>>56417132
I can't tell what you're actually doing there, but as long as you *actually* need to run it in a shell and have it open on your screen like that, it may be better to actually just make it a real script rather than an xdotool automation
>>
>>56417154
>>56417135
>>56417094
Haxe is the future of development. It's a high-level language with great cross-platform support and an excellent set of support contracts to ensure any start-ups get the support they need to transition to the Haxe ecosystem.

I highly suggest giving the language a shot.
>>
Best way to learn java for a complete newbie?
>>
>>56417142
http://kissmanga.com/Manga/Toukyou-Kushu

>>56417154
main reason I'm using xdotool is because I don't know how to handle text so I grep the html file for the lines containing the image urls then use a vim macro to delete all the unneeded stuff. I also don't know web stuff so I'm downloading the html sources by hand and then running the script to get the image urls and plugging them into wget
>>
>>56417178
0.00007$ deposited into your paypal
>>
>>56417196
I'm 99% sure you can make this into one script that can run in the background and not on your screen, then
>>
>>56417198
it is a little bland but just suggesting to try a language isn't that bad
>>
>>56417226
you're clearly a shill
>pretend to hate haxe and saying its being shilled at work
>wait some time
>reply to yourself posing as another guy
>>
>>56417178
???
>>
>>56413789
How do you guys exhibit self control?

I get addicted to video games, and sometimes I cannot get myself to program.
>>
>>56417266
I program only when I want to. To me, loss of self control sometimes ends up with me programming instead of doing else I'm supposed to be doing.
>>
>>56417266
>How do you guys exhibit self control?
we don't, that's why we're wasting our time shitposting in /dpt/
>>
>>56417271
I wish I was there, but I don't have a project that I am working on atm. I tend to take breaks as I learn more and more about programming.

It is just that video games are my default setting, but I always think about programming too.
>>
>>56417222
there's probably a way to do it for parsing the html files but I don't think there's a way to cycle through the webpages without xdotool since the url's have unique id's instead of an order.

here's a bigger version of the video:
my.mixtape.moe/kklfrp.mkv

>>56417234
you're an idiot, there's practically no one talking about haxe. shills don't exist in a vacuum. unless they're just starting up or something
>>
>>56417289
shilling for free is a thing
>>
File: ayylmao.png (129KB, 1366x768px) Image search: [Google]
ayylmao.png
129KB, 1366x768px
Comfy.
>>
post your red flags for development firm partners
>>
>>56417318
>their CEO isn't from the UK, Canada, or the UK
>their CEO is from one of the above places, but he's Chinese
>their CEO is from one of the above places, bnut he's Indian
>>
>>56417288
I go in between that and working on projects, too. Sometimes I get a dry spell and am desperate for project ideas; usually learning something in a different subject area inspires me to do a project related to it.

>>56417304
This is a joke, right? kek
>>
>>56417303
oh, so you mean he's just an inexperienced person blabbing about whatever he happens to be using at the time instead of someone who has used a variety of languages well and is coolly weighing the pros and cons to get to his solution. If that's true then I guess we were having more of a labeling problem than a fundamental problem.
>>
>>56417318
indians
jews
arabs
women
>>
>>56417335
What? I just graduated from CS.

jokes aside, due to me being retarded, it said that it's searching for 'o' when it is really searching for 'a'.
>>
>>56417329
>>56417342
Go back to /pol/.
>>
>>56417357
thanks for correcting the record
>>
post hackings to
https://www.youtube.com/watch?v=GrGX4KZ44WI
>>
>mfw writing C while listening to some obscure weeb trance mix
>>
>>56417378
post it
>>
>>56414027
its _just_ *another* /way/ +to+ !emphasize! STUFF
>>
>>56417369
what?
>>
>>56417369
https://www.youtube.com/watch?v=b1MgT-hoFm4
>>
>>56414027
Some platforms use it for bold or maybe italics. I forget which is was, but it was one of them.
>>
>>56417380
https://www.youtube.com/watch?v=M0n98N71kUU
>>
>>56417407
_post hackings to_
>>
--__(((OPEN SOURCE SOFTWARE)))__--
>>
>>56415686
C++ wins again
unordered_map<DateSpan, string> starSigns ({
{{1, 20, 2, 18}, "Aquarius"},
// shit goes here
{{11, 23, 12, 21}, "Sagittarius"}
};
>>
FROB
R
O
B
>>
>>56417447
More like "the C++ standard library wins again". If you're using std::unordered_map then you're going against the spirit of the problem.
>>
>>56415686
People like you are the reason people talk shit about C#'s performance.
>>
>>56417456
Do you actually consider that unequivalent to C#'s Dictionary?

Are you literally retarded?
>>
>>56417456
The point was to demonstrate initializer lists nigger, not the map class.
>>
>>56417117
std::for_each(std::begin(a), std::end(a),
toggle ? [](decltype(a[0])& x) { /*do thing */ }
: [](decltype(a[0])& x) { /* do other thing*/ }
);
>>
>>56417447
also forgot a parenthesis at the end
should be });
>>
>>56417486
So the second one, then.
>>
>>56417486
>& x
>not &x
kys
>>
>>56417424
oh
https://www.youtube.com/watch?v=1hJKhiew2O0
https://www.youtube.com/watch?v=8uZ0y_lFg5s
https://www.youtube.com/watch?v=GmX4hB1qB8E&list=PLEAAC182966AE4A81&index=14
>>
>>56417355
You have a CS degree and you can only make little toy programs?
>>
>>56417503
>>>>>>>>>>>>>>>>>jokes aside,
>>
>>56417503
Don't pick on him. Pajeets are people too.
>>
>>56414546
Wrapping everything in a class guarantees:
The order of declaration of functions doesn't matter.
You won't make global variables.
This also simplifies the parser.
>>
>>56417498
No, the first one. It evaluates each argument before calling for_each, and in doing so selects one lambda over another once, and for_each just calls that lambda over and over, as opposed to checking toggle at each iteration.
>>
>>56417503
CS degrees are a meme
>>
>>56417515
Neat.
>>
>>56417502
thoroughly pleased
>>
>>56417514
>The order of declaration of functions doesn't matter.
You don't need to wrap everything in a class to get that.

>You won't make global variables.
No, you'll just have to imitate that functionality with static variables and singletons.

>This also simplifies the parser.
A little, perhaps, but it also enlarges the code being parsed unnecessarily.
>>
c++ is deprecated
>>
>>56417549
is c deprecated?
>>
Still not at the bump limit, faggots

>>56408204
>>
>>56417556
no, different use case
>>
>>56417558
Whoops, hadn't updated
>>
>>56417558
that thread is _DEPRECATED_
>>
>>56417577
It's still alive
>>
>>56417585
But it is "at the bump limit", past it in fact.
>>
>>56417503
This is not at all uncommon. I got a job where some of the "senior" developers can't even setup Eclipse, don't know how to checkout from Subversion, and are generally helpless with everything. It's a bit infuriating that they make more money than me. I stay because it's given me job security. I show up an hour late, leave an hour early, take long lunch breaks and smoke breaks. All I have to do is not be retarded for a few hours and everyone thinks I'm a miracle worker.

However, I also have a reputation for being "dangerous" to work with because I've outclassed so many people. The first guy I worked with was fired after I started doing his job better than him and more. The person I'm working with now is terrified because the same thing is happening. She's basically been on cruise control for the last 5 years doing 2-3 hours of worth of work in a given week, but because nobody really understands what she does, nobody could judge how productive she is. I'm actually amazed by how little she knows about the project she has supposedly been working with all this time. She asks me super basic questions all the time and is generally incapable of all but the simplest changes. Management even told me that if budgets need to be cut again, she's the first on the list to go.

This isn't because I'm some super genius, awesome programmer guru. No. It's just that so many people in our industry are head-up-their-ass retarded that even someone who just finished CS101 could do a better job.
>>
>>56417585
But it's at bump limit.

This situation is what's currently happening with _HASKLEL_. ie. it's _DEPRECATED_
>>
>>56417595
be careful!
they might try to get you fired. be atent!
>>
>his language doesn't have a one character extension
>>
>>56417595
> I show up an hour late, leave an hour early, take long lunch breaks and smoke breaks
This is why they make more money than you
>>
If /dpt/ is so _not_ /pol/ then why do you guys make fun of pajeet so much?
>>
>>56417757
He's a terrible programmer
>>
pls no politics, i wanna talk programming like we should be doing

so uhh...c++....how about it
>>
>>56413837
>Implying I don't always "roll my own"
I bet you even use an option parsing library.

My own stuff is, eventually, universally faster than the library equivalent beyond cases where it's near mechanically impossible of would require a large time investment writing asm routines.

Bugs are rare, and I don't have to worry about them simply being undiscovered because I'm the only one using anything I write.
>>
>>56417768
c++ is too white for some people here.
>>
>>56417768
God awful syntax, the only reason to use C++ is performance

>>56417765
It doesn't fucking matter whether it's true or not, it's off topic and always derails the fucking thread, you utterly retarded mental defective.
You know this every time, but you still do it for the fucking attention you fucking worthless child.
>>
>>56417783

>god awful syntax

hows it feel to use C# and Java which holds your hand and does everything for you?
>>
>>56417799
>hows it feel to use C# and Java which holds your hand and does everything for you?
I don't use either, neither have great syntax (C# _MUCH_ better than C++)
>>
>>56417774
And the best part is, if you roll your own, you always have the source code and can fix any issues or annoyances.

Good luck fixing something in the C++ standard library.
>>
>>56417693
No. They make more money because they've been with the company longer. Pay is based entirely on years of service. I've been there for two years. My frequent breaks are tolerated though because I get way more done than anyone else.

In fact, my role in the company has changed as a result. I was originally hired to work on a specific application. Now, I basically jump from project to project to be the guy who puts out fires caused by Chads and Patels. It's nice though because I get some say in what I work on. For example, there is one team that is trying to rewrite a large application and the lead engineer didn't like me pointing out all the mistakes. So every change I made got reverted and I was basically given a stack of Jira tickets and had to submit my work to be reviewed. That's how a lot of teams work, yes, but if the reason for me being brought on is to try to save a project form failure and I basically just become another code monkey to take marching orders, then I don't want to do it. My manager found out what this team was using my time for and told them to fuck right off because he has a whole list of other projects where the team members will actually accept my help to keep the project from crashing and burning.
>>
Decided to see for shits and giggles if I could make a cross compiler for the x86-64-pe target. As in Microsoft's Portable Executable format, but for standalone applications. Surprisingly, building binutils with this produces a valid toolchain. Building gcc with this will say it's an unsupported format. Decided to then try out my new assembler on a simple Hello World program, that I would test in Wine. It uses Linux system calls, which I know from experiments with MinGW in the past results in wine not bitching at all. The test program was this:

.section .rodata
str:
.ascii "Hello World!\n"

.section .text
.global _start

_start:
MOV 1, %EAX
MOV 1, %EDI
MOV str, %RSI
MOV 13, %EDX
SYSCALL
MOV 60, %EAX
XOR %EDI, %EDI
SYSCALL
RET


The resulting program did not at all resemble an image in the Portable Executable format. Indeed, wine didn't know what the fuck it was, and the Linux "file" program seems to think it's just data. I can't really find out what the magic number means, although I have a hunch that this thing is just not applying the PE header or some shit. Pic related is what the outputted program looks like.
>>
QUICK POST YOUR QUINES
>>
>>56417819
I dislike that there can be functional differences between different STL implementations. It's not too common, but it can happen and is annoying for portability. Absolutely no reason for it to be that way.
>>
>>56417864
somebody post a quine in c
>>
>>56417864
(let ((let '`(let ((let ',let)) ,let))) `(let ((let ',let)) ,let))
>>
>>56417861

Forgot pic
>>
does a void function return anything?
It sounds stupid, but, is it possible that even though its not supposed to return something, it just returns something that can be assigned to a variable?
>>
Aaaaaaaannnnndd.... that was the the object format, not the executable format. I depred.
>>
>>56417949
inb4 my post gets shopped into a "cs grad" meme pic
>>
>>56417949

nope just does something without returning anything
>>
Faggot Haskellers in charge of implementing basic benchmarks correctly

http://bitemyapp.com//posts/2016-09-03-websocket-shootout-haskell.html

>My naive implementation blows away the competition
>WELL I GUESS THAT'S JUST BECAUSE HASKELL IS THE BEST SILVER BULLET EVER

This stupid cunt's broken implementation was dropping 98% of packets and he couldn't tell.
>>
>>56417949
void main returns 0
>>
>>56417949
It can in asm!
>>
>>56417965
haskellers are so fucking smug and delusional
>>
>>56414132
Because most JS developers can't program shit and play import lego with their trendy framework of the month as a poor excuse for programming.
>>
>>56417972
Main implicitly returns 0 if it's not specified.
>>
>>56417965
Those dropped packets just weren't pure, bro
>>
>>56417981
but im not, pham
I just like it because its concise and faster than most

but mostly because a project has 3x less the linesof a project in c or pythong or sepples
>>
>>56418018
use a code golf lang then if having fewer lines of code is better
>>
>>56418018
Lines of code is a poor metric.

When I look at most Haskell code I see terrible naming and tons of complexity squeezed on to one line.

That's where the low line counts come from, and it makes things fucking unreadable.

If you still like that, consider looking at APL.
>>
only newfags care about conciseness/terseness

it's better to have lower 'density' and higher 'redundancy' or 'boilerplate' so it's easier to read and maintain
>>
File: a2ap1g1.gif (4KB, 513x176px) Image search: [Google]
a2ap1g1.gif
4KB, 513x176px
>>56418035
APL is the greatest programming language out there. Too far ahead of its time, I fear
>>
What do you think about testing if an array matches a hardcoded series of values by just chaining tests together in an if statement?

The emitted code -seems- like it would be extremely fast. It's just a series of instructions to compare values in a register followed by a jump if not equal. It would all likely come in on one cache line, all the instructions would be in the cache, etc. This seems like an ideal case, but is there anything better?

eg
if (id[0] == 255 && id[1] == 216 && id[6] == 74 && id[7] == 70 && id[8] == 73 && id[9] == 70 && id[10] == 0)
>>
how many people here actually have programming (not web dev) jobs?
>>
>>56418035
It comes from composability and a strong type system
In any other language you couldn't do that much complexity in one line
>>
Any python here?
Is this better https://gist.github.com/scturtle/1035886
Or it's best to use pyftplib?
>>
>>56418068
haskell is fucking garbage seriously
>>
>>56418035
come on, you just say that because you don't know the language
It'd be unfair for me to say that c is complex because I don't understand
void something(int n) {
return (n % 2) ? printf("whatever%3d", ++n) : puts(n)
}


im sure
that anybody would understand what
qsort [] = []
qsort xs = qsort s ++ [x] ++ qsort b
where (s,b) = partition (<x) xs

meant if they knew enough about haskell
>>
>>56418049
Branches are always slow. Better to rework your code and stuff it through the 256-bit SSE registers.
>>
>>56418085
What are you so mad at?
>>
>>56418049
it's fine, maybe try XOR and benchmark it to see if it's faster
>>
>>56418089
You think it might be wasting cycles on branch mispredictions?

>and stuff it through the 256-bit SSE registers.
How do I do that?
>>
>>56417864
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))
[/coide]
>>
>>56418112
this guy: >>56418034
>>
>>56418130
it pisses me off because people think that haskell is unreadable, but don't criticize this
>>
>>56418128
Why don't you just do a memcmp? It's going to be more optimized than your hand-rolled if chain.
>>
>>56418122
I had thought about that. Apparently XOR operations typically take a maximum of one cycle. Only downside is it can abort early if the first value doesn't match.

Yeah, I'd have to test.
>>
>>56418068
>In any other language you couldn't do that much complexity in one line

That's a good thing!

In most languages you can still put a bunch of arithmetic operations onto one line without it getting too long, and when this happens it becomes much harder to tell what that line is doing.

In Haskell, almost every line can be like this. Point-free style is the enabler, and it's notorious for making things hard to read.

https://wiki.haskell.org/Pointfree#Problems_with_pointfree
>>
Ok /g/ i tried many languages out of curiosity. I'm not a professional but i'd like to make some programs. I'm mostly interested in desktop programs, and i'd like them to be cross-platform and to have a single code base, because i'm doing this in the little free time i have.
Since i'm a beginner i still make lots of errors, and a compiler is very helpful, as it finds out stupid erros before the program runs. So my choices are either java, c# or c++; with javafx, gtk# or qt. C# doesn't behave well on linux, c++ is quite hard to learn but qt is awesome, java is ok , my programs are mostly for personal use or for friends and i can just tell them to install the jre. So what should i learn? Java would be my first choice (because it also covers android apps), followed by c++, and then c#, because it doesn't work well outside of windows.
>>
>>56418144
Why would it be better optimized?

(There's 5 if chains evaluating the same array, by the way.)
>>
>>56418088
Don't strawman me, see >>56418154

Also, plenty of people think ternaries are a bad idea. I think they're a bit dumb, but they still exist.

https://agiletribe.wordpress.com/2011/11/01/21-avoid-ternary-conditional-operator/
>>
>>56418146
can't abort early*
>>
>>56418154
point free style isn't hard imo
just think of it like passing a value around many functions
you can also think of it like this
[/code]
import Data.Function

myfunction value
= value
& dothiswith
& dothat
& die

myfunc = dothis . dothat . die
[/code]
both are the same
value & function is function(value), remember
>>
>>56418173
https://stackoverflow.com/questions/21106801/why-is-memcmp-so-much-faster-than-a-for-loop-check

Good compilers will pump out an SSE4.2+ intrinsic when they see a memcmp which is going to be an order of magnitude faster than a bunch of if statements.

You're literally just comparing whether one array (a block of memory) has all the same values as another array (another block of memory) which is the ideal case for memcmp.
>>
hasklel should be banned
>>
New thread: >>56418215
>>
>>56418174
pls give me a sample code you find hard
and as I said, point free is easy
f1 . f2 . f3 means a function that takes an input, gives it to f3, computes, gives result to f2, computes, and gives result to f1, computes, and the value is what f1 computes

I mean, this is literally straight from mathematics notation of function composition
this is like sayin that math is hard
it doesn't have to do with haskell
>>
>>56418174
>Unnested ternaries are hard to read
Not really
>Java
Oh okay, he's just retarded.

Unless you're nesting them, ternaries are fine and people need to get a grip. They're perfectly easy to read in most every situation.
>>
please help my retarded brain understand the point of dereferencing pointers
>>
>>56418267
A pointer is an envelope with something inside, but you don't know what until you open it. Sometimes the envelope has a bomb in it and when you open it (dereference it) your program crashes.

You can't get at what's inside the envelope UNLESS you dereference though. If I give you an envelope and say "Hey, there's an integer in here!" and then ask you to add that integer to another integer, well, you can't do it without opening up the envelope and seeing what integer you have, right?
>>
Why do people in these threads hate oop?
>>
>>56418336
Op's a faggot
>>
>>56418324

i see. So you should never print out a pointer without dereferencing it first, right? i guess the "tricky" part for me is when and when not to dereference
>>
>>56418427
Dereference if you're going to use the data it points to, don't if you're going to use the address.
>>
>>56418457
Also, printing out a pointer won't cause any kind of runtime error, it just won't print what you want it to.
>>
>>56418457

got it thanks
>>
How do I know what paradigm is right for a specific problem? Is this just something learned with experience or is there a good book that covers this
>>
>>56418556
OOP is always right

FP is never right
>>
>>56418581
I'm starting to think that these threads themselves are just bait, you can't ever seem to get a response that isn't just "do things the way I do them and ignore alternative methods of thought"

Maybe it's just the human condition
>>
>>56418631
FP is seriously trash if you don't believe me just ask literally anyone who genuinely knows what they're doing and who doesn't just do some pseudointellectual circlejerking
>>
>>56418581
>>56418631
>>56418647

completely depends on the program. For a AAA video game or something, you'd be a fool not to use OOP
>>
>>56418140
That's a quine, it's perfectly reasonable for it to be unreadable. This below is a quine in C, does that mean all C is unreadable?
#include <stdio.h>
int main(){char*c="#include <stdio.h>%cint main(){char*c=%c%s%c;printf(c,10,34,c,34,10);return 0;}%c";printf(c,10,34,c,34,10);return 0;}
>>
>>56418684
a while ago a haskeller suggested to have a tail recursive 'game loop' and you were to pass immutable copies of the entire the game state as a parameter just to make it """"""""pure"""""""" lmfao
>>
Is -funroll-loops the most fun flag?
>>
File: ss+(2016-09-04+at+03.03.25).png (10KB, 453x272px) Image search: [Google]
ss+(2016-09-04+at+03.03.25).png
10KB, 453x272px
I'm using Windows Task Scheduler to make a Python script run every 30 mins from log on - the problem is that it doesn't actually work.

Does anything look off about the way this is done? How can I get it to actually run the program? When I double click the script manually, it works like a charm.
>>
>>56418472
depends on what it points to. if its a char*, you could get a segfault
Thread posts: 306
Thread images: 24


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