[Topic DIscussion] 看代码猜语言
Tofloor
poster avatar
wlly-lzh
deepin
2025-05-04 21:34
Author

代码1:

value, err := readFile("config.ini")
if err != nil { return fmt.Errorf("read failed: %w", err) }

代码2:

active_users = [user.name for user in all_users if user.is_active]

代码3:

fn get_config(path: &str) -> Result {
    Ok(serde_json::from_str(&fs::read_to_string(path)?)?)
}

代码4:

const getName = async (id: number): Promise =>
  (await fetchUser(id)).profile.displayName;

代码5:

public String getUserName(int userId) throws UserNotFoundException {
    User user = userRepository.findById(userId)
        .orElseThrow(() -> new UserNotFoundException(userId));
    return user.getName();
}

代码6:

var query = from student in students
            where student.Grade > 90
            orderby student.LastName
            select new { student.FirstName, student.LastName };

代码7:

int* p = new int(5); // Raw pointer allocation
if (*p > 0) { process(*p); }
delete p; 

转自:给大家假期找点乐子:一行代码猜语言?

若想获取答案请点击上方链接。


你猜对了几个?

(Expired, see the results below)
7 users voted
1.0(2 votes)
28 %
2.1(0 votes)
0 %
3.2(0 votes)
0 %
4.3(1 votes)
14 %
5.4(1 votes)
14 %
6.5(1 votes)
14 %
7.6(0 votes)
0 %
8.7(0 votes)
0 %
9.路过,与我无关(2 votes)
28 %
Reply Favorite View the author
All Replies
wlly-lzh
deepin
2025-05-04 21:35
#1

沙发

Reply View the author
爱开发
deepin
2025-05-04 22:02
#2

go,python,rust,typescript,java,???,c++

第六个不知道。graphql ?

Reply View the author
wlly-lzh
deepin
2025-05-04 22:18
#3
爱开发

go,python,rust,typescript,java,???,c++

第六个不知道。graphql ?

第六个作者说是C#,但是我也不太了解C#。

Reply View the author
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2025-05-04 22:40
#4

go,

Python,

rust,

js,

java,

6.不知道

7.c/c艹

Reply View the author
wlly-lzh
deepin
2025-05-04 22:43
#5
把一切操作变成GUI

go,

Python,

rust,

js,

java,

6.不知道

7.c/c艹

第四个我也看成js了,但是原作者说是typescript。

然后第七个不是c,第七个只能是C++,C没有delete关键字。

Reply View the author
raspbian
deepin
2025-05-05 00:27
#6

把这些加在一起 叫仓颉

Reply View the author
爱开发
deepin
2025-05-05 13:05
#7
把一切操作变成GUI

go,

Python,

rust,

js,

java,

6.不知道

7.c/c艹

不是 js,js 没有类型声明吧?最后那个有个 new,应该不是 c,c 不是 oop。

Reply View the author
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2025-05-05 13:14
#8
raspbian

把这些加在一起 叫仓颉

正解!

Reply View the author