Single codebase for client and server with Node.js [closed]

There are a few claimed benefits to Node.js that I typically hear. Some (many?) I agree with. There is one that I completely do not understand, which is the one language argument: “You can now use one language on both the client side and the server side.”

This does not make sense to me on many levels:

  1. most people already know more than one language, and learning a second is anyway not that big of a deal.
  2. JavaScript is not that great of a language; if people had any choice they’d probably choose something else on the client side, but they’re locked in.
  3. the beauty of the server side is you can choose ANY language (so it makes sense to choose the best, most capable language, with the least baggage).

The only reasonable argument I’ve heard is “if I’m using backbone I can re-use my models”. Since I haven’t used backbone myself I’m not sure how much that actually amounts too however.

Can someone shed some light?

11

Let’s start with your points:

  1. Most people don’t want to work in several languages in the same day.

  2. Javascript works. It may not be the pinnacle of language design, but it is incredibly flexible. The perceived quality of the language rests a lot on the programmer, which is pretty unique.

    • There are some bad parts, but every language has those
    • The bad parts are very well documented and can be easily avoided
    • It’s actually quite fun to write in. I can’t say that for any OO language.
  3. Some people choose Javascript for the server, and Node.js’s popularity highlights that. In fact, a lot of the Node.js community came from Ruby, which is considered a very fun language to write in.

Now for my points:

  • Fantastic community with incredible energy
  • Massive portability (includes code reuse)
  • Decent package manager

I find Javascript a fun language to write in. When I’m working in other languages, I often miss features that they done have, such as first-order functions, Array methods, stupid-simple closures, and prototypal inheritance (it’s fun when you get to know it).

Javascript is not my favorite language, but it’s definitely not the worst. I’ve since left the Node.js bandwagon, but I still keep it in my toolbox. It’s a lot more interesting than languages like Java or C++.

8

“You can now use one language on both the client side and the server side” doesn’t require that said language be JavaScript. There are a number of other languages which can be compiled into JavaScript, avoiding some of its pitfalls. Some are designed specifically for the purpose (e.g. CoffeeScript), and others have a large pool of experienced programmers (e.g. Java).

On the one hand it might seem crazy to compile Java to JavaScript and run it with Node instead of compiling it to a war and using a J2EE application server. On the other hand, compiling whichever source language you use to JS for both the client and the server avoids issues which could potentially arise due to translation gotchas.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật