News for hackers. Stuff that matters.
Re:Why We Use Go by scrollaway on Tuesday May 26, 2015 @10:34PM (#9609000)
> Previously, we worked almost exclusively with Python, and after a certain point, it becomes a nightmare. You can bend Python to your will. You can hack it, you can monkey patch it, and you can write remarkably expressive, terse code. It’s also remarkably difficult to maintain and slow.

Performance aside which is a weak point of python, the language is certainly not inherently unmaintainable. My most maintainable and enjoyable projects are all in Python, you just have to not do stupid things which would make any project unmaintainable (like say no to spaghetti inheritance).

Re:Why We Use Go by chadaustin on Tuesday May 26, 2015 @11:59PM (#9609260)
I find this particular argument rather frustrating.

"Dynamic languages are fine as long as you don't do stupid things." One of the huge benefits of static types is that you can extricate yourself from those situations because the compiler can help guide you through large scale refactorings safely.

It's not even that the team is bad or that the authors of the code were ignorant - it may just be that the software has evolved to where the initial code no longer fits the problem exactly.

"Don't be stupid" is completely unactionable advice.

Re:Why We Use Go by dasil003 on Wednesday May 27, 2015 @01:14AM (#9609467)
I primarily use ruby, and I agree it doesn't have to be unmaintainable, but I also think that static typing will eventually win because it's easier to make type systems more powerful and expressive than it is to make programmers smarter or able to fit a larger system in their heads.

One reason dynamic typing has so much mindshare is because the comparison was always against Java which not only has some of the most boilerplate, but can't even prevent a null pointer exception. So in effect Java is 50% safer at 5x the cost of well designed Python program. However a language like Haskell actually brings real value from the type system (among other things), so you get more like 5x the maintainability at 50% the cost.

Obviously those are just made up numbers, and we can debate the particulars of Haskell vs other modern type systems, but it seems clear to me that is the richest soil for future gains in software maintainability and correctness.

Re:Why We Use Go by scrollaway on Wednesday May 27, 2015 @08:20AM (#9610799)
Personally I think optional typing brings the best of both worlds, I don't see why it's more popular. It's coming to Python with 3.5, using syntax compatible with as early as 3.2, which is fantastic.
Re:Why We Use Go by bottled_poe on Wednesday May 27, 2015 @01:03AM (#9609441)
Agreed. If you don't carefully control the design of your system, how can you expect to control the code base? I'd say something about waterfalls... but I feel I'd be downvoted into the abyss.
Re:Why We Use Go by Dewie3 on Tuesday May 26, 2015 @10:47PM (#9609039)
> My most maintainable and enjoyable projects are all in Python, you just have to not do stupid things which would make any project unmaintainable (like say no to spaghetti inheritance).

That's what they all say though. Low level, high level, static or dynamically typed -- it's not a problem as long as you don't do stupid stuff.

Re:Why We Use Go by scrollaway on Tuesday May 26, 2015 @11:07PM (#9609107)
There is no language which is going to prevent you from shooting yourself in the foot. At best they will make sure the bullet is not also poisoned.

However, there are a lot of languages which encourage bad patterns (like mixing app and view logic, or implicitly convert arrays into numbers when comparing them to strings or something, he said, referring to no language in particular). Python is not one of those languages. Use it as a tool, not a toy, and it will easily help you produce very high quality, maintainable results.

Take a look at this for example, 1 year old hobby project of mine on which I still work daily - some of my most maintainable code. I have never, with any other language, experienced such joy at refactoring massive parts of a project given how easy it has been. https://github.com/jleclanche/fireplace

Re:Why We Use Go by coolsunglasses on Tuesday May 26, 2015 @11:23PM (#9609147)
>There is no language which is going to prevent you from shooting yourself in the foot.

How many guns and how big are the guns that are pointed at my foot? Is it an ion cannon or an airsoft gun?

Most can agree one can be a happy user of $XLANG, but there are gradations of advantage depending on what you're working on.

Plenty of people out there that are happiest working in C, but I don't think many would say it's the safest or most productive language to work in.

Also worth thinking about how easy it is to extract meaning from software just by reading it. Explicit datatypes, specifications, grammars, etc. can all help with that. Even better is tools that can make sure your program faithfully represents an implementation of those specifications and act as a denser mental encoding of code than code itself is capable of being.

Re:Why We Use Go by dorfsmay on Tuesday May 26, 2015 @10:55PM (#9609067)
But it seems more true with python. Maybe because it's more expressive and terse, maybe because there is no magic (scope is always clear), and also, PEP8, which new languages tend to emulate and even formalise with linter such as gofmt.
Re:Why We Use Go by NhanH on Tuesday May 26, 2015 @10:56PM (#9609069)
Bet you ten bucks that any large scale programs (>60k LoC) in brainfuck is unmaintainable -- it's quite obvious that there are certain languages that are more maintainable than other, stupid stuffs or not.
Re:Why We Use Go by IndianAstronaut on Wednesday May 27, 2015 @12:00AM (#9609263)
> it's not a problem as long as you don't do stupid stuff

Easier said than done on large codebases with wide variety of contributors.