Java oracle 依家都唔錢

馬掃墓

222 回覆
6 Like 84 Dislike
性幻想家 2024-12-08 22:46:30
可以唔鍾意Java 但係JVM冇可能係垃圾
無論係HotSpot JIT、各大GC甚至係近年冒起嘅GraalVM 都係業界首屈一指嘅技術
性幻想家 2024-12-08 22:49:42
玩吓Kotlin Multiplatform + Compose Multiplatform
(PS 唔係太鍾意Kotlin 太容易導人寫spaghetti code)
性幻想家 2024-12-08 22:53:03
淨係對F#有好感 其他嘢我覺得too late too little
(我個人唔鍾意M$ 咁多年嚟亦都唔知點解覺得.NET個名好柒
性幻想家 2024-12-08 22:57:39
N年前嘅java nio已經solve咗c10k嘅問題 netty都唔知面世咗幾多年 spring都老早轉咗reactive 你講得啱 project loom真係好過async await好多 完全冇function colouring嘅問題

咁多年後仲攞async event loop嚟打J 好黑色幽默
性幻想家 2024-12-08 23:02:07
啲學校教埋啲19年前嘅OOP 唔講composition over inheritance 分分鐘連interface default
method都唔教

唔好講covariance同contravariance添 連invariant generics有冇好好學到都成問題
性幻想家 2024-12-08 23:07:50
所以就有TypeScript嘅誕生 保持JS semantics同source compatibility之餘 套層type-safe嘅皮落去

淨係講language feature嘅話TypeScript好有趣 算係第一隻主流language玩dependent typing玩到咁大 (Kotlin主唔主流值得商榷 但係smart cast只係掂到dependent typing小小)
性幻想家 2024-12-08 23:08:59
加拿大英國都屌打XG 起碼big tech有R&D喺度
性幻想家 2024-12-08 23:10:23
稅後都高過XG稅前 未計career upside
NVDA升升升 2024-12-09 01:14:43
TypeScript只係做到compile time type-safe
現實係多數要做到runtime type-safe, 結果就搞咗樣dto class-validator出嚟

Java, .Net 只需要define data type就做到
eg.
public class BaseContent
{
    public string Name { get; set; }
}


而TypeScript要@IsString
class BaseContent {
    @IsString()
    name: string;
}
諸如此類 2024-12-09 02:38:35
多數係typescript用左any先會咁樣,唔可以怪個language咁樣設計
正如Java一樣可以用晒object

typescript只係compile time check,係tsc造成嘅問題

JS都變左唔少,呢點已經過時,有deno,bun等等嘅typescript runtime,唔需要tsc, 直正run typescript language
Flinty 2024-12-09 02:58:37
Python
我唔識撚貓 2024-12-09 04:42:46
解釋下點樣導人寫意粉
NVDA升升升 2024-12-09 04:42:52
同係唔係any type無關係
就算可以直接execute typescript都係無runtime type checking
行緊嘅時候直接assign number入string type variable都唔會出error

如果唔係點解搞dto要用埋class-validator
IsString, IsDate都要用declare
https://github.com/typestack/class-validator?tab=readme-ov-file#usage
69701 2024-12-09 05:00:21
唔同意kotlin 導人寫spaghetti code
但想聽下你見解
性幻想家 2024-12-09 07:07:42
TypeScript目標係100%同JS source+semantics compatible
你想要嘅嘢係static typing 任何backward compatible嘅JS runtime永遠俾唔到你 我唔係太熟TS 但係我相信你嘅snippet入面TS係做緊reified type

對我嚟講Java嘅type safety都係唔夠 一去到NPE、Unmodifiable Collections同埋generics就all hell breaks loose
性幻想家 2024-12-09 07:10:35
似乎係唔得 bun只係幫你做埋transpile嗰步 入面都係行緊JS 冇改到TS嘅semantics 所以static typing都係唔會有
性幻想家 2024-12-09 07:17:17
可能我自制能力低 好容易濫用kotlin啲syntactic sugar

function_shorthands?.optional_return_type_annotation?.higher_order_functions?.implicit_closure_argument_name ?: disaster
69701 2024-12-09 07:36:18
都係嘅 由其係let also apply 呢啲
不過你呢個例子嘅nullable return type
有啲太過分
除咗call Java api 以外我係唔會用nullable type
凡係好嘅dev team 都應該要制定
一個合理嘅code practice
同code review session 去阻止呢啲濫用
所以呢種情況應該好少會出現
性幻想家 2024-12-09 07:47:43
你誤會咗
我講嘅optional return type annotation指嘅係function shortform可以唔加return type annotation
fun foo() = bar()

我上面打嘅成串嘢炒埋一碟就變超級spaghetti
fun foo() = bar().apply {
  it.let { it.forEach(::print) }
}
69701 2024-12-09 08:01:44
咁我覺得我講嘅後半part
係對應緊你而家呢個例子
我哋team嘅practice係 scoped function
係一個argument 最多用一次
性幻想家 2024-12-09 08:05:42
btw點樣做到唔用nullable type 有時個semantics真係要nullable 唔通學Go咁加枝flag話係nil?
var nullable: Any?

type Nullable[T] struct {
  value T
  isNil bool
}
nullable := Nullable[T]{isNil: true}
性幻想家 2024-12-09 08:08:19
你哋用manual code review定linter去enforce依樣嘢?
69701 2024-12-09 08:13:55
兩樣都有 加埋而家有得用ai 做code review
GitHub action 又易setup
我唔識撚貓 2024-12-09 08:57:32
當你要不斷咁樣?.既時候 就即係你係個flow同data structure有問題要fix
呢個?.既feature存在但唔代表你應該要濫用

如果有一個咁樣既feature就=導人寫意粉 咁呢個唔係language既問題係developer&team 自制力&standard既問題
性幻想家 2024-12-09 08:59:35
我上面嗰個其實唔係code example 只係個joke 估唔到大家咁認真 我道個歉先
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞