Readit News logoReadit News
cgopalan commented on Why I wrote the BEAM book   happihacking.com/blog/pos... · Posted by u/lawik
cgopalan · 7 months ago
This looks amazing purely from an engineer's perspective that wants to level up on something they have worked on for a while with enough understanding to build working systems with it. Just confirming, this is more useful for developers that have worked with Erlang/Beam correct? Not so useful for a Beam newcomer?
cgopalan commented on The Startup Trap (2013)   blog.cleancoder.com/uncle... · Posted by u/sandwichsphinx
hitchstory · a year ago
It's called TDD not UTDD.

I frequently do TDD with integration and end to end tests. The type of test should be dictated by the nature of the code, which TDD doesnt have an opinion on.

TDD is about following red-green-refactor.

cgopalan · a year ago
Good for you then. I myself have not come across the (loud/louder) TDD exponents advocating for using TDD in system/integration testing, they mostly focus on unit tests. If you can point to some examples, it would be a learning experience for me. If not that's fine too, I am glad that there are voices out there like yours.
cgopalan commented on The Startup Trap (2013)   blog.cleancoder.com/uncle... · Posted by u/sandwichsphinx
hitchstory · a year ago
If you do test-after you have to keep a mental tally of new scenarios to test when making code changes. This makes it more unreliable since it's easy to forget one of those scenarios or mix it up with an already tested scenario.

TDD lets you safely forget by tying the test pass/failure directly to the code.

So, yes, you can do test-after but why?

The only reason Ive ever heard for doing it after anyway is "I just prefer it that way".

Not writing tests at all makes sense (e.g. for a spike), but if I were going to start writing tests at any point I cant see any reason not to do it with TDD.

cgopalan · a year ago
My experience is that TDD just ensures that the code is unit-testable. This can lead to more complex code when it need not be complex. I definitely write tests, but my default approach is to make the test simulate how a user would use the functionality. So mostly a higher level test like a system test. And you can do this only when you have a bigger picture of the program that you write (which need not be driven by unit tests, just need to elucidate what the program needs to do and break it into steps). I don't rule out unit tests, but my approach is to start with tests that resemble system tests, and if i specifically need a unit test for a hairy algorithm in a function, use a unit test to help.

Also the higher level you test at, the less probable that you have to change the tests when you change a piece of functionality.

cgopalan commented on The Startup Trap (2013)   blog.cleancoder.com/uncle... · Posted by u/sandwichsphinx
joshdavham · a year ago
To those who are recommending against Uncle Bob’s Clean Code book, are there alternative books/resources you’d recommend?
cgopalan · a year ago
I have pondered this question before and I have seen people recommending "Philosophy of software design" by John Ousterhout, but my qualms with Clean Code is not that it needs a substitute, its just that its a fairly simple set of concepts about which Bob makes a big deal. I did read some of his books, but I realized its only about 10% of what makes a competent software engineer. My suggestions to people starting out or even seasoned programmers are that get an idea of what he advocates (TDD, SOLID and all that) but then design of programs is just a small part.(And I also can debate the usefulness of both TDD and SOLID. Personal opinion coming: they are great for small or greenfield projects but almost always don't hold up in the real world).

Learn about other kinds of (much more effective) testing like System/Integration testing, Property-based testing. Spend a lot of time learning about databases and SQL. Maybe get into somewhat esoteric topics like constraint solvers and logic programming. You may not use these but it helps to know there's a wide world out there, and they do bend your brain enough to enable you to think differently.

Time is limited. It does matter what we spend it on.

cgopalan commented on Lesser known parts of Python standard library   trickster.dev/post/lesser... · Posted by u/rbanffy
sgarland · a year ago
Adding `array` [0] to the list. It's generally slower than a list, but massively more memory-efficient. You're limited to a heterogeneous type, of course, but they can be quite useful for some operations.

[0]: https://docs.python.org/3/library/array.html

cgopalan · a year ago
You mean homogenous instead of heterogenous, right?
cgopalan commented on Why Elixir (2014)   theerlangelist.com/articl... · Posted by u/arrowsmith
mike1o1 · 2 years ago
Elixir has Ecto, which is not-quite an ORM but is the de-facto standard for database access in Elixir/Phoenix.

https://hexdocs.pm/ecto/Ecto.html

cgopalan · 2 years ago
Thank you!
cgopalan commented on Ask HN: What is the current (Apr. 2024) gold standard of running an LLM locally?    · Posted by u/js98
mateuszbuda · 2 years ago
Anyone can share experience with https://ollama.com/ ?
cgopalan · 2 years ago
I use it on my 2015 Macbook pro. Its amazing how quickly you can get set up, kudos to the authors. Its a dog in terms of response time for questions, but that's expected with my machine configuration.

Also they have Python (and less relevant to me) Javascript libraries. So I assume you dont have to go through LangChain anymore.

cgopalan commented on Why Elixir (2014)   theerlangelist.com/articl... · Posted by u/arrowsmith
sph · 2 years ago
From the author of this post, here's one of the best demos of Elixir, Erlang and modern distributed computing in general:

"The Soul of Erlang and Elixir • Saša Jurić • GOTO 2019" - https://www.youtube.com/watch?v=JvBT4XBdoUE

When you feel sufficiently amazed by this demo, I also recommend the Elixir in Action book, by this same author, to get started with this incredible ecosystem and paradigm.

---

It's hard to imagine a better platform than Erlang's for writing distributed and networked systems of any kind. I fell in love with Elixir in 2016 and have been using it full time since, first adopting as CTO in my previous company, now powering my new solo business. It's such a good language, with great community and stewardship, running on a rock solid platform that's so advanced compared to most popular languages today.

Erlang was created 38 years ago, and it's good to see the ideas of Armstrong, Virding and Williams to be vindicated today. They simply were too far ahead of their time.

cgopalan · 2 years ago
Thanks for the talk link, it completely kept me engrossed and was a pleasure to watch! Addendum question: what is the state of database drivers for Elixir? Does it have mature libraries for Postgres for eg? I imagine if it's targeting web development, it will need those.
cgopalan commented on Pyenv – lets you easily switch between multiple versions of Python   github.com/pyenv/pyenv... · Posted by u/punnerud
airstrike · 2 years ago
I've been using python on and off since Django 0.96, which was released in 2007.

I don't recall ever needing anything other than virtualenvwrapper and pip—and even some of the annoyances these tools had early on have been solved by now...

https://virtualenvwrapper.readthedocs.io/en/latest/

If you really need different versions of python, you can just `mkvirtualenv -p python3 venvname`

I feel like every other tool out there has to explain what problem they solve that virtualenvwrapper doesn't

Don't install anything globally, creates lots of envs, and feel free to have different versions of python installed side-by-side with some "main" version preferably symlinked as `python` and `python3`

The end

cgopalan · 2 years ago
You should look at the command `python -m venv`. Its built in, and is a breeze to create virtual environments. I guess it does not provide shortcuts for activation etc, but I am ok with that.
cgopalan commented on Pyenv – lets you easily switch between multiple versions of Python   github.com/pyenv/pyenv... · Posted by u/punnerud
andreif · 2 years ago
Works fine for me on macOS. I am using venv the same way you do except some global ones for certain tools.
cgopalan · 2 years ago
I thought one of the advantages of pyenv was that you switched to also creating virtual envs using pyenv and managed virtual environments with it too. Maybe not.

u/cgopalan

KarmaCake day735October 14, 2010
About
I am a programmer.

http://cgopalan.github.io http://github.com/cgopalan

Email: chandrakant.gopalan@gmail.com

View Original