[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 30
File: an-older-worker-in-his-office.jpg (737 KB, 1348x1134) Image search: [Google]
an-older-worker-in-his-office.jpg
737 KB, 1348x1134
Compass and straightedge edition

http://euclidthegame.com/

Previous thread at >>52225087
>>
>>52232566
First for D
>>
>>52232566
Second for Java
>>
gotta GO fast
>>
>>52232410
I don't understand how this "proves" that the line is in the middle tbqh.
>>
>>52232608
see >>52232623
>>
File: chec.png (10 KB, 116x554) Image search: [Google]
chec.png
10 KB, 116x554
8rd for how do you deal with carpal/ulnar/palm pain and numbness and anguish and suffering?
>>
>>52232654
Decrease the masturbation frequency.
>>
>>52232689
I'm part of the "nofap2016" jewish conspiracy meme
you tried
>>
File: uy.png (30 KB, 719x774) Image search: [Google]
uy.png
30 KB, 719x774
Wahey.
>>
>>52232501
wait so female programmers were more like secretaries? any sauce on this?
>>
>>52232713
Increase the masturbation frequency
>>
>>52232713
Get a trackball.
>>
>>52232566
13th for x86 Assembly
>>
Geometry is stupid, you'll never use it in the real world.
>>
>>52232757
Bait or ignorance.
>>
>>52232757
>this guy
>>
How can I pass an argument from main, that is a function, to another function? Say I have 3 functions named func1, func2, func3, then I have another called doSomething. I want to pass the selected function from the console to doSomething.

int doSomething (int (*function)(int)) {
//do something
}

Then
int main (int argc, char **argv) {
//selected = argv[1];
doSomething(selected);
}

And something like this
./program func2
>>
>>52232757
I think it's more reasonable to say that 95% of people will rarely need geometry beyond simple mental estimations.
>>
>>52232757
i'm sure you'll have a bright feature in doing string manipulations and sorting database entries
>>
>>52232790
Dispatcher via V-table
>>
>>52232629
>>52232623
>the triangles ABD and ACD are congruent
>the angles BAD and CAD are equal
Yes, but you don't know that just from looking at the image.

I think >>52232410 is the better solution.
>>
>>52232837
>I think >>52232410 → is the better solution.

I meant: >>52232478
>>
Is SQLite still the way to go for storing simple data?
>>
>>52232790
do a case/switch statement in doSomething that calls one of the functions based on the input

pseudocode:
switch (selected)
{
case func1:
func1();
break;
case func2:
func2();
break;
case func3:
func3();
break;
default:
func1();
break;
}
>>
>>52232790
Lookup table.

#include <cstdio>
#include <functional>
#include <map>
#include <string>

static int Hello(int)
{
fprintf(stdout, "Hello\n");
}

static int World(int)
{
fprintf(stdout, "World\n");
}

static std::map<std::string, std::function<int(int)>> Functions = {
{"hello", &Hello},
{"world", &World},
};

static void doSomething(const std::function<int(int)> &func)
{
func(500);
}

int main(int argc, const char **argv)
{
if(argc != 2)
return 0;

auto it = Functions.find(argv[1]);
if(it != Functions.end())
doSomething(it->second);

return 0;
}
>>
hey, give me some functions to write in haskell for practice, i'll post the code and you can trashtalk me
>>
>>52232946
List all YouTube video URLs for any given search query. Bonus points for pagination.
>>
File: 1340447602626.png (112 KB, 316x400) Image search: [Google]
1340447602626.png
112 KB, 316x400
>>52232832
>>52232884
>>52232896
Got it, thanks for the help, lads
>>
>>52232980
>wants me to write something semi useful
hahahahha bro this is haskell we're talking about. give me shit to write that nobody will ever use irl
>>
>>52232999
same thing but for 9gag
>>
>>52232837
how to get the midpoint was already established in a previous level. the construction of it just isn't shown when you use that tool.
>>
File: hyena.webm (2 MB, 720x404) Image search: [Google]
hyena.webm
2 MB, 720x404
Ask your beloved programming literate anything.

>>52232946
ackermann function

>>52232732
That guy doesn't know what he is talking about. before 1970, programming were badly considered by men who favored electronic engineering, the motto was that men were in charge of hardware and women in charge of software. Most of the programming was actually done by women and there numerous women that are considered to be pioneer in programming (margaret hamilton, grace Hopper, stephanie shirley, dina johnston, ...)
>>
>>52232999
OK. Proof that P=NP in your toy language.
>>
>>52232980
This sounds interesting, but requires you sign up for API access with Google and register your application, which is a massive pain.
>>
>>52233056
Ah, right.

I like sticking with the primitive tools because it shows everything.
>>
>>52233106
I was thinking about scraping the search result page. Filtering is where functional programming shines right?
>>
how to do http://euclidthegame.com/Level16/ in 4 steps??? the solution for doing it in 5 is the only one i've known since before and no one in the comments seems to know how to do it in 4
>>
What Linux distrobution does everyone in /dpt/ use?
>>
>>52233138
install gentoo
>>
>>52233132
>Level16 already
Absolute madman.
>>
>>52233126
If using a single higher order function is considered functional programming, sure

Writing "glue" code or a simple script on top of an existing library can be done in anything
>>
>>52232732
More like compilers, often.
See http://articles.chicagotribune.com/1987-08-02/news/8702260658_1_data-entry-operators-labor-force (and pay special attention to the ad transcription)
or other articles at http://articles.chicagotribune.com/1985/jan/05
for the kind of things "programmers" did at this point.
>>
File: windows-7.jpg (161 KB, 1920x1080) Image search: [Google]
windows-7.jpg
161 KB, 1920x1080
>>52233138
>>
>>52233126
parsing HTML structure in any language is a mistake. Your program will work for a bit, but once Google changes the layout, everything will break. Performance will also be worse than using their API. HTML scraping is against their TOS, so they will be liable to cut you off at any time if they discover your scraper. You'll end up needing to rewrite everything using their API eventually.
>>
>>52233138
Arch
>>
>>52233138
Windows 10
>>
>>52232946
https://wiki.haskell.org/H-99:_Ninety-Nine_Haskell_Problems
>>
>>52233064
>>>/tumblr/
>>
C++ file writing woes. This is racking my brain.
I have a file with chars. No padding etc. Just 16 chars.I can read these, no problem.
The problem comes when I want to change char in a specific number slot. I've tried stdio and ofstream versions. Both nulls all chars preceeding the specified char index in the file ( set with fseek or seekp) and wipes the rest of the file. I've tried all their modes (app,out,ate and bin etc).
Anyone know how to just change a fucking character in a file without wiping /nullifying the rest of the shit.
>>
>>52233185
>>52233193
Nice reading comprehension. As expected of grade A retards.
>>
File: stack-sketchy.png (12 KB, 449x254) Image search: [Google]
stack-sketchy.png
12 KB, 449x254
Which data structure would you fug?
>>
>>52233187
This.

Always use an API.

General rule of thumb:
Is there an API?
>Yes
Use the API.
>No
I can't guarantee dick so I'll probably not mess with this unless I just really have to have something temporarily.
>>
>>52233138
>Linux

There seems to be some mistake, I use a UNIX operating system.
>>
>>52233216
Windows 10 is a linux distro.

saying otherwise is literally oppressing my opinion
>>
>>52233229
Post pics
>>
>>52233187
Obviously using an API is much better in every aspect. It's just an exercise.
How would they discover the scraper? It's just a GET request with a generic UA.
>>
>>52233216
yes, I did see you asked for loonix
but we are all lighthearted friend here that don't get their panties in a bunch at trivial shit, my newfriend
>>
>>52232654
if your wrists are twisted in an unnatural position while typing you will get CTS, so:

buy an ergonomic keyboard

have your keyboard on one of those trays that pull out from under the desk, not on top of the desk
>>
>>52233138
windows 7
>>
>>52233221

Vector, the most useful of them all.
>>
File: ytt.png (22 KB, 699x888) Image search: [Google]
ytt.png
22 KB, 699x888
how do i?
>>
>>52232654
>using a mouse
>not keeping your hands and fingers on the home row

Please use a tiling WMI to reduce the risk of RSI related injury.
>>
>>52233269
I think you'd need to imitate some sort of user agent, with resolutions and systems fonts and whatnot, right?

Because if it's a simple GET request with no metadata, it's obvious it's not a browser.
>>
>>52233184
that article describes them as data entry jobs

how are they like compilers?
>>
>>52233214
FILE *file = fopen("myfile", "r+");
fseek(file, 2, SEEK_SET);
fputc('a', file);
fclose(file);
>>
>>52233328
Just copy/paste the headers your browser sends and use that.
>>
>>52233221
Linked list, the basis for 99% of all useful algorithmic constructs.
>>
>>52233309
5th grade math right here
>>
>>52233317
>Being cancer personified
>>
>>52233364
>having cancer in your hands

L M F A O
>>
>>52233317
>buying into the home row meme
>>
>>52233375
are you an emacs tard?
>>
What music does /dpt/ listen to while working or studying?
>>
>>52233412
djent
>>
>>52233412
None because I have serious work to do.
>>
>>52233412
https://www.youtube.com/watch?v=SvmZTGUPEoM
>>
>>52233184
data entry =/= programming

just because 92 percent were women, does NOT mean that every other job in the world was performed exclusively by men
>>
>>52233307
>Vector
how to recognize a maths illiterate ? it's the one who thinks vector is an appropriate name for lists implemented with an array.
>>
>Level 20
>Construct two points, such that the segment is cut into three equal pieces.
oh shit, at this point i can't be bothered

i believe there was a numberphile video on this
>>
>>52233221
anything enumerable in C#

LINQ makes me horny
>>
>>52233412
minimal techno
acousting female vocalists
minimal ambient
field recordings
spiritual talks
>>
>>52233430
That's very appealing in a strange way.
>>
>>52233348
0% of algorithms need a linked list.
>>
File: whoarethesepeople.png (34 KB, 463x309) Image search: [Google]
whoarethesepeople.png
34 KB, 463x309
>>52233430
Actually pretty jamming, but the comments are fucking retarded.
>>
>>52233493
99% of algorithms are implemented as tree structures
100% of tree structures are implemented as linked lists
>>
File: uyo.png (37 KB, 714x811) Image search: [Google]
uyo.png
37 KB, 714x811
>>52233363
i think i'm getting close
>>
>>52233518
>trees are linked lists
Linked lists are a special case of linked trees.
>>
>>52233463

I blame Stroustrup.
>>
>>52233491
I've been listening to Roughsketch for a couple of days while programming and it actually helps. Music with lyrics are just too intrusive.
>>52233509
>reading YT comments
It's the most retarded community ever. What did you expect?
>>
>>52233518
>99% of algorithms are implemented as tree structures
who are these algorithms you speak of?
>>
>>52233542
I blame guns.
>>
>>52233562
skipped your compiler course?
>>
>>52233579

Fair enough.
>>
>>52233562
Red Black Trees
Binary Search Trees
AVL Trees
Andersson Trees
>>
File: lies.jpg (192 KB, 1280x720) Image search: [Google]
lies.jpg
192 KB, 1280x720
>>52233518
>100% of tree structures are implemented as linked lists
>>
>>52233594
>all software ever made is a compiler
>>
>>52233613
None of those are algorithms.
>>
>>52233613
those are data structures, you idiot
>>
File: Pollard-0cc7e.jpg (108 KB, 606x633) Image search: [Google]
Pollard-0cc7e.jpg
108 KB, 606x633
>>52233518
>100% of tree structures are implemented as linked lists
uhh what

>>52233594
????

>>52233613
>algorithms

oyy nigger
are you a first year froshman that came to /dpt/ to show us?
>>
>>52233064
Which one is the hyena? Also, off yourself tetsumi you faggot.
>>
>>52233536
Trees are linked lists with linked list as entries.
>>
>>52233630
data structures and algorithms are inextricably tied, you put data in data structures to improve search and sort speed
>>
>>52233562
Kruskal
Shortest path
Alpha-beta
>>
>>52233657
facepalm irl
>>
>>52233651
>I only know Lisp
That's just one implementation of a tree.
>>
>>52233682
>I only know C
Every tree is implemented this way in the end.
>>
>>52233645
>>52233676
>fizzbuzzing basement dwellers getting their minds blown
>>
how do i average 3 long longs in C?
>>
>>52233738
not this shit again
>>
>>52233719
BinaryTree a = Nil | Node (BinaryTree a) a (BinaryTree a)

Is that a linked list of linked lists?
>>
File: img1458.gif (4 KB, 575x201) Image search: [Google]
img1458.gif
4 KB, 575x201
>>52233719
k tard
>>
>>52233774
static gifs trigger me.

>select all images with trains
lost.
>>
>>52233756
just ignore him, he's baiting you
>>
>>52233756
Yes.
>>
File: spongebob5.jpg (45 KB, 652x362) Image search: [Google]
spongebob5.jpg
45 KB, 652x362
>as long as it works, it's fine
>>
File: level6-noruler.png (66 KB, 874x695) Image search: [Google]
level6-noruler.png
66 KB, 874x695
>>52233309
>>
Javascript or PHP?
>>
>>52233542
why
>>
>>52234030
both
>>
>>52234042

Okay, but which one first?
>>
>>52234030
None.
>>
>>52234030
Go
>>
>>52234030
coffeescript
>>
>>52233774
let lst = [ref 1;ref 2;ref 3]
let arr = Array.make 3 (ref 0)
List.iter (fun x ->
Array.set arr i x)
lst

Wow, the linked list `lst` has magically become an array now even though it's still a linked list and has the semantics of linked lists and the performance signature of linked list! Incredible! Cmen sure are great with their magic! I bet if I cast a char to an int, it's now a first-class string or something! First class strings in C confirmed!
>>
>>52234064
>i is not defined
>>
File: cat.jpg (129 KB, 979x612) Image search: [Google]
cat.jpg
129 KB, 979x612
>clones your repo
>doesn't star
>>
File: zH6getT.png (97 KB, 719x781) Image search: [Google]
zH6getT.png
97 KB, 719x781
topkek @ how angry /sqt/ is right now
>>
>>52234064
>`lst` has magically become an array now even though it's still a linked
lst did not become an array, lst is still a linked list. You just created an array with the same items int values.
>>
>>52234064
it's not a linked list, it has O(1) lookup like an array because it is an array
>>
>>52234117
>forks your repo
>never commits any changes
>>
>>52233521
you just unlocked the perpendicular tool jfc
>>
>>52234130
how do you count the words without "the" and shit coming up on top?
>>
>>52234130
What are those sperm characters before
new int() &&
?
>>
>>52234026
How would you do it in 4 moves just using the primitive tools though?
>>
>>52234160
Strip anything less than 4 characters?
>>
>>52234064
OCaml master race.
>>
>>52234167
bitwise and mathematical negation
>>
>>52234130
>fucking
>shit
>windows
Basically
>>
>>52234167
tadpole operator
>>
>>52234190
That's what you did? or is that a guess for what she did?
>>
>>52234209
>she
>>
What's a simple tree balancing algorithm? I was gonna use a binary tree to store a dictionary but realized it'd just turn into a glorified linked list.
>>
>>52234209
>she

>>52234190
if the point of the program is to find memes, things like "tb᠎h" and "f᠎am" would be filtered
>>
File: sddf.png (27 KB, 693x513) Image search: [Google]
sddf.png
27 KB, 693x513
>>52234026
>>52234181
>>
Develop on windows or fedora on VMware?
>>
>>52234239
You could do rotation on your tree when you insert things.
>>
>>52234209
My guess, most common connectives are 1, 2 or 3 letters.

I tried thinking of any common non-connectives likely to come up in that range but drew a blank.
>>
>>52234249
Develop on windows with a fedora.
>>
>>52234143
No, they're ref cells. If you change the content of the ref in the list, then the corresponding array element also changes. The point is that retards like >>52234146 have no idea what they're talking about and they think that just because you keep a reference to the nodes in a linked list it magically ceases to become a linked list despite the fact that it is still, very obviously, a linked list.
>>
>>52234181
I do not care about the number of steps.
>>
>>52234244
https://www.youtube.com/watch?v=f5HOTO5ghgM
>>
>>52234240
Well then it looks like they've been filtered, doesn't it?

Unless you have a dictionary list of words to skip how else would you do it?
>>
>>52234191
LMMO.
>>
Why doesn't this work, it just prints false 4 times.

public class WhiteSpace {
public static void main(String[] args) {

boolean isFormatted = false;
for(int x=0;x<3;x++)
{
if(x==3)
{
isFormatted = true;
System.out.print('8');
break;
}
System.out.print(isFormatted);
}
System.out.println(isFormatted);

}
}
>>
>>52234282
>I do not care about being inefficient
I'm shaking my head at you right now.
>>
File: DGnk5h9.png (182 KB, 844x1083) Image search: [Google]
DGnk5h9.png
182 KB, 844x1083
>>52234191
nice
>>
Whatever happened to the anon who was writing a c++ compiler in Haskell? How did that project go?
>>
>>52234269
That doesn't make the array a linked list
>>
>>52234355
The problem is here.
for(int x=0;x<3;x++)


Your loop don't go to 3 at any point. You wanna put x<= 3 instead.
>>
>>52234355
Because x is never greater than 2.
>>
>>52234269
>If you change the content of the ref in the list, then the corresponding array element also changes
But the array and the list have a separate set of refs you moron. You make them point to the same thing, but changing one in the array does not change the refs in the list.

Also, each item in the array is actually the same ref, so setting any ref in the array changes ALL the refs in the array. So at the end of your code, all the items in your array point to 3.

Not that your code even compiles, because you didn't define i. Good job. I'd lay off calling other people in this thread retards if I were you.
>>
>>52234291
xpo6.com/download-stop-word-list/
>>
What would be the best book/place to learn the HTTP protocol? I'm looking to write a browser for fun.
>>
>>52234411
Don't spoon feed him. This is not a place to learn.
>>
>>52234410
The tree will be visited by following parent-to-children links in order to extract any meaningful information. Thus, it remains a linked list.
>>
>>52234464
What does anything about the code you just posted have to do with trees?
>>
>>52234390
That lack of semicolon is awful.
>>
>>52234464
>The tree will be visited by following parent-to-children links in order to extract any meaningful information.
no it won't. It's just an array.

You are a terrible programmer.
>>
>>52234420
let lst = [ref 1; ref 2; ref 3];;
let arr = Array.create 3 (ref 0);; Array.set arr 0 (List.hd_exn lst);; (List.hd_exn lst) := 18;;
arr;;
- : int ref array = [|{contents = 18}; {contents = 0}; {contents = 0}|]

Do you want your "clinically retarded" certificate in person or delivered to your home?
>>
>>52234487
It rarely needs them
>>
>>52234436
Right, so a dictionary list it is.

Enjoy the latency to compare to every value in the list for each word.
>>
>>52234482
It is a simplified version of the same structure. Just like the previous one, it is a linked list where an array keeps a reference to each node. It's not fucking rocket science.
>>
File: RAGEFACE_2884211.jpg (139 KB, 1280x1044) Image search: [Google]
RAGEFACE_2884211.jpg
139 KB, 1280x1044
>>52234487
This is what I hate most about modern and hippy languages like python.

>We don't use semicolon
>INSTEAD WE USE A RETARDED TYPE OF SPACING IN ORDER TO SHOW THAT WE ARE IN A DIFFERENT LINE, FUCK YOU IF YOUR CODE IS NOT RUNNING CORRECTLY.
>>
>>52234509
fuck, removed the
(List.hd_exn lst) := 18;;

in retranscription.
>>
>>52234512
I know, but I don't like it.
>>
>>52234513
If there's a significant performance drop, you could add an option to switch between the two methods.
>>
>>52234487
The semi-colons are not needed except in the presence of side-effect (they're really just sugar <expr>; \equiv let () = <expr> in)
>>52234542
And unlike python, no significant whitespace.
>>
>>52234542
Don't confuse, indentation language is the future. Semi colon must not exist in indentation language, and it should be the same for parenthesis.
>>
>>52234400
Into the trash, like every other functional faggot's "projects".
>>
>>52234555
Fuckit, you right.

In any case the array is in no way a list. That's retarded.
>>
>>52234487
other than the top-level statements and the 2 bodies of the try ... catches, the entire program is made up of a single expression per definition so no extra semicolons are needed
>>
I've used GCC for my compiling needs all my programmer life, but now I'm wondering if clang is worth giving a try.

Should I? I'm talking C++ mostly here.
>>
>>52234530
Typically if you store a tree as an array like that, you don't traverse it by following links, you simply iterate through the array
Depending on how you store the tree, you get a depth-first or breadth-first traversal

And FYI, if you're still trying to argue that trees are linked lists of linked lists, >>52233774 posted something completely irrelevant to my argument that they're not, and contradicting it doesn't contradict me
>>
File: 4990119101_7cbaafa08f_o.jpg (40 KB, 500x769) Image search: [Google]
4990119101_7cbaafa08f_o.jpg
40 KB, 500x769
I'm gonna program C# on Visual Studio and you niggas ain't gonna stop me!
>>
>>52234654
I never say that they're needed. I just say that I like them.
>>
>>52234659
You probably won't even notice a difference that's how swappable they are.
>>
>>52234659
>>52234694
He'll notice a difference (sharp rise) in the quality of error messages
>>
>>52234160
Filter out prepositions?
>>
>>52233138
OSX
>>
>>52234687
The number of people on /dpt/ who hate C# is actually very small.
>>
>>52234687
stop hammer time!
>>
>>52234751
does that make C# the unmemeable language?
>>
Threadly reminder that you should not refer to the act of programming as coding. It is improper and makes you look like a 15 year old

You are a programmer, not a coder

Software Alchemist is GOAT
Developer is okay
Magician is okay
Software Engineer is okay
Software Architect is okay
>>
>>52234773
C# is GOAT
>>
File: vvv.jpg (178 KB, 700x391) Image search: [Google]
vvv.jpg
178 KB, 700x391
>>52234448
>This is not a place to learn.
>>
>>52234780
How about Software Wizard?
>>
you know that C99, C++, Java, C#, D, etc. all use significant whitespace, right?
>>52234773
no, it just happens to be better than most of its alternatives
>>
>>52234773
yes, C# one of very few /dpt/-non-meme-seal-of-approval languages.
>>
>>52234830
fuck, meant to reply to >>52234542
>>
>>52234830
Oh great the white space discussion again, this has been determined relatively insignificant over and over
>>
At what point can you claim to "know" a language?
>>
>>52234884
when you can write fizzbuzz in it
>>
>>52234884
at the point that you've created an actual project with it and can read real-life code written by other people
>>
>>52234830

Whitespace can be significant (which it always is) without enforcing style guidelines.

That is where Python fails. Go has the same problem in that it enforces a brace style.
>>
>>52234884
when other people use code you wrote in it
>>
>>52234941
i had like 3 people clone my repo and rewrite it in a difference language due to interest, does that count?
>>
>>52234884
if you can read other peoples code and smirk whenever you see a bad practice/code
>>
>>52234959
sure m8
>>
>>52234884

When you can program data structures in it.
>>
>>52234973
tight.
wait. it was originally in perl. does it.. does it still count?
>>
Is it weird that I don't like looking up algorithms? I feel stupid when I look them up but I know that it took minds much smarter than my own years to come up with some of them so it's unlikely I could come up with an algorithm that's better than theirs. Still I can't help but feel dumb when I use someone else's code.
>>
>>52234671
Only if you pack the structure fix-sizedly. If you need to extend the "tree" in that scenario, most of the time you'll add additional trees and introduce them in place of one of the elements, since it's extremely rare that you both want to add elements to the tree and only have that want rarely.
>>
>>52234780
I am a computer archmage. Come at me, lowly "software" "alchemist".
>>
>>52235037
no, this is a common trait of beginner programmers.
>>
>>52234780
Shut up and code.
>>
>>52234773
Beside forced OO and the extremely heavy windows reliance (in practice), there's not much to hate about it desu senpai.
F# is strictly better, though.
>>
>>52234751
>>52234773
it just means that Csharts are salty as fuck and non-Csharts are relatively mature

Csharts are so insecure and butthurt that they have to keep memeing about java all the time for no reason
>>
>>52235037
I often find trying to come up with my own algorithms teaches me a lot, and when i look up the actual algorithms I appreciate why they are designed the way they are a lot more.
>>
>>52235106
>literally can't even spell right
As expected from javatards.
>>
>>52235092
>F# is strictly better, though.
No. It's slower and "functional"
>>
>>52235106
I often talk about C# in these threads, but only when someone claims Java is better for some reason, which makes no sense. I don't even use C# and haven't in years.
>>
>>52235131
>literally can't get the joke
as expected from Csharts

i deliberately write Cshart because it rhymes with C sharp but shart also means a shit fart

i'm calling you shit farts
>>
>>52235092
maybe, but F# isn't a direct alternative/competitor to C#
>>
>>52235148
It's not slower at all. You can write all the same stuff in F# that you can in C#. It will just be much shorter and clearer.

C# has a lot of functional stuff too, F# just has a lot more. You are not forced to use it.
>>
>maybeLoadfromAPI()
>maybe
why.webp
>>
char *data = new char[32 * 1024];
// read data (may be <32k)
int size = strlen(data);

std::string str{data, size};


Will std::string properly handle the memory or I'm fucked?
>>
>>52235182
>but F# isn't a direct alternative/competitor to C#
It's exactly that. I wouldn't call it a "competitor" exactly, but it's certainly an alternative.
>>
>>52235193
it's autism
>>
Interesting observation. Codata doesn't necessarily have to be defined negatively, it's all in how the induction in the structure is "sized" (and how it's implemented - pointers with data, thunks with codata). I don't see negative data being particularly useful, but there's no reason not to allow it. Now, no matter if it's data or codata, a data type without recursion is a struct if negative and a discriminated union if positive.

-- always finite
data List : Set -> Size -> Set where
Nil : List a i
Cons : a -> List a i -> List a (^ i)

-- potentially infinite (like Haskell)
codata LazyList : Set -> Size -> Set where
LNil : LazyList a i
LCons : a -> LazyList a (^ i) -> LazyList a i

-- always infinite
codata Stream : Set -> Size -> Set where
head : Stream a i -> a
tail : Stream a i -> Stream a (^ i)

-- equivalent, but less convenient
codata Stream' : Set -> Size -> Set where
SCons : a -> Stream' a (^ i) -> Stream' a i
>>
File: 1449170292732.jpg (280 KB, 1114x876) Image search: [Google]
1449170292732.jpg
280 KB, 1114x876
>>52235106
Just got done porting my project over from Java to C#, feels good man. Runs faster too.
>>
>>52235229
>->
dropped
>>
>>52235241
what a waste of time if you actually did it
>>
>>52235252
-> is objectively the best operator in existence
>>
>>52235252
Agda style is pretty but a pain in the arse if you're using a regular text editor. No thanks.
>>
>>52235284
it's fine when it's used as a indirection member access operator, but anything else is shit tier
>>
>>52235299
True, I was actually mistaken. For I minute I thought -> was the lambda operator in C# but it actually looks like this:

(x, y) => x == y


No idea why but I think that just looks extremely elegant
>>
>>52235168
Reminder to report the underageb&!
>>
What does make C# so different than C++ to Microsoft only wanna use it?
>>
>>52235204
string won't handle the same memory ( it will allocate its own buffer )
make data a unique_ptr<char[]> and you're good to go
>>
Are there any languages worth using that aren't heavily based on C syntax?
>>
>>52235182
Perhaps in theory, but in practice, it is. It is applicable in precisely every and all use cases you'd otherwise use C#, but it's more concise and readable.
>>
>>52235363
It was a different time, microsoft built their own frameworks and walled garden during a time when vendor lockin was considered "acceptable".
>>
>being this good
>>
>>52235270
>>52235168
>>52235106

>Csharts are so insecure and butthurt that they have to keep memeing about java all the time for no reason

I think it might be the Javafags that are insecure
>>
>>52235363
... What?
>>
>>52234130
Is that C#?
>>
>>52235363
lrn2english and try again.
>>
>>52232566
What do i need to be able to code on windows 8
>>
>>52235419
you need the latest version of visual studio, which requires at least windows 10
>>
>>52235419
How much ammunition do you have readily available?
>>
>>52235400
Yes

>>52235419
What do you want to "code"

also please refer to this post >>52234780
>>
>>52235419
a brain
>>
>>52235386
Show it with just the primitive tools senpai.
>>
>>52235368
OCaml. F# if you're on M$ platforms only. ATS for embedded work. If you want to stretch the definition of "based on C syntax", python (due to the wide range of libraries available at a higher level of abstraction; but it's a really shitty language in and of itself and most libraries are garbage quality), lua (game scripting mainstay, very fast and light, has some real hardcore libraries too). For massively distributed programs, erlang/elixir (erlang powers whatsapp, for instance, and is the de facto standard in the telephony industry).
>>
>>52235363
If I understand your post correctly it's because Microsoft is big on dogfooding. They control C# and mould it to fit their needs, no need to worry about Java or C++ introducing a change that causes them to fork the language.
Thread replies: 255
Thread images: 30

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.