4 ms·
My knowledge-gap confession: even after many years with the languages, I can't write a main() in Python or Java without looking up the format.
by kens 10mo ago
My knowledge-gap confession: even after many years with the languages, I can't write a main() in Python or Java without looking up the format.
- mulquin 10mo agoContinuing the confessions: I do php.net/<function_name> at least twice a day
- 1718627440 10mo agoIs that a bad thing? I also call man <libc function> several times per day, most times I think I already know the calling semantics, but there is always some nitpick about the calling semantics or a bug description, that I didn't had in mind.
- nicoburns 10mo agoIt's the main benefit of Rust ;) (obviously it's not but it is super nice that main in Rust is just:) fn main() { }
- stavros 10mo agoWhat, `def main():`? Or do you mean the __name__ == "__main__" thing for distinguishing whether the code was imported?
- kens 10mo agoI can successfully type "def main()" and not "function main()", unless I'm switching between JavaScript and Python and forget which language I'm in :-). It's the if statement with all the underscores that I need to check every time.
- stavros 10mo agoI actually made that a keyboard macro because, even though I remember the syntax, I can't be bothered with all the special characters all the time.
- p2detar 10mo agoWith Java 24 it’s now: void main() { }
- croes 10mo ago"Knowledge means knowing where it is written down."
- andrewmcwatters 10mo ago[dead]
- kbelder 10mo agoSo many things like that! I don't know if I could tell you with confidence the proper way to get a string length in any language. Is it a global function or an object method or property? Is it length or count or size? I have to look it up or rely on intellisense every time. I do too much bouncing between languages. Well, I know it in BASIC. Len().
- vjvjvjvjghv 10mo agoI set up some .NET services years ago. Since then it was just adding new stuff. If I was asked how to set up another service, I would have no idea how to do it
- taberiand 10mo agoThat's what `dotnet new webapi` (and all the other dotnet new templates) is for. They don't even have a main() any more, it's great
- vunderba 10mo agoI’ve spent so much time in both the .NET and JS worlds that I can't even begin to count how many times I’ve typed `Where` when I meant `filter` or vice versa.
- the__alchemist 10mo agoIn python, it's trivial: def main(): # code The dunder syntax you see around isn't required.
- dboreham 10mo agoLLMs are wonderful for this. I can't write hardly a line of shell script without looking something up. And then there are three different ways to do <thing> so I spend time beard-tugging as to which way to do it. Now I just tell the LLM what I want changed about this shell script and look at what it comes up with. 100% of the time it's fine.
- jmogly 10mo agoLol! This is probably my sneaky number one productivity benefit from LLMs, I would never want to go back to writing shell scripts pre-llm. So many hours wasted debugging and deciphering stack overflow over the years, dropping &,$, [[]], “”,|,<> in different places hoping to get my .shitty scripts working. Like conceptually I understand shell scripting very well, but anyone nobody can argue that bash isn’t footgun central.
- dfedbeef 10mo agowhat
- DrewADesign 10mo agoNo purpose in memorizing something that doesn’t meaningfully improve your understanding of the language, you only need it every now and then, and you can find it nearly instantly.
- another_twist 10mo agoIntelliJ completes the format for me. I never write it by hand. Also I have never coded in something other than an IDE.
- hokkos 10mo agoit's because you only do it once per project.