腾讯2020年未來展望
Python和Javascript是当今两种最热门的编程语言。 但是,它们不能永远保持领先。 最终,它们必须不受欢迎,就像所有语言一样。 这很可能在未来十年左右的时间内发生。
哪些语言可以代替它们? 这是我的挑战者名单...
镖
}
朱莉亚
endmandelbrot()
Kotlin
image ::PNG).unwrap();
}
打字稿
TypeScript是Javascript…具有优势。 它主要添加静态类型。 与Javascript的兼容性使其成为前端Web开发人员的最爱,因为他们已经了解Javascript,并且几乎不需要更改其工作流程。
关键优势:它是Javascript,因此Javascript开发人员没有太大变化。
关键缺点:它仍然是Javascript,因此您继承了它的所有包bag。
分形树样本:
// Set up canvas for drawing
var canvas: HTMLCanvasElement = document .createElement( 'canvas' )
canvas.width = 600
canvas.height = 500
document .body.appendChild(canvas)
var ctx: CanvasRenderingContext2D = canvas.getContext( '2d' )
ctx.fillStyle = '#000'
ctx.lineWidth = 1// constants
const degToRad: number = Math .PI / 180.0
const totalDepth: number = 9/** Helper function that draws a line on the canvas */
function drawLine ( x1: number, y1: number, x2: number, y2: number ): void {ctx.moveTo(x1, y1)ctx.lineTo(x2, y2)
}/** Draws a branch at the given point and angle and then calls itself twice */
function drawTree ( x1: number, y1: number, angle: number, depth: number ): void {if (depth !== 0 ) {let x2: number = x1 + ( Math .cos(angle * degToRad) * depth * 10.0 )let y2: number = y1 + ( Math .sin(angle * degToRad) * depth * 10.0 )drawLine(x1, y1, x2, y2)drawTree(x2, y2, angle - 20 , depth - 1 )drawTree(x2, y2, angle + 20 , depth - 1 )}
}// actual drawing of tree
ctx.beginPath()
drawTree( 300 , 500 , -90 , totalDepth)
ctx.closePath()
ctx.stroke()
Web组装
WebAssembly是一匹黑马。 在接下来的十年左右的时间里,它可能会衍生出许多升至顶级的语言。 WebAssembly只是一个编译目标,但是没有理由它不能扩展到整个Web域之外。 哪些基于WebAssembly的语言可以升至最高? 有人猜测。
翻译自: https://hackernoon.com/programming-languages-of-the-future-b61332kd
腾讯2020年未來展望