News for hackers. Stuff that matters.
Re:Don't let dicts spoil your code by Jean-Papoulos on Wednesday October 09, 2024 @02:13AM (#41785009)
>"unstructured data is problematic"

>"solution : use dataclasses"

Damn, it's almost like using an untyped language for large projects is not a great idea.

Re:Don't let dicts spoil your code by ktosobcy on Wednesday October 09, 2024 @03:51AM (#41785503)
And yet we are overwhelmed by javascript nonsense... I get it - it's so easy to get up to speed with tiny snippets but it quickly becomes hot mess.

Yes, decades ago I was also fascinated by python and it's ease of doing stuff (compiler doesn't complain that I missed something) but with time I grew fond of statically typed languages... they simply catch swaths of errors earlier...

Re:Don't let dicts spoil your code by kabes on Wednesday October 09, 2024 @05:03AM (#41785865)
Are we still overwhelmed by js? I almost only see TS code these days.
Re:Don't let dicts spoil your code by ktosobcy on Wednesday October 09, 2024 @11:36AM (#41789046)
I had to deal with it ~1-2 years ago so for my faily ancient self it feels "recent" though considering that there were JS frameworks popping up every couple of months and were getting dropped a year later then my timeframe may be off ;)
Re:Don't let dicts spoil your code by sosotrue on Wednesday October 09, 2024 @02:35AM (#41785119)
Exactly.

But we’re doomed to repeat the same nonsense over and over again because people believe vomiting out [bad] code as fast as possible is the right way to do things.

PHP, JavaScript, Python, Lua - the list is endless with absolutely trash languages with a big following of trash engineers.

And now we’ve added LLMs to the mix. Yay!

Re:Don't let dicts spoil your code by jmorenoamor on Wednesday October 09, 2024 @02:49AM (#41785191)
Dynamic languages demand self discipline, they teach you to respect runtime and think ahead of execution time.

I've written software with both typed and untyped languages and never had problems (out of the ususal) with them.

Re:Don't let dicts spoil your code by ktosobcy on Wednesday October 09, 2024 @03:52AM (#41785517)
> Dynamic languages demand self discipline, they teach you to respect runtime and think ahead of execution time.

Ah... yes... because static languages doesn't do that by forcing you to properly model everything. And as a bonus you can easily navigate between everything and not fear that you miss something while refactoring...

Re:Don't let dicts spoil your code by jrjrjrjrj on Wednesday October 09, 2024 @02:59AM (#41785241)
I would argue that dynamic languages make a compile time problem a run time problem...

So yeah that small not hit portion of code can always be a time bomb if it does not get tested...

Re:Don't let dicts spoil your code by consp on Wednesday October 09, 2024 @04:15AM (#41785630)
> So yeah that small not hit portion of code can always be a time bomb if it does not get tested...

That has nothing to do with the language, and can happen in any language.

Re:Don't let dicts spoil your code by mkesper on Wednesday October 09, 2024 @05:26AM (#41785975)
Python is absolutely typed. By default, it's really dynamic, though.