News for hackers. Stuff that matters.
Re:Game Jam 2 Results by vanderZwan on Friday September 09, 2022 @09:10AM (#32778741)
Wow sounds like you really need to clean up your codebase.

Seriously, I have never had this problem while coding in Go, and I'm a very very sloppy coder.

Re:Game Jam 2 Results by spoiler on Friday September 09, 2022 @09:22AM (#32778881)
What are you talking about? I don't understand how you've never encountered variables depending on each other.

In any moderately complex function you'll have more than one expression, and those can depend on each other. And you want them to be named and assigned; it makes it easier to read and decode intent and debug things (unless you're one of those wizards who get it right on the first try every time, kudos to you then). I'd not approve a PR that inlines/embeds complex concepts within larger expressions just to avoid creating variables...

Edit: typos

Re:Game Jam 2 Results by vanderZwan on Friday September 09, 2022 @09:32AM (#32778991)
Of course I have encountered dependent variables, but if I have a long chain of unused variables that means that either that code is ready to go, or the code organization needs refactoring.
Re:Game Jam 2 Results by hhmc on Friday September 09, 2022 @09:53AM (#32779246)
You seem to be missing the whole point being made — they are unused because of (temporary) changes during prototyping.
Re:Game Jam 2 Results by vanderZwan on Friday September 09, 2022 @11:45AM (#32780638)
Ah yes, prototyping. The stage of coding where one has lots of snippets of code meant for trying things out quickly. Definitely a context full of long chains of dependent variables.
Re:Game Jam 2 Results by hhmc on Friday September 09, 2022 @02:24PM (#32783027)
One might imagine prototyping new functionality in a existing, complex, codebase..
Re:Game Jam 2 Results by simion314 on Friday September 09, 2022 @10:22AM (#32779608)
Dude, it is about debugging, or work in progress...

Did you ever tried to debug some issue and start commenting stuff to try and find the problematic area? Hell when I comment stuff soemtimes private function will get unused , so with a shit compiler you would need to also comment the private functions, remove unused classes etc.

In my code I assure the linter will say 0 warnings.

Re:Game Jam 2 Results by afiori on Friday September 09, 2022 @10:18AM (#32779554)
At first you have a long chain of used variables that end up into a value used somewhere.

If then you refactor away that single final value you need to delete all the previously used variables that now need to be "deallocated" by you.

Re:Game Jam 2 Results by xmonkee on Friday September 09, 2022 @01:08PM (#32781981)
I am seriously mind-blown that you've never encountered this problem in Go. You're trying something, and you see an error, you comment out a function and replace it with a print statement. And now suddenly you have to comment out a bunch of things up to the import statement just to fucking test out a simple hypothesis.
Re:Game Jam 2 Results by nindalf on Friday September 09, 2022 @04:54PM (#32784781)
Possibly because the IDE helps with that. Including adding and removing import statements. I feel like this complaint is more theoretical than something felt by people using Go day to day.
Re:Game Jam 2 Results by simion314 on Saturday September 10, 2022 @01:55AM (#32788201)
People on the internet contradicts you, You remind me of the Apple fanboys and the keyboard issue , people complain that they keyboard has problems and the fanboys respond with "is working with me, you are using it wrong, you are stupid and probably eat at your keyboard, you broke it yourself"

https://www.google.com/search?q=go+lang++compiler+warnings+u...

All those people reporting the issue are not Go developers? Or maybe are not true Go developers, just the other kind, the ones that want generic and nice things.

But yeah, I am not a Go dev, I used linters and I would hate having to be forced to clear all the unused warnings before I can test the code.

Re:Game Jam 2 Results by simion314 on Friday September 09, 2022 @10:18AM (#32779559)
As other said, it is not a good practice so inline all the code, I prefer well named variables, and I assume you can find examples in your code where you have a local variable that depends of a function parameter.

Funny enough I was correcting my son c++ homework yesterday, he had a complex if statement like

if (somefunction(m,n, y[j]) == m[j])

and I made him make a local variable to make it clear what is happening. then the code was easier to understand and debug because we culd print that local variable and see if is fine.

Btw, try not too respond that smug, you proved that you are an inexperienced coder and a shit person.

Re:Game Jam 2 Results by vanderZwan on Friday September 09, 2022 @11:42AM (#32780610)
I'm not so sure about that one, despite clearly being in the company of people who feel attacked, I'm not the one attacking people here. I'm commenting on code practices, and baffled at other people's rage about the compiler demanding that you don't have unused variables, but I haven't attacked anyone.
Re:Game Jam 2 Results by simion314 on Friday September 09, 2022 @12:38PM (#32781466)
You commented about my code quality, but I will assume you were in a rush and missunderstood that I was talking about work in progress stuff and debugging, so if that was teh case I apologize (if is not the case then you might understand in a few years)