Published by Seraphimsan
Oct 13, 2010 (last update: Oct 14, 2010)

When to use what language and why

[转] http://www.cplusplus.com/articles/42E1wA7f/

Score: 3.3/5 (98 votes)
Its been debated here for the past couple of months what language is "the best" or more appropriately, "the worst" which defines another as better inherently.

Well I'd like to straighten one thing out. There is no best language. There is no best paradigm. There is no best algorithm, method, optimization, technique, ANY OF IT. All good programmers know this, and all real computer scientists know that a language is just a tool in the science of computation. If some one builds a better screw driver, why not use it? Well perhaps this screw driver is only better at getting the job done faster, and not getting it done more efficiently. Or maybe it's great at both of those but the screws are not tightly in the wall because of it. This is comparable to the differences in all computer languages.

So one coder might ask "When should I use "XYZ"?" and when answered they might ask "why?"

I'm here to answer these questions.

When should I use Assembly: You should use assembly when you need the lowest level access to the hardware available. Or when you need to hand optimize things like algorithms and the like. That's not to say you can't use assembly for a desktop application, but it is entirely impractical. As a rule of thumb, use assembly when you need more raw control then you do quickly written and readable code.

When should I use C/C++: Well first of all, c and c++ are both lower level languages, not nearly as low as Assembly but low none the less. Now they are also non garbage collected languages, so you will have to deal with debugging memory leaks and the like, but that presumable flaw is one of the greatest strengths of languages like these. While you may spend more time writing and fixing code then you do optimizing the code, you have the power to optimize it a hell of a lot better than garbage collected code. So anyone who tells you "use java/C#/Scala/etc for you're Kernel/game engine/generic time and resource critical application" because they think you'll get it done faster, and thus make more money because of it, knows nothing about computer science nor economics. Build x number of shitty toys in a month and you're left with a pile of shit. build 1 amazing toy in a month and every one will want your toy...cause come on, who wants to play with a pile of shit?

Now you may think, if thats so why should i ever use languages like java/c#/scala/F#/etc? well the truth is some times you do want to implement faster than you want something to be efficient, and in some cases some of these languages do a better job at both.

So when should I use java: If this wasnt an impartial article I'd say never and leave it at that. BUT this is supposed to be neutral so Java is great for server based applications, as well as client based web apps. It's fast and great with databases, while at the same time having some over head. My biggest problem with java is it's not that great of a language, in fact it's pretty bad. But thats what people get for trying to turn a language designed to teach students computer science and OOP into an industry standard. It was never meant to be what it is today.

What about c#: Use C# when ever you'd think to use java. The way I see it is C# is just like java...except it works.

how bout functional paradigm languages like F#: you want to use languages that are functional when you need more platform independence. Functional languages make it easier to process your algorithm, method, function, etc independent of thread of CPU. It's great for multiple platforms, and multiple threading. This is also why scala excels at these things.

So all things considered you need to remember one thing when programming. It's not about finding the best tool out there and sticking to it like it's dogma. It's really about finding the best technique to learning how use these tools so you can have a full toolbox when it comes time to build your software.

Edit: I was late for class and forgot to add a "will add more later" and remove the above section.

[转] When to use what language and why的更多相关文章

  1. <%@ page contentType="text/html; charset=utf-8" language="java"%>每一个字符的含义

    contentType="text/html:网页类型htmlcharset=utf-8"网页编码类型language="java"网页编程语言<% @ ...

  2. UML(Unified Modeling Language)统一建模语言

    什么是模型 模型是对现实的简化 模型是提供系统的蓝图,模型可是包括详细计划.也可是是从更高程度考虑系统的总体计划,每个系统可以从不同的方面用不通过的模型来描述.因而每个模型都是在语义上闭合的抽象系统. ...

  3. iOS Swift-元组tuples(The Swift Programming Language)

    iOS Swift-元组tuples(The Swift Programming Language) 什么是元组? 元组(tuples)是把多个值组合成一个复合值,元组内的值可以使任意类型,并不要求是 ...

  4. iOS Swift-控制流(The Swift Programming Language)

    iOS Swift-控制流(The Swift Programming Language) for-in 在Swift中for循环我们可以省略传统oc笨拙的条件和循环变量的括号,但是语句体的大括号使我 ...

  5. iOS Swift-简单值(The Swift Programming Language)

    iOS Swift-简单值(The Swift Programming Language) 常量的声明:let 在不指定类型的情况下声明的类型和所初始化的类型相同. //没有指定类型,但是初始化的值为 ...

  6. Traditional Language Model

    Traditional Language Model通常用于回答下述问题: How likely is a string of English words good English ? \(p_{LM ...

  7. language level in Intellij IDEA

    The Language level setting sets which features the code assistance in the editor should support. For ...

  8. Java Programming Language Enhancements

    引用:Java Programming Language Enhancements Java Programming Language Enhancements Enhancements in Jav ...

  9. SharePoint Site "Language Settings"功能与CSOM的对应

    博客地址:http://blog.csdn.net/FoxDave SharePoint网站中的语言设置:"Language Settings",可以用CSOM通过Site的一些 ...

  10. Why sql is called structured query language?1 - 12

    SQL has much to do with a researcher at IBM, Edgar F. (Ted) Codd, an Oxford-trained mathematician, w ...

随机推荐

  1. luogu 5月月赛 #A

    T29693 取石子 题目描述 Alice 和 Bob 在玩游戏 他们有 n 堆石子,第 i 堆石子有ai​ 个,保证初始时 ai​≤ai+1​(1≤i<n) . 现在他们轮流对这些石子进行操作 ...

  2. 文艺平衡树(splay模板)

    题干:splay模板,要求维护区间反转. splay是一种码量小于treap,但支持排名,前驱后继等treap可求的东西,也支持区间反转的平衡树. 但是有两个坏处: 1.splay常数远远大于trea ...

  3. 微信小程序wx.request请求服务器json数据并渲染到页面

    [原文出自]: https://blog.csdn.net/weixin_39927850/article/details/79766259 微信小程序的数据总不能写死吧,肯定是要结合数据库来做数据更 ...

  4. c++_等差素数列

    标题:等差素数列 2,3,5,7,11,13,....是素数序列.类似:7,37,67,97,127,157 这样完全由素数组成的等差数列,叫等差素数数列.上边的数列公差为30,长度为6. 2004年 ...

  5. 关于linux安装kettle的总结

    一.部署准备 1.1 JDK安装配置 命令行键入“cd /etc”进入etc目录 命令行键入“vi profile”打开profile文件 敲击键盘ctrl+F到文件末尾 在末尾处,即第一个~的地方, ...

  6. 集合框架学习之List接口

    Java语言的java.util包中提供了一些集合类,这些集合类又被称为容器.用来完善数组的不足之处.集合类与数组的不同之处是,数组的长度是固定的,集合的长度是可变的:数组用来存放基本类型的数据,集合 ...

  7. SQL2012通用分页存储过程

    --提取分页数据,返回总记录数 Createprocedure [dbo].[sp_Common_GetDataPaging_ReturnDataCount] ( @SqlString varchar ...

  8. git push ‘No refs in common and none specified’doing nothing问题解决

    git push ‘No refs in common and none specified’doing nothing问题解决 输入git push origin master即可解决问题

  9. linux rdesktop远程Win7老是提示密码错误问题解决

    最近使用rdesktop远程Win7老是提示密码错误,输了N次,无比确认密码是正确的. 在Win7系统本身登录也是正常的. 但rdesktop远程就是报密码错误. 开始怀疑更新了最新版本问题,但是使用 ...

  10. UINavigationController 小记

    1.以栈的形式管理视图控制器,push 和 pop 方法来弹入和弹出控制器,最多只能显示一个视图控制器. 2.使用pop方法可以移除栈顶控制器,当一个控制器被pop后,控制器内存会被释放了. 3.一层 ...