[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: 19
File: ko.png (389 KB, 934x1000) Image search: [Google]
ko.png
389 KB, 934x1000
What are you working on, /g/?
>>
>>52056774
A buzzfizz generator in brainfuck.
>>
First for Go
>>
F#D
>>
java
>>
this is meant to check if an int is a palindrome but it doesn't
int checkPalindrome(int n)
{
char *str;
str = malloc(1024);
sprintf(str, "%d", n);
char *strstart = str;
while (*str++);
str--;
while (*strstart++ == *str--)
{
if (strstart==str)
{
return 1;
}
}
return 0;
}
>>
Dammit, got beat in the other thread. Posting anyway:

print "1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17\nFizz\n19\nBuzz\nFizz\n22\n23\nFizz\nBuzz\n26\nFizz\n28\n29\nFizzBuzz\n31\n32\nFizz\n34\nBuzz\nFizz\n37\n38\nFizz\nBuzz\n41\nFizz\n43\n44\nFizzBuzz\n46\n47\nFizz\n49\nBuzz\nFizz\n52\n53\nFizz\nBuzz\n56\nFizz\n58\n59\nFizzBuzz\n61\n62\nFizz\n64\nBuzz\nFizz\n67\n68\nFizz\nBuzz\n71\nFizz\n73\n74\nFizzBuzz\n76\n77\nFizz\n79\nBuzz\nFizz\n82\n83\nFizz\nBuzz\n86\nFizz\n88\n89\nFizzBuzz\n91\n92\nFizz\n94\nBuzz\nFizz\n97\n98\nFizz\nBuzz"
>>
>this woman has better employment opportunities than you because she's a "wimmin who codes"
>she hasn't commited a single line of code to any of the repos she forked
https://github.com/ashleygwilliams
>163 repos
>>
>their strings use 2 characters per character
Daily reminder to check ALL input for palindromes
>>
>>52056846
And the meme generator code:
parts=["print \""]
for i in range(1,100):
if i%3==0 and i%5==0:
parts.append("FizzBuzz\\n")
elif i%3==0:
parts.append("Fizz\\n")
elif i%5==0:
parts.append("Buzz\\n")
else:
parts.append(str(i)+"\\n")
parts.append("Buzz\"")
print "".join(parts)
>>
>>52056868
>for loop
>i%x==0 x2
>range(,)
>if, elif, else
>parts.append
>x5
>>
>>52056834
Just use array syntax and compare str[i] with str[len - i].
>>
>>52056887
wow, I actually out-memed myself unknowingly
>>
>>52056905
>escaped \
>4x \\n


>NOT ONE LINE
>>
>>52056927
That's an extra line of code. If strings were mutable in python, half of those lines would be gone
>>
>>52056905
how do you fight the urge to just stop breathing when you're being you?
>>
>>52056947
Wait.
It's Python?

COULD IT BE ANY FUCKING WORSE
DPT is literally ruined forever by that code, I hope you're happy.
>>
>>52056895
I was trying to do it with pointers
>>
>>52056998
Pointers are deprecated
>>
Asking again...
Does a language that has all the features of Haskell but doesn't force purity so much exists?
>>
 for x in ["FizzBuzz" if x % 3 is 0 and x % 5 is 0 else "Fizz" if x % 3 is 0 else "Buzz" if x % 5 is 0 else x for x in range(1, 100)]: print(x)

>>
>>52056834
It's not worth playing with pointer arithmetic unless you intend to indiscriminately process what's in the array, like using while (*str) instead of while (str[i] != whatever).

Write a strrev function and if strcmp returns 0 true for the reversed and original string , return true.
>>
>>52056966
We've been memeing for hours you melt.
>>
>>52056895
In D, inside a slice operator (overloadable) you can use the $ symbol (normally the length of the array, overloadable) e.g. arr[5..$], arr[$-5..$], or the hideous
array[count ? ( $ > count ? $ - count : 0) : 0 .. $]
I used here >>52056669

pretty neat senpai
>>
What an awful general
>>
someListOfLists.Find(x => x.PropertyName == "PropertyLookupValue").Find(x => x.SomeOtherPropertyName == "SomeOtherPropertyLookupValue").Remove();
>>
#!/usr/bin/env python2

for i in range (1, 101):
if i % 15 == 0:
print "Fizzbuzz"
elif i % 5 == 0:
print "Fizz"
elif i % 3 == 0:
print "Buzz"
else:
print i
>>
>>52057039
thank you based one liners, 10/10 perfectly readable would maintain
>>
>>52057058
>he thinks one liner has to be one line
>>
>>52057034
no
Haskell without purity is like Java without classes
>>
>>52057095
Taking features away from Java would only make it better. I hope they take the whole language away.
>>
What the fuck do I do after learning Haskell? What can you do with it? Can I make a game.
>>
>>52057095
It's a good example because just like how c# deprecates java, f# deprecates haskell
>>
>>52057034
Yes you are describing exactly Scala
>>
>>52057149
You're cute anon.
>>
>>52057034
just make all your functions a -> IO (a) instead of a -> a.
>>
>>52057034
Yes, any ML-family language (F#, SML, OCaml, etc.)
>>
>>52057142
Learn F#

F# stands for Fash, as in fashionable
>>
>>52057168
IO is not a garbage bin.
>>
File: CV0AKJgVAAEumxb.jpg (21 KB, 480x260) Image search: [Google]
CV0AKJgVAAEumxb.jpg
21 KB, 480x260
Reminder that a functional language that doesn't enforce purity is literal dog shit
>>
>>52057179
sure it is
>>
>>52057191
Reminder that purity is fundamentally opposed to any form of computing
>>
>>52057178
>F# stands for Fash
What a lie, it stands for FAGGOT#.
>>
File: IMG-20151221-WA0004.jpg (190 KB, 960x960) Image search: [Google]
IMG-20151221-WA0004.jpg
190 KB, 960x960
Anyone else just fucking tired of this F# shill?
>>
>>52057211
Filthy dirty pig.
>>
>>52057220
Reminder that if your language isn't pure, neither is your wife
>>
>>52057235
Yeah, F# is such dogshit compared to OCaml. If this shill could just SHUT UP for a bit.
>>
>>52057142
Maybe learn about Idris... it's basically Haskell 2.0 with dependent types and the lazyness meme isn't the default.
>>
>>52057235

This guy is right. D is much better.
>>
>>52057241
No human being is pure (except Kim Taeyeon).
Haskel fags pussyfoot around this fact by the virtue of not having wives
>>
>>52056774
reading a 1200 page C++ book. 180 in so far.
>>
>>52057248
It's Haskell but it looks feels and runs like shit
>>
I'm working on an Android app mainly for testing out cool Android features (both hardware & software). Lately I've been playing with the text-to-speech stuff.
Any recommendations on Android stuff I could work on? I'm mostly interested in finding out what Android offers and how it works.
>>
I don't know, man. I'm board.

private void AbstractFactoryCockSuckingBean(Thread thisThread)
{
foreach (Fucking faggot in thisThread)
{
faggot.LevelOfFaggotry = 5; //TODO: Get level of faggotry by analyzing post
faggot.FlavorOfFaggotry = "General Faggotry"; //TODO: Get flavor of faggotry by analyzing responsed to post
}
}

public class Fucking
{
public int LevelOfFaggotry;
public string FlavorOfFaggotry;

public Fucking() {}

public Fucking(int _leveloffaggotry)
{
LevelOfFaggotry = _leveloffaggotry;
FlavorOfFaggotry = "General Faggotry";
}

public Fucking(string _flavoroffaggotry)
{
LevelOfFaggotry = 5;
FlavorOfFaggotry = _flavoroffaggotry;
}

public Fucking(int _leveloffaggotry, string _flavoroffaggotry)
{
LevelOfFaggotry = _leveloffaggotry;
FlavorOfFaggotry = _flavoroffaggotry;
}
}
>>
>>52057276
That sounds exactly like Haskell.
>>
>>52057277
Try rewriting android so it isnt shit
>>
>>52057295
now make FlavorOfFaggotry an enum instead of being stringly typed
>>
>>52057095
I'm not asking for a non pure Haskell, I'm asking for a language that can easily behave as pure if you want
>>
>>52057321
>flavour
>an enum

it's a seven dimensional vector of ints m8
>>
>>52057277

Try doing projects for people and getting paid for it
>>
>>52057321
So I define all the flavors and the user has to pick one?
>>
>>52057321
>not having string typing in your language
If your language doesnt convert all types to strings it's shit
>>
>>52057328
Scala man. It's just exactly what you're looking for and more
>>
File: nani.png (304 KB, 722x768) Image search: [Google]
nani.png
304 KB, 722x768
What are unions for?
>>
File: checker.jpg (42 KB, 540x420) Image search: [Google]
checker.jpg
42 KB, 540x420
/dpt/ I would select all your squares containing gift boxes if you catch my drift
>>
>>52057355
What kind of union? Be specific
>>
Fuck it.

I'm going to develop at faggotry indicator in my 4chan browser based on keywords in post.

Need examples of Flavors of Faggotry and keywords they'd be using.
>>
>>52057355
Protecting workers rights
>>
>>52057355
In SQL?
>>
>>52057363
F#
D
Java
C++
>>
File: IMG-20151221-WA0010.jpg (336 KB, 1200x1600) Image search: [Google]
IMG-20151221-WA0010.jpg
336 KB, 1200x1600
>>
>>52057328
unsafePerformIO
>>
Haskell is not a pure language because it can do things
>>
>>52057361
the struct kind
>>
>>52057451
All of the members of a union occupy the same memory (the size of the largest member). That's it.
>>
>>52057342
I'll look at Scala so, I avoided it until now because of the JVM (I know it's kinda stupid but I have always had bad experiences with it).
>>
>>52057319
no
>>52057331
Maybe I'll do that in the future. Fow now I just want to work on a couple of simple projects, push them to some repository so I can also add them to my CV and then work on apps that I can actually profit from.
>>
>>52057451
>>52057471
example use:
union
{
float[3] data;
struct
{
float x, y, z;
}
} vector;

vector.x is the same as vector.data[0]
this is a very safe case, but if you have different types you can write code that isn't type safe
>>
>>52057451
This
>>52057471
Useful for space-saving (if you are using a microcontroller) or for type dynamism.
union vartype {
long l;
double d;
char *str;
void *obj;
}
>>
>>52057505

Try making an Instagram clone.
>>
>>52057169
My experience with F# (knowing some Haskell) wasn't so nice... Are Ocaml and SML better?
>>
>>52057535
F# is very similar to ocaml. What went wrong?
>>
>>52057535
SML has the best syntax, OCaml has the best features and speed. Depends what you didn't like about F# though.
>>
File: 1323453729528.jpg (64 KB, 333x500) Image search: [Google]
1323453729528.jpg
64 KB, 333x500
>>52057526

This is technically undefined behavior according to the C standard, but the most used compilers will do what you want it to do, which is to retain the value of the last defined variable and print out the value in the type of what you are calling from the union.

I wish they would seriously just port over the reinterpret_cast from C++ which basically defines this behavior clearly in the standard to C. Never know when some rogue compiler decides that it wants nasal demons instead.
>>
>>52057526
Oh, for microcontrollers, bit addressing IO ports (This is AVR).
union Register {
uint8_t byte;
struct {
uint8_t b0 :1;
uint8_t b1 :1;
uint8_t b2 :1;
uint8_t b3 :1;
uint8_t b4 :1;
uint8_t b5 :1;
uint8_t b6 :1;
uint8_t b7 :1;
} bits;
};

#define PORTD_ (*((volatile union Register*)&PORTD))

PORTD_.b0 = 1
...

You could probably redefine your PORTD by using some awful define/undefine hacks.
>>
>>52056902
Your opinion is shit though. "." means compositing functions backwards. Less intuitive to read the flow of logic.
>>
>>52057674
>You could probably redefine your PORTD by using some awful define/undefine hacks.
nvm, what I thought of would alias defines and once you undefined and redefined (Cpp macros aren't smart) the link would become recursive. Man, fuck Cpp macros.
>>
>>52057666
>>52057674
another example would be discriminated/tagged unions
struct
{
tag_type tag;
union
{
variant_1 as_v1;
variant_2 as_v2;
variant_3 as_v3;
variant_4 as_v4;
} content;
}

then you dispatch based on what the tag is

>>52057714
CPP macros are turing complete m8
>>
>>52057235
I think there's a few of us, including me. I've been big on F# for years, but there's usually nothing to say about it in /dpt/ because no one else is using it or talking about it. But seems like a few anons are as of late, so I'm jumping in.

It's a seriously under represented language on /dpt/. Been enjoying the discussions with our ocamlfag bretheren.
>>
>>52057775
i love it
>>
>>52057775
real talk, is F# the best functional programming lang currently?
I studied haskell 'cause I've heard it here, and also, my crush math teacher had that last name
I just wanna know what the difference are (other than syntax) what kind of support it has, etc, pls enlighten
>>
>>52057485
Don't use scala.
https://www.youtube.com/watch?v=uiJycy6dFSQ

F# is basically the not-completely-fucking-broken version of scala
>>
>>52057543
For example I found typeclasses to be extremely interesting in Haskell but I think there's nothing similar in F#
>>
>>52057818
Haskell is pure functional, which is shit
F# is multi paradigm
>>
>>52057841
why is it shit?
also, explain this "multi-paradigm"
>>
>>52057835
Looking into it
>>
>>52057818
If you want the .NET ecosystem, you definetly want F#. Otherwise I'd give Haskell the edge.
>>
>>52057818
>real talk, is F# the best functional programming lang currently?
It depends what you want to do. But imo it's the best get-shit-done FP language.

The main difference between haskell and F#, is that haskell is a pure function programming language and makes it very hard or impossible to do imperative or object oriented style programming. That can be very interesting to work with, but not necessarily that productive for most kinds of programming problems. F# just provides FP as another way of solving problems, but lets you use imperative or OO programming paradigms comfortably when they make more sense, while still encouraging you to use FP first.
>>
>>52057835
How do they differ from interfaces?

>>52057871
Functional programming is one paradigm
so is imperative programming
data driven programming
component programming
language programming
generic programming

F# supports a lot of paradigms very well
>>
>>52057878
>.NET
wew lad
>>
>>52057903
>Someone mentioned a technology I don't like
>TRIGGERED
relax autismo
>>
>>52057883
seems promising
anyways, is there wide support for it?
will it get me a code monkey job?
>>52057912
not applications and no intellectual reward
>discarded
>>
>>52057732
>CPP macros are turing complete m8
Redefine a macro based on the previous value. For example: temp is 12, temp get redefined to temp 56. Like my example: redefine PORTD to be what I have there.
>>
How do I make money now that I've read through "Java for Beginners" 6th edition?
>>
>>52057959
>I can't make a meme snake
At least you're being honest with yourself, anon.

I gave up after 36 lines of code too, so don't feel bad about it.
>>
>>52057959
>anyways, is there wide support for it?
yes, it works perfectly on everything that supports C#.

>will it get me a code monkey job?
Not really, though it will look good as another language on your CV, and learning it will improve your C# code, of which there's plenty of jobs in. There's not many jobs for FP languages. But if you get a job in C#, I'm told they'll often let you use a some F# at times.

There are some F# jobs, mostly in financial services if that interests you.
>>
>>52057903
.NET is objectively a Good Thingâ„¢

It's the the most comprehensive standard library around, which means you don't have to try to import 70 things to do a complex application.
>>
I just wrote a thing that takes an image, hashes it, then stores that hash in a bloom filter. One day that may become a r9k that disallows image reposts, but it probably won't.
>>
>>52057912
Explain more.

I'll make it in an open-source language.
>>
>>52057883
Someone has never used monads.
>>
Building a web-sockety board gaming website in Java & Typescript.
>>
>>52058029
Why do you think that?
>>
>>52057973
>mutability
CPP macros are pure functions
>>
>>52058004
so
C -> C# -> F#
in order
thanks f.am
>>
>>52058016
.NET is a meme from memecrosoft.
>>
>>52056857

https://github.com/ashleygwilliams/x86-kernel

Have you looked at any of her own repos?
>>
>>52058040
what do you made that order on?
>>
>>52058038
Because monads allow easy imperative/object style programing.
>>
Question about Python.
Say I have two files, backend.py and main.py.
I use main.py for the GUI, in main.py I import backend.py, and just call a backend function when needed.
However, I need one of the backend functions to call a GUI function. When an automatic calculation fucks up I want a popup to appear and ask the user to specify the variables.
Is it possible to call a main.py function, in a specific instance of a class, in backend.py? Or am I going to have to do a rework of the code?
>>
>>52057883
Definitely never used monads before.
>>
>>52058060
>Haskel fags
>Yes, they are really this stupid
>>
>>52058054
I assume everyone starts with C, and C# first because of F#, right?
>>
>>52058072
don not reply to this post pls
>>
>>52058097
?
are you talking about the order of the music notes?
>>
meme
>>
>>52058111
too late, someone just did
>>
>>52058046
Yes. That one, for example, is just her following this http://os.phil-opp.com/multiboot-kernel.html
>>
File: 1415079252033.jpg (86 KB, 617x551) Image search: [Google]
1415079252033.jpg
86 KB, 617x551
>>52057984
anons pls Im not trying to inject you with memes Im just a complete fucking newfag with this kind of shit, poor as hell, need income
>>
>>52058039
Worthless. Easy to work-around at least.
>>
>>52058097

It would sound like a good idea. C as a first language is something I recommend to everyone, and after that, anything goes. I'm not sure if C# before F# is entirely necessary, but it would possibly help that there are better resources for learning the .NET framework via C#, than there are of learning it via F#.
>>
>>52058152

Read it again
>>
>>52058023
A snake game, the snake is a string of text defined by the user and its food is the next character in the string.

For example:

With the text "memesnake" the snake would start out as:

- "mem" and its food would be an "e"

- when it eats the "e" it grows to "meme" and its next food would be an "s"

- when it eats the "s" it grows to "memes" and its next food would be an "n"

- when it reaches the end of the string it just repeats until the user dies

/dpt/ can't make a meme snake.
>>
>>52057984

Build a portfolio of personal projects.
>>
QR-Code Generator/Scanner as my typical "how do i programm in this language"-task, this time its javascript, always tried to avoid it, but since everyone loves note.js i guess there is no more avoiding it.
>>
>>52058159
C is literally one of the worst possible first languages. It's the posterboy for a second language - now you understand the concepts, here's the nitty gritty.
>>
>>52058213

Would you recommend Python as a first language?
>>
File: 1438441304668.png (181 KB, 256x733) Image search: [Google]
1438441304668.png
181 KB, 256x733
>>52058184
Sounds way more difficult than a meme star tbqh.

I'm not gonna even try.
>>
>>52058238
I would. Just make sure you leave before it makes you soft.
>>
>>52058184

So in other words, it's the standard snake game, but with letters making up the body of the snake and its food. Presumably, it also has user-selectable words?

Not sure if it would be best to try this with curses/some other console IO library or with a proper graphics libary, but using font rendering.
>>
>>52058238
Python or C#.
>>
>>52058238
Yes. Rubys kinda nice too though I personally dislike it.
>>
>>52058184
I'm tempted to do this by spawning and killing window frames at coordinates on the monitor to see if it would be playable.
>>
>>52058262
>So in other words, it's the standard snake game, but with letters making up the body of the snake and its food.
Yeah.
>>
>>52057034
If you have to work around purity in Haskell you'll probably not write very good code in any other functional language.
>>
>>52058286

Exactly how I feel about Python.
>>
File: 1450816664156.png (39 KB, 296x283) Image search: [Google]
1450816664156.png
39 KB, 296x283
>>52058239
WAHEY
>>
>>52058317
What's pic about? If this some dank new meme I haven't heard of?
>>
>>52056774
trying get into laravel framework before monday, so I can deliver on time. Shit is classy as fuck
>>
>>52058369
>PHP

kill yourself
>>
>>52058391
Still the best language for small server side projects
>>
>>52058213
C's good as a first language if the person learning is willing to struggle and has rigid deadlines to hit like in a class setting. If they have issues they'll basically be forced to seek help and they'll learn fast.

I think the best part about C as a first language is that it makes going to better languages a cakewalk.
>>
>>52058419
>notejs
>>
>>52058419
no
>>
What's the point of a monad anyway? Is a monad more than an object onto which application is defined? Why should I use [1 .. 3] >>| (\x -> x + 1) instead of a theoretical List.map [1 .. 3] (\x -> x + 1)? Aren't they literally the same thing?
>>
>>52058419
If it's small then i guess whatever you're comfortable with. Doesn't matter much. I find F# and suave.io a lot of fun. Python has some nice super lightweight webserver stuff. node.js is not bad either.. and could actually help you get work.
>>
>>52058440
>using a server language that has bascially no server features and relies instead on any web behaviour be distributed as third party packages
I mean if your site is a single page sure.
>>
>>52058040
C is never going to net you a job senpai. Just saying.
>>
>>52058502
List monad is a bit more subtle that that. You can't substitute bind for map anyways, it doesn't make sense with the types.

The list monad is useful, for example, if you have a function with N solutions instead of exactly one. You can compose those functions together with bind so that you end up with all the possible permutations (though a set monad may be more appropriate so you don't end up with duplicates).
>>
>>52057039
1.upto(100) { |num| puts (num % 3 == 0 || num % 5 == 0 ) ? ((num % 3 == 0) ? "Fizz" : "Buzz" ) : num }

Ruby > Python
>>
>>52058213
C is the perfect first language. It's so shitty that no matter what second language you choose, you'll never go back - but at least you understand the nitty gritty now.
>>
>>52058537
>better than python
Still disgusting.
>>
>>52058502
is that f# notations
in haskell, its >>=
and
[1..3] >>= (\x -> x + 1) 

doesn't work since lambda input requires an element, and [1..3] is non-deterministic computation
>>
>>52058502
>>52058535
Monads themselves are just a generic pattern. They don't really mean anything, there's just the associated functions and laws.
>>
>>52058537
Also: Note that this ruby one line is shorter than the python one line.
>>
>>52057168
Might as well just write C while you're at it
>>
>>52058546
That was Java for me.

Did Java first, kinda understood but didn't like it.

Learned C#, which is my main language today.
>It's Java, but it doesn't make me want to kill myself!
>>
>>52058511
I actually have to use node for my current job/internship. It's the worst backend platform I've ever used. But maybe I just dont "get it". We've recently begun a Go team so I'll probably move to that since I prefer static/strong typing. But go is a pretty meme language itself. The more I work on the web the more I think it's a lost cause. As a domain it seems to attract the worst possible platforms, or encourage new platforms to be awful. The best web technologies are the ones designed for enterprise, quite frankly, which is a sad state.
>>
>>52058564
opps, wew lad, forget my shit, just red up on list monad
>>
>>52058589
If you want a good non-meme language for backend shit, learn C#. There's jobs in it too. It's by far the least shit server side language you can actually get a job with.
>>
>>52058535
>>| not bind, it's monadic map.
>if you have a function with N solutions instead of exactly one. You can compose those functions together with bind so that you end up with all the possible permutations
U wot m8?
And is there any more practical application of monads? Or for example, what is bind even? Every explanation about monads just says "it's a thing! Don't worry about it!" or "it's application!" so then whatever is the point anyway?
>>
2>>52058589
How exactly is Go a meme langauge?
>>
>>52058589
C# is best backend web language, anon.
>>
>Maybe -> computations with possible error
>Either -> computations with possible error and message why
>functions -> computations that havn't been done yet
am I missing yet
>>
>>52058610
>If you want a good non-meme language for backend shit, learn C#.

What the fuck this C# shill around here? It even seems that Microsoft is paying its workers to shill about his shitty platform and language here lol
>>
>>52058537
Readability is king senpai
>>
>>52058643
*am I missing something?
>>
>>52058457
yes
>>
>>52058647
Get your head out of 2007.

C# has become one of the best languages for modern usage.
>>
>>52058630
not him, but it's basically a useless language. A solution to a problem no one has. Slightly slower than C++, slightly faster than C#. Got to rethink everything to learn to program in it well because it's not like anything else. Doesn't work well with C++ libraries as a result, and the ecosystem is still immature. C# is a better choice for just about any project that Go would be considered for in the real world. It won't be long before it's gullible user base drop it for the next meme language. It's just another language for the Google language graveyard. RIP Dart.
>>
>>52058610
C# is actually my language of choice. I would never use it for the web because that would be insulting to it. C# was the main language I had in mind in my last sentence though. Outide of work I don't care much for the web
I might look into typescript and coffeescript though.
>>
>>52058647
oh, you have a better language for web backend anon? Let's hear it. I bet this will be good.
>>
>>52058649
1.upto(100) { |num| if num % 3 == 0; puts "fizz"; elsif num % 5 == 0; puts "Buzz" else puts num end;
>>
>>52058703
well, it is the best for web backend by far. Not sure why you're opposed to using it. Don't use coffeescript or typescript for server side, unless you have a very compelling reason to. For example.. you work with a team of mongoloid JS devs you know well will never learn C#.
>>
>>52058626
Here's an example of where it might be useful.
sqrt2 :: Float -> [Float]
sqrt2 x
| x < 0 = []
| x == 0 = [0]
| x > 0 = [sqrt x, negate $ sqrt x]

You could then make a double square root function that still only produces real roots, only composing the original "sqrt2" function with itself.
sqrt2x2 :: Float -> [Float]
sqrt2x2 = sqrt2 >=> sqrt2
-- sqrt2x2 x = sqrt2 x >>= sqrt2

https://www.fpcomplete.com/school/starting-with-haskell/basics-of-haskell/13-the-list-monad

Yes, monads have a category theoretic meaning, but it's not really useful for programming especially at your level. They're basically just a design pattern, which ends up being so ubiquitous that Haskell has special syntax for it (like arrows, but I'm not gonna get into that).
>>
>>52058630
Well, it doesn't really do anything special or unique. It has concurrency focus sure but who cares really. Plus the syntax is deliberately contrarian.
>hey, let's make c
>but reverse the keyword order
>then throw in some python stuff idk I'm rob fuckin pike
>>
File: 2015-12-25-212322_916x868_scrot.png (127 KB, 916x868) Image search: [Google]
2015-12-25-212322_916x868_scrot.png
127 KB, 916x868
who /best syntax/ ?
i vote for pic related
>>
>>52058703
If you want an even better language use F# btw. It's easily the worlds best language. It's just a meme language in the sense that you won't get work using it. But it's great for personal stuff.
>>
Guys.
Guys.
Guys.

https://github.com/Microsoft/visualfsharp/wiki/Code-of-Conduct
>>
>>52058748

What font is that?
>>
>>52058709
>whats nodeJs
>whats Rails
>what Django
>whats JavaEE
>what are tons of web frameworks around and more

>C# best language for web backend

No, C# is just one more option. The fact you think C# is the best language for web backend is just your opnion/personal taste.
>>
>>52058732
>For example.. you work with a team of mongoloid JS devs
Yes.

I don't want to use it because I don't want to develop for the web. Due to certain circumstances I'm stuck with node, or go at work. I suppose go probably isn't that bad really, it just seems to try and be different for differents sake.
C# is always waiting for me at home
>>
>>52058759
>common sense rules
>no SJW bullshit
Based Microsoft devs.
>>
>>52058793
>This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.

>This Code of Conduct applies
>in public spaces when an individual is representing the project or its community.

communism
>>
>>52058771
terminus
>>
>>52058751
I've played around with it. For now I still prefer C#, just because I'm more comfortable with the oop-first paradigm than fp-first. I'm sure overtime that will change as I get better. I do need to learn language that keep me independent of the microsoft stack too. I've been playing around with the idea of rust.
>>
>Ctrl f "C#"
>>
>>52058835
you can do imperative and oop in f#

>rust
lol
>>
>>52058818
Yes, when someone is representing themselves as part of the F# community, then they shouldn't be a fuckwad.

If you're program is simply in F#, those rules do not apply to you.

I take it you didn't do so well with reading comprehension in gradeschool.
>>
>>52058774
>whats nodeJs
>whats Rails

Oh God. Just kill yourself anon. These are literally the worst fucking ones. You're recommending fucking JavaScript and fucking ruby?

>The fact you think C# is the best language for web backend is just your opnion/personal taste.
It's based on the fact that its:
Statically typed
Strongly typed
Fast
Generally very nice to work with
lots of modern language features like lambdas and async/await
Very good tooling
Very mature
Great ecosystem
Strong job prospects

All good things none of those pieces of shit you listed have
>>
>>52058844
C#
(You)
>>
>>52058785
You can get .NET to interoperate with node. Maybe read about that a bit. Maybe you can sneak some C# into work. Then instantly become unfireable as the only C# guy.
>>
>>52058848

How much do Microsoft pay you to shill during the holidays?
>>
>>52058759
>https://github.com/Microsoft/visualfsharp/wiki/Code-of-Conduct

>adapted from an uber-SJW's coc
>have to maintain the privacy of a reporter
>means you can't let the person that was reported or anyone else what the hell happened
>unable to ask for their side of the story or justify any actions taken under the policy

great ideas
>>
>>52058835
F# is far nicer for OOP than C#.
>>
>>52058774
Node isn't scalable, has no actual server functionality without downloading it as packages and is based on one of the ugliest languages of all time.
Rails is literally (compared to c#, java or go) an order of magnitude or more slower. Even compared to python and node it's an average of about 5 times less performant.
Django suffers from similar problems to rails.
Java is pretty good overall (as a platform, not so much as a language) and slightly faster than c#
>>
>>52058865
Alright autist.
Go pretend you're a woman in tech and claim that all the F# maintainers verbally raped you on IRC or something.
>>
>>52058847
Designating people as representatives or making demands of them when they aren't contributing is definitely not a fair thing to do and practically soviet.
>>
>>52058863
€2,000. It is christmas after all. What they pay me doesn't matter though, I'm still correct.
>>
>>52058846
I know. That's why I said fp-first and oop-first.

Rust is interesting. It's a more elegant c++ with some interesting functional paradigms. Of course it's basically useless for jobs
>>
>>52058902
... nothing is preventing you from using F# and not touching fp
>>
>>52058910
Why would I ever do that though.
Why use a language if, not only are you going to write it non-idiomatically, but without it's greatest feature.
>>
>>52058848
Actually Java has hall of these features, the only exception is the features missing. And also, Java is faster, has more libraries, is more open, has better tooling, better profiling, tools for static code analysis (things like checkstyle and findbugs), etc... And JavaEE stuff also has strong job prospect. In my opinion, the ecosystem of Java is better than the C# and .NET general ecosystem. The only great advantage of C# is that it's feature rich.

>You're recommending fucking JavaScript and fucking ruby?

Actually I didn't recommend any of these (altough I like Ruby a lot), just said there are alternatives.
>>
>>52058910
>F# shills are this desperate
kek
>>
>>52058735
List.map (sqrt2 x) sqrt2
does the same thing, though, doesn't it? So where's the win here? How is bind not literally a synonym for apply in the general case and map in the case of collections? How are monads not literally a buzzword that means precisely nothing?
>>
>>52058932
Holy shit why do people keep fucking saying this?
Like extra features subtract

>>52058956
Multi-paradigm master race
>>
>>52058870
And OCaml is far nicer for everything than both.
>>
>>52058970
>Holy shit why do people keep fucking saying this?
>Like extra features subtract
What the fuck are you talking about.
>>
>>52058993
language x has features a and b
you want feature b
>why would I use x, it has extra feature a
>>
>>52058958
It doesn't quite do the same thing, because if you simply map it you end up with a list of lists. Bind is actually defined in terms of mapping and joining, where join "squashes" two layers of monad. For the list monad, that means concatenating all the lists into one. It's just typically easier to define a monad in terms of bind rather than join, although I wish Haskell gave you the choice.

The monad instance for lists isn't really very interesting. Monads aren't really interesting in general, they're just a common pattern that can do a few special things like emulate linearity to allow side effects (IO, for example), and they have syntax.

>How are monads not literally a buzzword that means precisely nothing?
Because they are a construct in category theory, where the same general structure and laws apply. But abstracting these into a type class makes it possible to write generic functions that work with any monad, such as mapM, which is almost like a side-effecting for loop.
>>
>>52059021
That's not even close to what I said you idiot.
Do you not know what idiotmatic is?
>>
Daily reminder that if your language of choice is not on this list you should probably give up and kill yourself:
- C++
- C#
- Lua
- Python
- Elixir
- Haskell
- Bash
- Clojure
- D
>>
>>52058936
>only exception is the features missing
Which is why i left it out.

>And also, Java is faster, has more libraries, is more open
Hardly any faster. It has nothing that tops ASP.NET for maturaty. The CoreCLR is MIT licensed. ASP.NET 5 will launch soon with first class support fo CoreCLR on OS X and Linux. Far more open than the Java offerings.

>has better tooling
Are you kidding? Every Java IDE i've used has been garbage. Always sluggish, bloated and buggy. VS is the best IDE there is by a long shot, especially for C# dev.

>better profiling
Not at all

>tools for static code analysis (things like checkstyle and findbugs)
C# blows the doors off Java for that kind of shit. VS on it's own is good at it, but there's also magic stuff like resharper and tons and static analysis tools.

>the ecosystem of Java is better than the C# and .NET general ecosystem
It's bigger. But the quality does not match what C# offers on the web stack.

>The only great advantage of C# is that it's feature rich.
That's putting it mildly
- working generics
- structs
- async/await
- properties
- easy native interop
and tonnes of other small things that tend to make C# code bases much more concise and more readable.

>Just said there are alternatives.
I asked what would you recommend instead and you listed those you dumb shit. I know they are alternatives. You're either too dumb to know why those are shit or too dumb to read.
>>
What are the most popular anti-SJW, no nonsense repositories on GitHub, /dpt/?
>>
>>52058932
Because OOP code is much nicer in F# than C#.
>>
>>52059061
Let me help fix this list for you, faggot.
- OCaml
- OCaml
-OCaml
- OCaml
- OCaml
- OCaml
- OCaml
- OCaml
- OCaml
FTFY thank me later.
>>
>there are people who unironically enjoy languages whos libraries are compiled to .jars
>>
The only problem with C++ is Windows

http://www.sfml-dev.org/download/sfml/2.3.2/

Not only do we have linking incompatibility between different compilers/toolchains, we have linking incompatibility between different versions of the same compiler/toolchain!

If anyone is curious why most libraries are written in C, this is why.
>>
>>52059070
Nodejs
>>
>>52059077
In what sense exactly.
>>
>>52059061

k
>>
>>52059106
Every sense. I can give you some examples and code comparisons if you like.
>>
Daily reminder for all F# shills
You already have a website
http://fsharpforfunandprofit.com/
>>
>>52059098
No you fucking retard, the problem here is SFML because the lead dev snorted too much paint as a kid. The guy's pants-on-head retarded, he has no fucking clue what he's doing and I'm convinced everything he's done so far has been stolen from other places. Other libraries have no such fucking problem (and actually work unlike shitfacemalware)
>>
>>52059117
We know. Who do you think pays us?
>>
>>52059116
I would like. As I said earlier I;ve dabbled a bit with F# but so far I've been most comfortable in c#
>>
>>52059093
>there are people who don't recognize the awesomeness of JVM
>>
File: 51D1SpobiUL.jpg (39 KB, 406x500) Image search: [Google]
51D1SpobiUL.jpg
39 KB, 406x500
>>52057535
>Are Ocaml and SML better?
most Ocaml and SML books are fairly difficult and not really beginners books. The only good beginners Ocaml book Ive found is pic related
>>
>>52059171
>top tier programming
>incredible power
>amazing JIT

>used for Java
WHAT THE FUCK ORACLE
>>
>>52059150
make a Point class in C#:
class Point {
public int x
public int y
public void Point(int _x, int _y) {
x = _x;
y = _y;
}
}


same thing in F#
type Point(x, y) =
member var x = x
member var y = y

though this is immutable, it's a little more work to make mutable but not much. But you get an idea of how much cleaner, readable and concise this is. C# is full of redundancy and opportunity for mistakes. F# is nice short and declarative, yet compiles to pretty much the same thing.

You can do inheritance and everything else in. F# too, you just need to look up what you need to do. Everything ends up nicer.
>>
>>52059171
The JVM is the reasons Java and all other JVM languages suck shit. The CLR is basically the JVM with all the broken shit fixed.
>>
>>52059234
keep in mind that is not some mental F# version of a class, that class is the same as the C# one, and can be used from C# projects.
>>
>>52059211
>WHAT THE FUCK ORACLE

What? JVM was made for Java since its begining (hence the name). These improvements were aimed to increase the adoption of the language and other languages on JVM, what the fuck, anon.
>>
>>52059172
Real World OCaml is pretty good too. The module system is the hardest part for obvious reasons, other than that I'd say it's pretty beginner-friendly.
>>
>>52059277
All that fucking wasted quality
>>
>>52059234
So syntatic sugar? No thanks.
>>
>>52059171
>no TCO
It sucks balls.
>>
>>52059324
Not syntactic sugar. The semantics of F# are wholly different from those of C#, but they use the same backend (.NET) so interop between the two languages is simple.
>>
>>52059324
Might as well write directly in IL then. C# is just syntactic sugar for it.
>>
>>52059324
real programmers use assembly. C is just syntax sugar
>>
>>52059365
If you use a non-optimizing C compiler, probably.
Have you seen the massive amounts of optimization GCC performs?
The code you write has very little to do with the assembly GCC spits out, especially on the higher optimization flags.
>>
File: danger-noodle.png (1 MB, 960x540) Image search: [Google]
danger-noodle.png
1 MB, 960x540
Making a steganography tool for PNG files, there's a pre-release in the releases and a guide in the wiki.

https://github.com/AlphaDelta/PNG-Mask
>>
Is F# a relatively new thing?

I haven't been in /dpt/ for awhile and I haven't heard of it before tbqh.
>>
>>52059234
I asummed byt "better" you meant actualy paradigm changes, but what you showcased is the exact same oop, just in the more compact format of f#. Not that that's a bad thing but it's misleading to say the least. By all accounts the only difference between them is mutability and the constructor being part of the declaration. There's no fundmental difference in the interpretation of how oop is supported (like, say, how swifts oop is quite different to python)
>>
>>52059406
optimizations will only do so much. people have put a lot of work in to compilers but they still don't achieve anywhere near their potential.
even with the highest optimization level C will run 10x slower than hand written assembly
>>
not exactly sure if i'm in the right place, but how do i get better at python?
I took an intro course at Uni and i'm simply looking to improve.
not sure if i'm in the right place, but anything is helpful.
>>
>>52059475
You're genuinely irreparably retarded if you actually think that. There are a minuscule number of cases that by necessity what you just said wasn't the most moronic thing in this thread so far. And even those aren't about speed
Thread replies: 255
Thread images: 19

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.