/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

github.com/golang/go/wiki/FromXToGo
tour.golang.org
golang-book.com
github.com/ricochet-im/ricochet
twitter.com/NSFWRedditImage

>Why OCaml
I thought this quote was about Go

I'm CODING a new React+Mobx frontend for my APP

Based Mr. Pike

Interesting that Google's answer to Swift i.e. Kotlin wasn't made by Google itself

So are people in general just bad programmers?

yes

People Google hire, yes

>Googlers
>not capable of understanding a brilliant language
Really boggles the noggin

started working on pic related for my python class

kek

Well doesn't that kind of apply to ocaml as well?
In ocaml you can't even plus two numbers unless they are the same type, int + int, float +. float.

>python class

>A class for a language
>that entire screenshot

There are schools out there that actually teach Python? Talk about dereliction of duty.

Yes, but in line with the OP it's fashionable on the Internet to pretend otherwise by using some over-engineered FP shite to write your fizzbuzz programs.

What's the matter? Are maps, filters, and folds too complicated for you?

>hurr durr these small details about the syntax put me off
"elite" programmers indeed

>Well doesn't that kind of apply to ocaml as well?
No, it doesn't.

>In ocaml you can't even plus two numbers unless they are the same type, int + int, float +. float.
Trying to equate this with not having generics is just silly.

Hey boyyyyyyys ;)

Um, can you finish this assignment for me? I know a big, strong programmer like yourself can handle it.

public static boolean is_odd(int n) {
//Code here
}

public static boolean is_odd(int n) {
return true;
}

>Trying to equate this with not having generics is just silly.
but that's the example people always give to justify generics
are you retarded or simply trolling?

Not any more complicated than a for loop, but more importantly the languages that feature them prominently are all either slow, lazy, dynamically typed, or bad at concurrency and go is a better choice in the general case.

No it's not. It's the example people give to try to justify ad-hoc polymorphism, not parametric polymorphism.

What math should I know if I want to become a 1337 programmer?

>(please use the or operator)

Basic middle school algebra. Anyone who says otherwise is lying

>Go
>Not dynamically typed

in that quote, Pike is saying that Go is the brilliant language, because of its simplicity and because it allows programmers to be productive and not care about retarded details
watch the original presentation...
you misread it, that says more about you than about Go or Pike..


just learn Go

>Go
>Not not dynamically typed

I'm not misreading it. You're just desperately trying to twist it. Your attempt doesn't make sense. If Go is a "brilliant language", then he's saying Googlers aren't capable of understanding it. That would defeat the very purpose of creating it.

public static boolean is_odd(int n) {
return ((int )(Math.random() * 2) == 1);
}

Should work 50% of the time

public static boolean is_odd(int n) {
return !is_even(n);
}

Go will never have a real type system. Python users love it because it's familiar.

It has a type system.

You forgot the other half.

>public static boolean is_even(int n) {
return !is_odd(n);
}

>Giving different results for the same input variable
Absolutely disgusting

referential transparency is just another word for useless

gtfo functionalfag, this is real stateful programming

>misreading
watch the original video. he argues that simplicity

>Your attempt doesn't make sense
says the one that took the pic from some random video titled "Why OCaml", lol

>he's saying Googlers aren't capable of understanding it
understanding a lang != learning it. you don't have to know how compilers work, what they do, etc.

OH MY GOOOOD

>Should work 50% of the time
nice

according to maths, calling the function twice yields the correct result

can someone please explain the weight sliding function in backpropogation to me in plain english? ive only got a single neuron learning system but it uses a sigmoid function.

>understanding a lang != learning it
This sounds like cargo-cult programming, which is rightly derided by the vast majority of highly-skilled programmers.

>you don't have to know how compilers work, what they do, etc.
Yes you do. You can't hope to write good, performant code if you don't have an understanding of what the compiler does with it. Are you saying there are programmers out there who don't know how compilers work?

>watch the original video. he argues that simplicity
Unless he's speaking a hitherto unknown dialect of English in which certain words mean their opposites, then he might be arguing that Go is simplistic, but certainly not that it's brilliant.

t. butthurt golang code monkey

kek

if the language is simple and makes things obvious, you don't have to mess with the compiler/linker

but anyway, why am I arguing with you, you are set against Go, and IIRC, you don't even want to try it
here, go read some of these, perhaps they will convince you that learning Go won't harm you, and may indeed be a good thing, at least if you want to be productive and learn a new point of view:
github.com/golang/go/wiki/FromXToGo

I'm not the butthurt one here, m8

So does JavaScript.

Why haven't you learned Go yet?
github.com/golang/go/wiki/FromXToGo

Start here:
tour.golang.org
golang-book.com

Yes, and? What does that have to do with Go not being dynamically typed?

>if the language is simple
If the language is simple, you can't write good code with it.

>but anyway, why am I arguing with you, you are set against Go, and IIRC, you don't even want to try it
Many great programmers have sacrificed their sanity trying Go so that I don't have to.

>here, go read some of these, perhaps they will convince you that learning Go won't harm you, and may indeed be a good thing, at least if you want to be productive and learn a new point of view:
I don't need to try out a lobotomy or cutting off my fingers to convince myself that those things wouldn't make me more productive.

No amount of nitpicking will make Go a good language.

sorry to ask the dumbest question, but...

If i'm to start making a video game using unity, is the majority of my coding going to be setting up physics for the game itself? Isn't that provided by the engine already?

>I won't learn a simple, easy to learn language because I have my own prejudices against it, based on opinions stated by "elite" programmers

>If the language is simple, you can't write good code with it.

Oh wow. This board finds new ways to crack me up everyday.

A bit more correct version.
public static boolean is_odd(int n) {
boolean even = true;
for (int number = -2147483648; number < 2147483647; number++) {
if (n == number) {
break;
}
if (even == true) {
even = false;
} else if (even == false){
even = true;
}
}
return even == false;
}

public static boolean is_even(int n) {
boolean odd = false;
for (int number = -2147483648; number < 2147483647; number++) {
if (n == number) {
break;
}
if (odd == false) {
odd = true;
} else if ( odd == true){
odd = false;
}
}
return odd != true;
}

Also added the is_even function

I don't want a purportedly simple and easy-to-learn language because it's useless. No good code has *ever* been written in Go. None.

Which is better? Procedural programming or OOP?

absolute madman

OOP > Functional > Procedural > POOP

What is POOP?

Java "OOP".

Indian oop

Faeces

Why is there no national programmers' association, union, or guild? The current situation allows corporations to run roughshod over programmers, and drive down wages by flooding the market with cheap unskilled labor.

These seem more like programming philosophies than anything, does poop stand for Procedural OOP?

im sure a lot of programmers are in guilds

the quote isn't even about go

because programmers are mostly classical liberals that believe in free market principles

Liberals are worthless pieces of fucking shit.

Even when they're getting screwed by it?

How does it make you feel to realize that slide is about OCAML?

because there's no use for that language

Because unions are Jewish.

yes it's a sacrifice to uphold principles

Wow you're a retard

Are you retarded? Oh, you're a Go fan, of course you are.

So the quote is saying C++ and Java aren't brilliant languages either? I agree.

Anyone who has ever used Go would agree with Pike that it's truly brilliant.

(The fact that people get offended by this just shows how good of a language Go really is) .

not him and also not a go fan but that slide is about ocaml friendo it says so right on the slide

>What are you working on, Sup Forums?
On homework.

Adding a 'VIP'-Feature to ricochet
github.com/ricochet-im/ricochet

Contacts should optionally be marked as a VIP and every conversation with a VIP should be locally logged.

Please do it for me /geee/, I am too fucking tired

>Anyone who has ever used Go would agree with Pike that it's truly brilliant.
It's brilliantly, fantastically shit. It's like Pike went to sleep in 1970, woke up a few years ago and decided to design a new language.

Are you completely dense? The video is of a talk given by some guy arguing that you should use OCaml. The slide in question is questioning the attitude of Rob Pike and Go, that you should make the language as stupid as possible so that even the dumbest programmer can use it.

anyone?

Java isn't brilliant by any means. On the other hand, the JVM and the huge ecosystem of tools, libraries and resources are brilliant, and that's what matters when you're creating software.

>Go makes him feel so insecure that he has to spend day and night posting anti-Go comments
WELP

My theory is that only bad programmers hate go. They feel threatened by it. If you notice it's mostly C++ and Java programmers who hate it. That's because Go is quickly catching up to Java and C++ in performance and development in Go is probably 10 times faster than in those languages. Go code bases are also much easier to digest and understand then Java or C++. Most Java and C++ programmers barely know their language anyway and don't want to have to learn a new one.

Yes, Spring is brilliant, a shining example of a good library/framework, gotta have those AbstractSingletonFactoryProxyMethodInvokingBean

I was hoping for a second that was some opensource version of ricochet but I see its just a gay chat client.

How can Go codebases be easier to digest and understand when the code in them is 10 times longer than it would be in most other contemporary languages because the language supports no reasonable means of abstraction?

You've never used or studied Go have you?

>huge ecosystem of tools, libraries and resources

The Go creators had this in mind when designing the language, unlike the creators of Java/JVM.

Go is designed from the ground up for proper tooling. Java is literally designed to be used in IDEs.

>he thinks longer code make it difficult
>he thinks Go really needs a lot of typing
and here's how we learned you don't even program
protip: programming involves lots of abstractions, specially using abstractions written by someone else...

that is actually sad
especially seeing how the people i see that want to study "c++"
they are wholly incapable to use their brain
they are unable to read the documentation
they are unable to use a general syntax without someone providing them an absolutely explicit example of its usage
their work ethic looks like this
look at problem
google problem
copy paste shit until it kinda somehow maybe possibly with brainfuckery compiles
present it to the poor guy who has to check it
continue to have him explain how and why the shit they provide is wrong and bad
forgot everything you learned in the lectures and when the guy tried to explain
rinse repeat

i hate the scum i am around

Post evidence that Go has large codebases compared to other languages (you wont).

Most Go codebases are very small imo, but size isn't what matters (you would know that if you were an actual programmer).

Java codebases are filled with tons of generated code, mile long class hierarchies, and indentation as thick as my neck.

Go is more digestible because of strict adherence to idioms and vetting tools packaged with the language. Java and C++ are rarely ever idiomatic because they don't have standard idioms or proper tools to make the code uniform and consistent (even when you use an IDE).

A Go program will look read the same no matter who it was written by if they adhere to the standards and idioms set forth by the language (and Go is packaged with tools that help them do that).

Go is the most digestible language ever conceived. Objectively.

t. C programmer

meant for

arguments for:
>gratis, free license
>most advanced application framework in history
>successfully used in enterprise software that makes the world turn
>ridiculous number of resources to learn from available
>runs on the JVM

arguments against:
>some internal classes have long names

yep

I never used it because it literally does not have any uses. It has superior competition in every niche its supposed to fill.

>longer code is always harder to understand
longer code can mean more verbosity and therefore easier understanding. the less magic, the less previous knowledge needed to understand the code.
unless of course the code is long because of technicalities like manual memory management.

>>successfully used in enterprise software that makes the world turn
>>ridiculous number of resources to learn from available
popularity is not an argument
and the java docs suck IMO

Go is mostly in the C family (basic syntax), with significant input from the Pascal/Modula/Oberon family (declarations, packages), plus some ideas from languages inspired by Tony Hoare's CSP, such as Newsqueak and Limbo (concurrency). However, it is a new language across the board. In every respect the language was designed by thinking about what programmers do and how to make programming more effective.

Go attempts to reduce the amount of typing in both senses of the word. Throughout its design, we have tried to reduce clutter and complexity. There are no forward declarations and no header files; everything is declared exactly once. Initialization is expressive, automatic, and easy to use. Syntax is clean and light on keywords. Stuttering (foo.Foo* myFoo = new(foo.Foo)) is reduced by simple type derivation using the := declare-and-initialize construct. And perhaps most radically, there is no type hierarchy: types just are, they don't have to announce their relationships. These simplifications allow Go to be expressive yet comprehensible without sacrificing, well, sophistication.

Another important principle is to keep the concepts orthogonal. Methods can be implemented for any type; structures represent data while interfaces represent abstraction; and so on. Orthogonality makes it easier to understand what happens when things combine.

Go was born out of frustration with existing languages and environments for systems programming. Programming had become too difficult and the choice of languages was partly to blame. One had to choose either efficient compilation, efficient execution, or ease of programming; all three were not available in the same mainstream language. Programmers who could were choosing ease over safety and efficiency by moving to dynamically typed languages such as Python and JavaScript rather than C++ or, to a lesser extent, Java.

Go is an attempt to combine the ease of programming of an interpreted, dynamically typed language with the efficiency and safety of a statically typed, compiled language. It also aims to be modern, with support for networked and multicore computing. Finally, working with Go is intended to be fast: it should take at most a few seconds to build a large executable on a single computer. To meet these goals required addressing a number of linguistic issues: an expressive but lightweight type system; concurrency and garbage collection; rigid dependency specification; and so on. These cannot be addressed well by libraries or tools; a new language was called for.

No major systems language has emerged in over a decade, but over that time the computing landscape has changed tremendously. There are several trends:

Computers are enormously quicker but software development is not faster.
Dependency management is a big part of software development today but the “header files” of languages in the C tradition are antithetical to clean dependency analysis—and fast compilation.
There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript.
Some fundamental concepts such as garbage collection and parallel computation are not well supported by popular systems languages.
The emergence of multicore computers has generated worry and confusion.

We believe it's worth trying again with a new language, a concurrent, garbage-collected language with fast compilation. Regarding the points above:

It is possible to compile a large Go program in a few seconds on a single computer.
Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.
Go's type system has no hierarchy, so no time is spent defining the relationships between types. Also, although Go has static types the language attempts to make types feel lighter weight than in typical OO languages.
Go is fully garbage-collected and provides fundamental support for concurrent execution and communication.
By its design, Go proposes an approach for the construction of system software on multicore machines.

how ironic, a whole anti-Go post as a new /dpt/ thread managed to make it pro-Go

> It has superior competition in every niche its supposed to fill.

Not in network programming, which is it main niche. Once again you prove you don't know anything about programming and everyone should ignore your posts.

I still don't understand functional programming. Can someone help?

>It is possible to compile a large Go program in a few seconds on a single computer.
This means that the compiler is doing very little work. This means that you, the programmer, are doing the work that the compiler should be doing.

What's your programming background?

Pure functional programming and functional elements in multi-paradigm languages are quite different.