Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×

Comment Re:pointless (Score 1) 434

Need to fix some things because of the use of brackets You only have generics of the first kind in C#, so implemented things like monad transformers become difficult. A higher order generic can box an inner generic. Say if you had something like with the higher order generic boxing in the inner generic. That's not possible in C# and in F#. new Foo<G, A> { G<A> member = new G<A>(); } A more concrete example of a .NET class that would be G : System.Collection.Generics.List such that G<A> : System.Collection.Generics.List<A>. But you can't pass G around freely and then box it in later. You can only have G an instance of A so new Foo<System.Collections.Generics.List, A> { System.Collections.Generics.List<A> member = new System.Collections.Generics.List<A>() } is not possible.

Comment Re:pointless (Score 1) 434

Well, to be fair, generics are also poorly implemented in C#. If scala can use higher order generics like Haskell can, there's no reason why C# and Java shouldn't be able to.

I'm curious. C# avoided the stupid type-erasure mistake (one that has come back to bite Java, *especially* during the Lambda-J discussions). C# has define-site variance as opposed to use-site variance. What exactly is your problem with C# generics?

You only have generics of the first kind in C#, so implemented things like monad transformers become difficult. A higher order generic can box an inner generic. Say if you had something like with the higher order generic boxing in the inner generic. That's not possible in C# and in F#. new Foo { G member = new G(); } A more concrete example of a .NET class that would be G : System.Collection.Generics.List such that G : System.Collection.Generics.List. But you can't pass G around freely and then box it in later. You can only have G an instance of A so new Foo { System.Collections.Generics.List member = new System.Collections.Generics.List() } is not possible.

Comment Re:Formula for success (Score 1) 264

This is what happened during the construction of the Canadian Pacific Railway. Politicians and other speculators would by up land on the pathway to the CPR and ask the CPR for inflated prices when the CPR would build the railway. Of course some speculators got shafted when the CPR chose to redirect their railway away from the speculators' land.

Comment Re:Monads! (Score 1) 536

You've got me interested... but how does it work?

I hate to be the lazy bum, but since it is your made-up notation would you mind adding in the return value checks and pseudo-code for handler calls to allow some better understanding? Feel free to add pseudo-annotations if that helps your cause 8)

Thank you for bringing this up! This topic has certainly engaged me more than any other on slashdot in a few months 8)

Here's a quick example of a monad. It's something that wraps a value where the value can be freely generic while the rest of the type is not.
So let's use the Option monad in scala. It has two important functions called map and flatMap (map and bind in Haskell). All monads have these properties.
If I have val a0 = Some(25); val a1 = None;
map has a type signature of def map[Q, B](f: A => B): Option[B]
flatMap has a type signature of def flatMap[Q, B](f: A => Option[B]): Option[B]
a0.map((b: Int) => b + 5) would become Some(30)
a0.map((b: Int) => b + 5).map((c: Int) => c - 10) would become Some(20)
a1.map((b: Int) => b + 5) would become None
a1.map((b: Int) => b + 5).map((c: Int) => c - 10) would become None
a0.flatMap((b: Int) => Some(b + 5)) would become Some(25)
a0.flatMap((b: Int) => Some(b + 5)).flatMap((c: Int) => Some(c - 10)) would become Some(20)
a0.flatMap((b: Int) => None) would become None
a0.flatMap((b: Int) => None).flatMap((c: Int) => Some(c - 10)) would become None
a1.flatMap is always None
There's other monads that also wrap a value. The Promise monad wraps the result of an asynchronous computation so that the maps and flatMaps are chained asynchronously. The Error monad is the useful monad. Instead of having a Java function return a value through the return type or an exception through the throws clause, both return and exception values could be returned through the return type. The error monad is most similar to the option monad, which is called the anonymous exception sometimes. But the error monad doesn't have a zero so it's not quite the same as the option monad with zero of None, or the List monad with the zero of empty list.
Every List is a monad as it's a structure that wraps a generic value. The value just happens to be indeterminate.
Monads are just a way to chain events sequentially without having to deal with the background implementations of the structure we're dealing with.

Comment Re:The Department of Redundancy Department (Score 1) 628

Can we study the same things in other departments without having a dedicated Computer Science niche to go with Computer Engineering, Software Engineering, etc.?

Not in sufficient depth, at least in my opinion. Complexity theory? Database theory (yes, theory, not just "here's how to write a simple SQL statement)? Compilers? These could all be in other departments, but an undergrad pursuing a degree in another field will not have enough time to study computer science in any respectable depth. Double major is not the answer if CS is spread over more than two other departments. Spreading CS across math and engineering departments deprives students of the chance to become computer scientists.

I'd like specifics. Which department should handle a compiler? Compilers bring in regular expressions for the syntax, create a parse tree for the semantics, and transform that parse tree into an intermediate pseudo assembly translation and then into the native machine code. I wouldn't trust mathematicians to understand the coding work, I wouldn't trust engineers with the coding work either. Which department should handle database courses? Entity relations, foreign key maps, many-to-many relationship tables, object relational mappers, triggers, and authorization schemas are something that most business departments don't have the technical ability to deal with. A business major acquaintance struggled to understand primary keys using MS Access. How do you plan on the business department to teach PostgreSQL, MySql when most of their students don't have the capacity to learn these DBs and aren't their for their primary purpose to learn new DBs. Which department should teach version control systems? Engineering is mostly pen and paper, mathematics is mostly pen and paper. It's only computer science where application code is built and has the foresight to provide students with version control tools so that the student can understand. Web frameworks and web languages....Once again, business departments don't have the capacity to understand the difference between a POST request and a GET request.

Comment Re:That is what you get with fanboys (Score 2) 175

Somewhere at Google is a Java fanboy, they do far to much mission critical stuff in it (while still developing their stuff) for it to be anything but a fanboy reasoning. They even generate their javascript by writing java instead. No people, javascript is NOT a bad language, it is just a different one that requires a different mindset. Writing a program to be able to generate code for one language in another SCRIPTING language... that is just insanity.

And as has been pointed out, turning Linux into a java only platform is just insane as well. One of the major strengths of Linux is it wide coding support, why on earth would you limit it to just Java a language owned by a rather dubious company before and after (Sun's handling was just as insane) over the countless truly free alternatives? By all means let developers develop in it if they want to but keep your options open.

No, a fanboy exec has declared Java to be the way and business logic be damned.

Meanwhile Apple has forced developers to learn their own language and has the more healthy market. Go figure. Where is the java advantage?

Compile time type checking helps with large applications to reduce the amount of errors. Javascript is an interpreted language with dynamic types and it takes more work to write the application libraries as the application grows. It's not really insane to use a compiler to write javascript if it helps in error reduction.

Comment Re:The problem here... (Score 2) 672

...is that the scientific allegation of spontaneous generation of life has never been proven. Do we have proof of evolution? Most definitely so. Do we have proof that mixing together chemicals creates life? Nope.

Ergo, until that is done repeatedly under laboratory conditions, atheists, your theory of the origin of life remains exactly that. A THEORY.

We have evidence of evolution and we have evidence that that mixing molecules together can create organic molecules. It wasn't long ago that chemists thought that organic molecules were somehow special and too complex to create by man. That theory turned out to be false. The evidence we have for evolution is in the fossil record. Fossils aren't continuous data collections, but snapshots left in time. Many fossils get destroyed before they get preserved. But evolution is a framework that explains common features between us and other primates, between us and cats, between cats and lions. Creationism does not explain why us and other primates look similar other than possible that God lacks an imagination. Young earth creationists also can get challenged by astrophysics and geology as there's evidence of an older planet, star, and universe than what creationists as the age of our planet.

Slashdot Top Deals

"If I do not want others to quote me, I do not speak." -- Phil Wayne

Working...