由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 业余说说Golang的问题
相关主题
Scala又被鄙视了整天拿fp来说事的看看人家真正的数学家的东东
haskell 怎样解决库的版本问题?现在所有小公司都是open space和daily scrum (转载)
c 语言中怎么用科学计数法成功无偶然啊
看了一下Meteor很不错取代C++!Google 开发自己的编程语言Golang了 (转载)
haskell 可以运行在iOS上了打算开始学golang 了
最新haskell实现可用40+ coresc++ programmer们就不用悲愤了
haskell有潜力成为最好的web frameworkNode过两年会不会被go打的满地找牙?
haskell在生产环境的生产力到底如何?来看用什么来把nodejs给干死掉
相关话题的讨论汇总
话题: con话题: go话题: golang话题: hard话题: notions
进入Programming版参与讨论
1 (共1页)
n******7
发帖数: 12463
1
我的理解是
golang就是个带GC,concurrncy很容易的C
另外编译快,deploy方便
据说golang吸引了很多python programmer, 我也算是一个吧
不过大部分好处都是有代价的,很多缺点要实际用才能感受
作为只写过golang hello world的人,看了下面一个总结决定不值得学习
最关键的是前两条:
Hard to abstract even the simplest notions
Designed to make the programmer expendable
第二条对java之类的可能也适用,但是java的抽象级别还是高了很多,也就是说经验技
巧还是很有用的
Con
Hard to abstract even the simplest notions
Go is famously regarded as very simple. However, this simplicity becomes
problematic in time. Programmers who use Go find themselves over and over
again writing the same thing from a very low point of view. Domains not
already served by libraries that are easy to glue are very difficult to get
into.
Con
Designed to make the programmer expendable
Go was designed for large team projects where many contributors may be
incompetent. That Go can still get things done under these conditions is a
testament to its utility in this niche. Go's infamously weak abstraction
power is thus a feature, not a bug, meant to prevent your teammates from
doing too much damage. This also means any team member can be easily
replaced by another code monkey at minimum cost. Good for the company, bad
for you. The more talented programmers, on the other hand, will be very
frustrated by having one hand tied behind their back.
Con
Expects prior familiarity with tooling, "advanced" OS use
A standard step of even installing Go is modifying your path -- a person who
's encountering their first language might not even understand. It's hard to
escape using Go without familiarity with using build tools, managing and
organizing project directories, etc. It's not as simple as Python's "just
run the .py file with the interpreter."
Con
Requires specific directory structure and environment variable settings
Too much knowledge required for a first programming language.
Con
Implementation of interfaces are difficult to figure out
Finding out what interfaces are implemented by a struct requires a magic
crystal ball. They are easy to write, but difficult to read and trawl
through.
Con
Performance slowdown because of indirect calls and garbage collection
Practically no meaningful Go application can be written without indirect
function calls and garbage collection, these are central to Go's core
infrastructure. But these are major impediments to achieving good
performance.
Con
Does not support circular dependencies
Con
Easy to shadow variable
Due to single character only difference, declare and assign statement can
easily shadow variable from outer scope unconsciously. Example:
err := nil
if xxx {
err := somefunctionthatreturnsanerr
}
return err // always return nil
Con
Weak type system
n******7
发帖数: 12463
2
上面总结来自
https://www.slant.co/versus/126/5522/~golang_vs_rust
另外看到一个不错的评论,感觉我被说服了
https://www.quora.com/How-do-Rust-and-Go-compare-1/answer/Tikhon-Jelvis?srid
=29sY
"The other often-touted, and eminently reasonable advantage Go gives is the
fast compile time. But this just means that other languages' compilers do
more for you. I think my time is worth more than my computer's time; I would
want my compiler to do as much optimization as possible. Hell, you can just
turn the optimization off when you're developing and get reasonable compile
times with the alternatives (like GHC)."
a9
发帖数: 21638
3
其实关键还是库支持程度,现在go也有很多开源好库了,虽然我还没用过go,但觉得有
点前途

srid
the
would
just
compile

【在 n******7 的大作中提到】
: 上面总结来自
: https://www.slant.co/versus/126/5522/~golang_vs_rust
: 另外看到一个不错的评论,感觉我被说服了
: https://www.quora.com/How-do-Rust-and-Go-compare-1/answer/Tikhon-Jelvis?srid
: =29sY
: "The other often-touted, and eminently reasonable advantage Go gives is the
: fast compile time. But this just means that other languages' compilers do
: more for you. I think my time is worth more than my computer's time; I would
: want my compiler to do as much optimization as possible. Hell, you can just
: turn the optimization off when you're developing and get reasonable compile

n****l
发帖数: 1739
4
Con
Hard to abstract even the simplest notions
這個有點誇大其詞了。 看過太多的太空架構師,寫得Java和C#code基本是shit, 一層
包一層
的abstraction。 這個就是golang最大的好處,因爲你不會和這些idiots做同事。
n******7
发帖数: 12463
5
问题是论库java c# python之类的只会更多
为啥用go?

【在 a9 的大作中提到】
: 其实关键还是库支持程度,现在go也有很多开源好库了,虽然我还没用过go,但觉得有
: 点前途
:
: srid
: the
: would
: just
: compile

s********k
发帖数: 6180
6
Hard to abstract even the simplest notions?
不觉得啊,用interface吧

【在 n******7 的大作中提到】
: 我的理解是
: golang就是个带GC,concurrncy很容易的C
: 另外编译快,deploy方便
: 据说golang吸引了很多python programmer, 我也算是一个吧
: 不过大部分好处都是有代价的,很多缺点要实际用才能感受
: 作为只写过golang hello world的人,看了下面一个总结决定不值得学习
: 最关键的是前两条:
: Hard to abstract even the simplest notions
: Designed to make the programmer expendable
: 第二条对java之类的可能也适用,但是java的抽象级别还是高了很多,也就是说经验技

f*******t
发帖数: 7549
7
太对了

【在 n****l 的大作中提到】
: Con
: Hard to abstract even the simplest notions
: 這個有點誇大其詞了。 看過太多的太空架構師,寫得Java和C#code基本是shit, 一層
: 包一層
: 的abstraction。 這個就是golang最大的好處,因爲你不會和這些idiots做同事。

d****n
发帖数: 1637
8
Con
Does not support circular dependencies
我孤陋寡闻了。哪个优秀的语言这么搞?
d****n
发帖数: 1637
9
Con
Does not support circular dependencies
我孤陋寡闻了。哪个优秀的语言这么搞?
w********m
发帖数: 1137
10
agree
选择语言其实是选择队友的问题。

【在 n****l 的大作中提到】
: Con
: Hard to abstract even the simplest notions
: 這個有點誇大其詞了。 看過太多的太空架構師,寫得Java和C#code基本是shit, 一層
: 包一層
: 的abstraction。 這個就是golang最大的好處,因爲你不會和這些idiots做同事。

相关主题
最新haskell实现可用40+ cores整天拿fp来说事的看看人家真正的数学家的东东
haskell有潜力成为最好的web framework现在所有小公司都是open space和daily scrum (转载)
haskell在生产环境的生产力到底如何?成功无偶然啊
进入Programming版参与讨论
S*A
发帖数: 7142
11
python 就可以 GC circular dependencies。

【在 d****n 的大作中提到】
: Con
: Does not support circular dependencies
: 我孤陋寡闻了。哪个优秀的语言这么搞?

m*****n
发帖数: 3575
12
怎么搞的?说说看?

【在 S*A 的大作中提到】
: python 就可以 GC circular dependencies。
S*A
发帖数: 7142
13
我以为,
这个就是 graph reachable 的问题。
你从程序 local 和 global 开始往下扫描。
扫到的 mark, 从 heap 过一遍就可以清除没有扫描的。
这个是我自己乱想的啊。
这个循环依赖的清除 C 编译器里面也有。大概就是类似
这样的算法。

【在 m*****n 的大作中提到】
: 怎么搞的?说说看?
d*******o
发帖数: 493
14
golang最大的feature就是禁止circular dependency,然后无限线程compile。
所以compile的速度秒杀其他语言。
要是这是个bug的话,那我只好呵呵了。
m*****n
发帖数: 3575
15
我知道的circular dependency就是两个函数或者两个模块可以互相访问?
在python里这么搞是无效的
所以为了能够让母子模块之间共享变量,我都只好再开一个模块放全局变量

【在 S*A 的大作中提到】
: 我以为,
: 这个就是 graph reachable 的问题。
: 你从程序 local 和 global 开始往下扫描。
: 扫到的 mark, 从 heap 过一遍就可以清除没有扫描的。
: 这个是我自己乱想的啊。
: 这个循环依赖的清除 C 编译器里面也有。大概就是类似
: 这样的算法。

1 (共1页)
进入Programming版参与讨论
相关主题
来看用什么来把nodejs给干死掉haskell 可以运行在iOS上了
用了一下node.js, 看来js要一同天下啊,只要那些人最新haskell实现可用40+ cores
学FP不是为了写代码, 而是为了优秀的架构.haskell有潜力成为最好的web framework
go真是好东西haskell在生产环境的生产力到底如何?
Scala又被鄙视了整天拿fp来说事的看看人家真正的数学家的东东
haskell 怎样解决库的版本问题?现在所有小公司都是open space和daily scrum (转载)
c 语言中怎么用科学计数法成功无偶然啊
看了一下Meteor很不错取代C++!Google 开发自己的编程语言Golang了 (转载)
相关话题的讨论汇总
话题: con话题: go话题: golang话题: hard话题: notions