Not really. It's actually kind of funny that a .NET programmer said that because Java and C# occupy many of the same niches, which is to say, heavy enterprise-y apps. But then that may be his point, that it would be redundant for him to learn a language so similar.
Java isn't a bad decision but I 100% believe you should try as many languages as possible, especially from different paradigms. Every language has something to like and most have something you can bring back to your primary language to be more productive.
Java is currently unfashionable, and is popularly associated with enterprise architecture astronauts who add too many layers of abstraction to everything.
It's about as good as any other language, and has more libraries than most. It's also mildly annoying to work with, but so is any language when used as more than a toy.
You can do the same kind of project and get the same kind of job with .Net or Java. It really doesn't add much to your toolbox, although picking up one after you know the other doesn't take much time.
It's not necessarily a bad decision. Many people would say it's a practical one. However, it limits your thoughts about programming to one very narrow style, and not a particularly good one. There are many other styles of programming that are worth learning (functional being likely the most notable of them), and that will make you a better programmer regardless of what language you end up writing in day-to-day.
It's not a "bad" decision if you focus on Android development or you are working for a big company with Java infrastructure (that pay's my bills :).
How ever, as they say: "don't keep all your eggs in just one basket".
Learn other languages and frameworks like PHP/Yii, Python/Django or Ruby/Ruby On Rails.
And code for different platforms (iOS, Windows Phone) if you have the time ;)
Haskell looks very interesting but I can't help but ask 'why do I need it?'. Currently I am learning Java since I want to get a jr.developer job later on and Ruby for some scripting and personal projects(maybe even Rails later). So Java is used in industry, Ruby is used in web and metasploit/ronin (something that I like to mess with), but what about Haskell? I am genuinely curious what Haskell can offer. I always see it mentioned on Reddit but I have yet to come across any notable project written with it. Could somebody with experience give me some reasons for me to learn it?
You don't need it. If you are a Junior developer (or aiming at being one) Haskell is a language you most definitely don't need.
Now, once you have your feet wet, it's worth learning. Here's why:
- Pure(mostly) functional language. This is in opposition to Java & Ruby, which while having functional aspects are OO (Object Oriented).
- It's okay not to know what a functional language is. It's making functions first-class citizens, such that a function becomes a value like any other.
- Separates IO from computation. IO is inherently impure and unreliable, so functions are generally pure and instead wrap IO in containers. Obviously, programs would be less useful (still use in the compiler running!) without IO.
- All of these concepts (and more) will change how you think about programming and make you a better programmer in all languages.
Haskell can be found in some backend stacks, the more notable examples I can think of are Mailrank (acquihired by Facebook) and Bump.
Personally, I've only done a limited number of projects with Haskell (a Postgres-backed beer API & IRC bot) but I've grown to respect it as a language and through limited exposure has made me love FP.
Functional programming is really more than first-class functions. A lot of languages have support for first-class functions (including Ruby's procs) that are not really functional languages. Functional (like all paradigms) is a bit nebulous, but to really be a functional language I would expect to see immutability as a default assumption, and I would expect to see only expressions, no statements. That latter expectation is really what gives functional programming its distinctive style. When everything returns a value, chaining together functions as transformations on data simply becomes the natural way to program.
To amplify what another has said, the emphasis of functional programming is side-effect-free code, where the default assumption is that functions don't have side effects, and so can be treated as components in a pipeline that modifies data step-by-step from its initial input state to its final output state.
Ideally, these components are composable and reusable, both to facilitate reasoning about the code and code reuse. The Haskell Standard Prelude is a fantastic example of this working out well.
Basically, it's based on the idea that the functions which are easiest to reason about are those with one well-defined input and one well-defined output which is completely determined by that input. You can't always have this, but functional languages attempt to get you as close as possible. The simplicity of pipeline-style programming is one of the happy little dividends of this kind of thinking.
From the perspective of "learn other languages to broaden your horizons":
Haskell is worth learning because it has an expressive, strong, static type system. Most other languages do not have that property (Java's type system is static, give or take null, and strong, but not expressive, and Ruby's is strong but neither expressive nor static). The Haskell type system lets you have conversations with the compiler about what your program should do.
You can declare a state type, and have the compiler tell you if you switch on the state and forget to handle one of the possible states (or if you add a state later and forget to update all the switches).
You can tell the compiler "I think this function is a generally useful utility function that I plan to extract out of this project and use elsewhere", and it will tell you whether there's some dependency on your project that you missed.
You can specify in a function's type "this function should have access to the database"; then the compiler can tell you if you're trying to access the database somewhere you didn't expect to. (A colleague has just spent a person-year of effort refactoring a Django web app, because all the database calls were happening in the view code, and they needed to abstract them out to scale.)
Of course there are ways to do some of those things in other languages, and of course there are also downsides to the static type system. But those sorts of abilities open up new programming techniques (even in languages with poorer type systems), and have shown me ways programming can be better.
Why makes you say that Ruby's type system is not expressive? I'm not exactly sure what that means. I've heard of a language being called expressive, but not a type system.
By the way, does Haskell's type system have the "value restriction" that you run into in ML?
>I've heard of a language being called expressive, but not a type system.
Haskell's type system is practically a language itself. It has many powerful features that aid with expression:
* sum, product and generalized algebraic data types (GADTs)
* higher-kinded types
* universally & existentially quantified types
* scoped type variables
* impredicative types
* associated types
* type families
* kind polymorphism (a new feature)
* type holes (also new)
>By the way, does Haskell's type system have the "value restriction" that you run into in ML?
I'm not sure what you mean by "value restriction". Haskell, like ML, is not a dependently typed programming language. For that you'll want to use something like Agda. As for why you'd want a language to not have dependent types? Well, having them introduces all kinds of considerations with regards to decidability and type inference.
The value restriction is a rule that governs when type inference is allowed to polymorphically generalize a value declaration. In short, the value restriction says that generalization can only occur if the right-hand side of an expression is syntactically a value. [...] The value restriction prevents a ref cell (or an array) from holding values of different types, which would allow a value of one type to be cast to another and hence would break type safety
It can be annoying to work around this, because there are potentially ML programs that would be type-safe and would otherwise compile if they were not hindered by the value restriction.
I got my answer, though:
Ii is interesting that in ML, the presence of mutable ref cells and parametric polymorphism requires the whole language to be dominated by a "value restriction" [1] to ensure that the type system remains sound, whereas in Haskell, because IORef's can only be created (and used) in
the IO monad, no such restriction is necessary.
Ahh, thank you. This was very informative. I have no experience with ML. I thought you might have been referring to the mixing of values and types which occurs in dependently typed programming.
There are two very different types of arguments typically made as to why to learn the more esoteric languages (Haskell, Lisp, Forth, others).
The first is the more common: learning these languages exposes you to other ways of programming, which in turn makes you a better programmer no matter what language you're programming in. This is unquestionably true. Mainstream languages are constantly learning new things from these languages, which means you will be able to apply the techniques you learn from them to your code no matter what language you write in. I have the misfortune[1] of writing a lot of PHP at my day job, but it turns out even PHP has support for filter and map over arrays. If I hadn't learned functional programming, I would never have even looked for them.
The other argument, which is made less often, is that you can actually write great software in these languages. This argument is made less often because we can obviously look at the market and the TIOBE index and see that Haskell is way down at #30 with 0.323% of the market share. However, there are really great programs made in Haskell (xmonad, for one). There are also tons of great programs made in Lisps, especially Clojure of late. So, this second argument is not entirely a dead end either.
Revisiting something I mentioned in the first argument for a moment though, I would actually make a third argument that I rarely see. As I said, other languages are constantly learning new things from these languages. Haskell's community is full of PhDs studying at the intersection of programming and mathematics, and they are discovering the things that will revolutionize programming in the future. Haskell, for example, has been exploring strong static typing with algebraic datatypes[2], Hindley-Milner type inference, and typeclasses to support higher-kinded polymorphism[3]. Those concepts are turning out to be incredibly powerful, and you will inevitably see them in other programming languages in the future. We've seen this before with Lisp (garbage collection, recursion, first-class functions), and there's no reason not to expect the trend to continue.
So, why learn Haskell? It's the easiest way to see what tools you'll have available to you in industry 20 years from now when the other languages catch up.
> The other argument, which is made less often, is that you can actually write great software in these languages.
It's probably worth mentioning that Jane Street writes all their trading infrastructure these days in OCaml. They're probably one of the biggest industrial users of a functional language.
There's also Tsuru Capital, a trading firm of lesser note than Jane Street, which almost exclusively uses Haskell.
If you want to look at an interesting functional language that has some very solid real world uses, have a look at Erlang, and its own "Learn you ..." here:
Which is a fantastic book, clearly written as a labor of love.
Erlang doesn't have Haskell's type system and doesn't seem to be of much interest for CS research types, but it's awesome for developing certain kinds of system.
I am curious about Haskell myself, and don't tend to need a lot of excuses to learn a language, but I don't perceive a "sweet spot" for it just yet, as in "I could go build X, and Haskell would be a great fit for it". Given how many smart people use it, I'm sure there are a lot of applications for it, but I also get a feeling that there's not one thing that really stands out.
One thing that I love to do in Haskell, and which Haskell is especially suited to, is writing interpreters and parsers. The other week I wrote a brainfuck interpreter (https://github.com/imeckler/skellfuck) in a couple of hours. Parsec, along with monads and functors, make this kind of thing a real joy to write.
That still seems like something of a second order problem in that you're solving your own problem that you might need in order to solve a customer's problem.
It's a tiny detail but learning some functional ways of thinking gives you great alternatives to for/foreach loops when dealing with large lists/arrays/hashtables of data, even in other languages like Ruby or Java.
For the same reasons you need any programming language—to write useful software in!
> Currently I am learning Java…and Ruby
These are both good ideas. Java is widely used, reliable, and well tested for developing large applications. Ruby is simply a lot of fun to use, and one of the things you’ll discover while using Ruby is that it places a lot of functional programming idioms in an object-oriented context.
The issue with many popular languages is that they fall into much the same paradigm, namely imperative and either procedural or object-oriented, with some functional features borrowed for working with lists. It’s worthwhile to see that not all languages are like this, and learning a new language is not just about new syntax and APIs.
> but what about Haskell? I am genuinely curious what Haskell can offer.
Haskell will teach you to think about structuring your program in terms of simple data and transformations on that data. Object-oriented programming is about coupling data with behaviour, whereas a big part of learning Haskell is learning how to recognise high-level patterns in data structures and functions separately. In doing so, you can avoid the work of reimplementing common operations yourself.
You begin to say, oh, this is a data structure I can map a function over; I’d better make it an instance of Functor. And hey, I could use this data structure to represent this kind of computation, maybe it should be an Applicative and a Monad so I get some nice syntax for dealing with it. This function has a type signature that looks an awful lot like that other type signature—I wonder if I could implement one in terms of the other? And so on.
The type system and succinct syntax also make it very easy to create new data types, and you learn how this can help avoid bugs—don’t use a Boolean here, use an enumeration with two values; then you can’t mess up. Java discourages this by requiring more syntactic effort to create a new datatype.
A useful and oft-cited example of this is in the context of web frameworks: if you have separate data types for strings and HTML, that one simple thing eliminates a whole class of injection attacks. If you represent your links in the type system, then you can statically ensure that your site does not have any broken links. Simply put, quite a lot of bad things can be caught at compile time if you have a type system expressive enough to talk about them.
> I have yet to come across any notable project written with it.
There are more notable projects out there, but here’s my self-promotion. At my old job[1] I maintained a compiler for ActionScript 3 in Haskell, as well as a build system that coordinated the compiler and other build tools to convert Flash games to iOS and Android applications.
Haskell is excellent at manipulating data structures—if that sounds ridiculously general, that’s because it is. The compiler is very nearly feature complete and, even with a certain amount of technical debt, was an order of magnitude smaller and easier to refactor than it would have been in an imperative language.
So there you go. From a recovering professional Haskeller, why you should learn Haskell. And, for that matter, the answer to “should I learn this language?” is always “yes”; but some languages should be higher on your list than others. ;)
Haskell can offer absolutely nothing Java can offer, while Haskell can't offer even 0.001% of what Java offers.
You see, there's a very, very good reason why you won't see any (even remotely) serious and useful software made in Haskell and why you won't see it used by companies (which means that jobs are literally extremely close to zero)
Haskell is nothing more than an exercise of constructing a language based on certain mathematical concepts, mainly abstract stuff like category theory.
As a result it as cryptic, hard to understand and useless in practice as those theoretical concepts (though the theoretical stuff might serve as basis for some other stuff that might be useful - not so with functional languages and especially Haskell)
What to Submit
On-Topic: Anything that good hackers would find interesting. That includes more than hacking and startups.
If you had to reduce it to a sentence, the answer might be: anything that gratifies one's intellectual curiosity.
This isn't really a unique story. Understand that it sucks to be treated like that but the same can be said about women dominant workplaces. Sexism and not being taken seriously can be found everywhere. I've been called "sweetie", "honey" with a demeaning tone on daily basis, I've heard about fucking so and so and drama that goes with it, my opinion was dismissed and I was left out from the "club" more times than I care to remember and females usually got better treatment simply by being a female countless time.
I'm amazed that you can also experience painful discrimination and conclude that nobody should notice that.
Isn't a better response to say that discrimination sucks, and that we should work to end it everywhere?
As a guy in tech, I have it good. But I have never forgotten how, back in the day, being a nerd among normal people sucked. That is part of why I work to end sexism in tech.
We all have different goals and limited amount of time. I will speak up in the case of injustice if it arises but it's not my duty to fight sexism, end world hunger, fight for peace or adopt Nigerian children.
As a guy, I think it is my duty to fight sexism, because I have benefited from it.
But even given what you say, it doesn't match with your earlier point. Saying that sexism isn't news is to suggest that not only do you not want to talk about it, but that we shouldn't either.
Consider a historical example: doctors. Originally it was an all-male profession. Now it's open to women. Did men benefit from that restriction? Sure. Lower supply would mean higher prices. Cutting out half the potential doctors means that a given amount of talent takes you higher in the professional ranks.
Is that abuse? I'd say no. Is it sexist? Darned tootin'.
Now look at the systemic issues that keep women out of tech. All of those gender-related paper cuts. Did I experience any of those because I was a guy? Nope. Was I at any point encouraged to go into tech because it better fit social stereotypes? Probably. Did it help that my dad was a programmer at a time when the field was even more dude-heavy? Definitely. Has the reduced supply driven up wages and decreased competition at a time of fantastic demand? You bet.
I have benefited from sexism. I don't like that, and aim to stop it.
For reference, I deleted a comment which said, "Personally I believe nobody benefits from abuse, because it is not a zero-sum game." or something very close to that.
For me sexism implies discrimination, and discrimination implies abuse. But it's kind of a side topic, so I'll try to stick to sexism.
The reason I think nobody benefits from sexism is that I don't look at it as simply man vs. woman. The healthiest situation is where a man and woman have a balanced relationship with each other. If a man takes some of the woman's power (by abusing his own), that relationship is weakened. Thus, although he may have more power, he actually loses overall because the cost of his imbalanced relationship with her more than offsets the gain in power. That's all I mean. Extrapolate from this as much as you like, ultimately I believe that relationships are what matter.
This actually has happened to me before and I dismissed the same reasoning because it was not verifiable. I've convinced myself that it's just selective memory and coincidence. I am really not sure what to make of all this since I stumbled upon your post.