News for hackers. Stuff that matters.
Re:Poll: What are your liked and disliked programming langua... by sjwright on Thursday October 10, 2013 @10:12AM (#6527784)
Saddened to see a high number of ColdFusion dislike votes. As a CFML developer who routinely bears the brunt of gleeful derision, allow me to point out what you're missing out on.

Yes, ColdFusion was a bit awful in its early days, but to be fair, it was pretty much the first of its breed, predating PHP, JSP, and ASP.

Modern CFML is a JVM-native language and framework that runs in a Java servlet engine. There are three first-class from-scratch implementations, two of which are fully open source. To cut a long story short, the best one is called Railo, and yes, it's one of the open source ones.

Modern CFML running on Railo is an awesome environment to work in: PHP-like hackability, native JVM performance, first-class java library integration, all on a 100% pure open source software stack. Think of it as JSP for genuinely rapid development.

I swear if Railo wasn't associated with the stigma of ColdFusion, it would be up there in the pantheon of fashionable web languages. It's Groovy with batteries included. It's Ruby On Rails for people who wish their code ran faster and realise that ORMs are inherently stupid. (Or there's Hibernate integration for those who haven't realised this yet.)

Re:Poll: What are your liked and disliked programming langua... by mratzloff on Thursday October 10, 2013 @12:22PM (#6528513)
My first job included a significant amount of ColdFusion and CFScript. Having worked professionally in probably 10 languages since then, and speaking from personal experience, I feel comfortable in saying that ColdFusion is a terrible platform and deserves all scorn that can be heaped upon it.
Re:Poll: What are your liked and disliked programming langua... by 51Cards on Thursday October 10, 2013 @01:14PM (#6528858)
As a CF developer (among many other languages) for bordering 15 years now I have come to accept the blanket rejection of the platform. I had to smile at the stats above because I have to wonder if the number of people who have marked "dislike" have even used it (or at least any time recently)

As I write this there are about 2200 votes apiece for both PHP and Python, two languages most people will have an opinion on, so lets make an assumption that's somewhat representative of the voters to date. Also at the moment there are 500-ish down votes for Coldfusion. From my experience it seems suspect that 1 in 5 developers, or even 1 in 6, has worked with Coldfusion enough to have an opinion on it outside of external influence. This type of trend probably also applies to other languages, in both directions.

That said, on Coldfusion, it's far from perfect but it also gets a pretty unfair judging in my personal opinion. Just my 2c.

Re:Poll: What are your liked and disliked programming langua... by mindcrime on Thursday October 10, 2013 @10:53AM (#6528037)
realise that ORMs are inherently stupid.

That's quite the claim... Care to expand on why you think ORMs are "inherently stupid"?

Re:Poll: What are your liked and disliked programming langua... by sjwright on Thursday October 10, 2013 @11:12AM (#6528147)
Because you can't cleanly map objects to sets nor sets to objects. Sure, if you want to pretend an RDBMS is an object store you certainly can, but you'll be forced to have an incredibly stupid schema, and will miss out on much of the benefits of a good RDBMS.

Turning a powerful SQL database engine into an object storage emulator is just sad.

If your underlying data suits objects better than sets, consider using something that's designed for the job, like one of the many non-SQL database systems.

  Although it may seem trite to say it, Object/Relational Mapping
  is the Vietnam of Computer Science. It represents a quagmire which
  starts well, gets more complicated as time passes, and before long
  entraps its users in a commitment that has no clear demarcation
  point, no clear win conditions, and no clear exit strategy.
http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Compute...

Well worth reading.

Also:

http://database-programmer.blogspot.com.au/2010/12/historica...

http://www.codinghorror.com/blog/2006/06/object-relational-m...

Re:Poll: What are your liked and disliked programming langua... by jpatte on Thursday October 10, 2013 @12:46PM (#6528661)
Unfortunately I didn't have time to read these articles in depth, nor do I have the time to write a detailed answer now - sorry. But it seems to me that the situation has changed since these articles were written, at least concerning the tools I know best (which are .NET and C#).

We now have built-in support for data (sets) manipulation in C# and Entity Framework makes things like db.Customers.First().FirstName with syntax support totally real. Many of the premises these essays seem to be based on (like "the languages in play lack any real specialized data structures") are just not true anymore.

Also, I would like to know more about why using an ORM like EF would force me to "have an incredibly stupid schema".

Re:Poll: What are your liked and disliked programming langua... by mindcrime on Thursday October 10, 2013 @01:04PM (#6528782)
Turning a powerful SQL database engine into an object storage emulator is just sad.

Now that I can agree with, but I would consider that to be a (subtly, perhaps) different position than:

"ORMs are inherently stupid".

IF you have the option of choosing a native object store for persisting objects, then - by all means - choose it. But in cases where an RDBMS is the data store of choice for whatever reason, and you still have to store your objects there one way or another, I'd prefer using an ORM like Hibernate over hand-rolling all the low-level SQL/JDBC code to marshall objects back and forth between the DB.

Re:Poll: What are your liked and disliked programming langua... by tel on Thursday October 10, 2013 @11:05AM (#6528105)
I think ORMs are "inherently stupid" (or: "quite likely to be leaky as abstractions") because they don't necessarily share a theory with the underlying databases ("something like but not exactly relational algebra") and I don't think many people spend time proving that the OO-like theories can be properly embedded into something-like-relational-algebra.

Not saying you can't get work done with them, but it does mean that they're likely to leak.

Re:Poll: What are your liked and disliked programming langua... by orclev on Thursday October 10, 2013 @11:13AM (#6528152)
also without an ORM do you just hand roll all your object graphs? I'm picturing a sea of builders and factories which amount to a hand rolled ORM anyway. Or are you practicing stringly typed programming? Ultimately in any strongly typed language you're either going to make/use some kind of mapper or else abandon typing and use maps/dicts which raises the question of why you're using a strongly typed language in the first place.
Re:Poll: What are your liked and disliked programming langua... by wtetzner on Thursday October 10, 2013 @12:33PM (#6528578)
First, you can have strongly typed languages that aren't object oriented. Instead of using maps/dics, you could use records.

The thing I don't like about ORMs as they are typically handled is that you map objects to tables up front, and those are the things you can query for.

Using something like Linq, you can more easily treat your database as relational, and still return strongly typed objects. These objects can be the thing you wanted to return from the query, which is not necessarily mapped directly to the entities in the database.

I like this approach more, since you still get one of the main advantages of a relational database: you can get the data in the shape you want, not in the shape it's stored.

Re:Poll: What are your liked and disliked programming langua... by cmelbye on Thursday October 10, 2013 @02:06PM (#6529181)
Could you explain this a bit more in depth if you have a chance? This is extremely interesting, but I'm not familiar with terminology associated with strongly typed languages. What do you mean by using records instead of maps?
Re:Poll: What are your liked and disliked programming langua... by wtetzner on Thursday October 10, 2013 @02:53PM (#6529385)
You can think of a record like a C struct. It's key value pairs, but the keys and their types are chosen at compile time. There are no methods or anything on them, they are just data.

An example from OCaml:

type person = { first_name: string; last_name: string; age: int }

In a language that has some form of anonymous records (like C#'s anonymous object) and structural typing, this would let you work with relations in your language, much in the way you'd use them in SQL.

I personally like treating data as data. It should be immutable, and therefore there is no state to hide, which means there isn't much value in your types being objects.

It also allows for nice things like pattern matching to work with your data.

Re:Poll: What are your liked and disliked programming langua... by orclev on Thursday October 10, 2013 @04:35PM (#6529886)
You still need some kind of mapper though to go from the SQL results to your record type, even if it's using convention such as the records fields are named the same as the table columns you're pulling from. I'm not arguing that for instance Hibernate is awesome, just that you need something to fill that gap, and you can do a lot worse than Hibernate, particularly within the limitation imposed by Java. Personally I prefer something like this ( http://hackage.haskell.org/package/esqueleto-1.3.4.2/docs/Da... ), but will usually settle for Hibernate or similar in less powerful languages like Java.
Re:Poll: What are your liked and disliked programming langua... by adamonduty on Thursday October 10, 2013 @04:38PM (#6529897)
> you can get the data in the shape you want, not in the shape it's stored.

If you build a database view, you can often trick an ORM into thinking its a table.

Re:Poll: What are your liked and disliked programming langua... by camus on Thursday October 10, 2013 @01:00PM (#6528749)
most ORMs have a query language too, it's not just "Linq". Orms are good for development purposes and you can always do raw SQL queries within ORMs at some point.
Re:Poll: What are your liked and disliked programming langua... by wtetzner on Thursday October 10, 2013 @02:46PM (#6529361)
The thing that's nice about Linq is the integration. You can directly reference variables in the things you're querying, and then either fill in an instance of an existing class, or generate an anonymous object.

For example:

  var query = from c in customers
              join o in orders on c.ID equals o.ID
              select new {
                c.Name,
                o.Product,
                Address = c.MailingAddress
              };
Of course, anonymous objects in C# can be a pain in the ass, since you can't usefully return them from a method. Something like Scala's structural types would solve that problem.

I don't really like C# that much as a language, but I do like the Linq approach.

Re:Poll: What are your liked and disliked programming langua... by druiid on Thursday October 10, 2013 @01:50PM (#6529074)
Thanks for mentioning Railo. The problem with CFML is that Coldfusion(tm) gives Coldfusion a bad name. Some 'legacy' apps that ran on CF were recently switched from Adobe Coldfusion to Railo and it is like night and day... way better memory utilization, hugely advanced caching options and the speed is crazy... like as fast as PHP and other languages I've worked with.
Re:Poll: What are your liked and disliked programming langua... by cakeface on Monday October 14, 2013 @04:24PM (#6549408)
An interesting fact about Railo/CFML is that the recently lauded Distrokid[1] site that got rave reviews from many HNers was built in Railo[2].

[1] https://news.ycombinator.com/item?id=6519175 [2] https://news.ycombinator.com/item?id=6519743

Re:Poll: What are your liked and disliked programming langua... by bfish510 on Thursday October 10, 2013 @10:23AM (#6527868)
As someone who has only associated cold fusion with people laughing, thanks. I'll be sure to look into as an option before I start my next side project.
Re:Poll: What are your liked and disliked programming langua... by sjwright on Thursday October 10, 2013 @10:36AM (#6527964)
To be fair, I'd only actively recommend CFML if it fits your requirements -- if you want something hackable like PHP, perhaps the flexibility of being able to load and use any old Java library, and don't want your language to be opinionated on client side frameworks.

Otherwise I tend not to recommend, mostly because there's a lot of old bad CFML code out there, and it's frankly embarrassing.

Re:Poll: What are your liked and disliked programming langua... by axisK on Thursday October 10, 2013 @11:32AM (#6528244)
I liked ColdFusion as a whole but really disliked using it in a professional context - most other developers just seemed to have a bad understanding of how ColdFusion specific variable scoping worked.
Re:Poll: What are your liked and disliked programming langua... by 83457 on Thursday October 10, 2013 @11:02AM (#6528089)
No mention of CFScript