HNHacker News
TopNewBestAskShowJobs

Foober223

124 karma · joined February 8, 2019

submissionscomments
Foober223··on Ask HN: What do you think of using Vi rather than Vim or Neovim?
Try

    vim.tiny -u NONE
For a smaller vim with less features. 3.9mb on my system. I don't have the original vi to compare, but when we are getting this small, any further memory savings are just noise, unless your dev box is a strange device. I doubt original vi would be faster than tiny vim.

Also try mg. Only a tiny bit larger than ed, but supports modern screen display and Emacs key binds. 1.1mb on my system. Screaming fast.

Also try GNU Emacs. It takes a bit of fiddling, but you can off-load much of the start-up slowness into the build stage. Loading things into the lisp image of temacs (at the cost of flexibility, you must rebuild when stuff changes if you want to keep the speed). Then you have a fully featured IDE that boots up in 0.2 seconds. Not bad and quite a bit faster than some tricked out Vim IDE's. You can have syntax highlighting turned off too, for more speed at runtime. Large, but it's in charge and not slow.

Foober223··on Ask HN: Do you think handwritten SQL is error prone? If so, why?
You can use an ORM and hand written SQL. They are not mutually exclusive.

I think hand written sql is overall safer than an ORM. With SQL it's easy to select only the fields you need, and only update fields you need. ORM's want to fill up an object. The ORM will try to load some binary file field that has no relevance to the current task. You have to jump through hoops to not load a field of an object. But now your ORM updates are broken. That field you didn't load might cause it to be nulled out when you update back to the DB. It's a tragedy this pattern has caught on.

Data should not be ham-fisted into an object. You select 2 fields, not 10. The result is a set, not a model object. I think the clojure ecosystem is good at treating data in it's true form without forcing transformations to fit an object model.

Foober223··on String Algorithms in Lisp
I don't use vim, but supposedly Paul Graham, the creator of this site uses vim for lisp. You really don't need that many fancy tools. Vim already has a visual hint for matching parens. It's nice to load stuff into the lisp image while you are typing but a quick keybind to switch to an external REPL and reload a file gets the job done.

Linux was crafted with just a basic editor, no IDE features. Unix was crafted without even a display to see the code being typed. Fancy tools are nice but not required.

But that said, SLIME in Emacs is the best. It's macro expansion buffer with really helps to understand what a macro does, or make things clear while crafting your own macros. Auto completion is great, although it only works for what is loaded int he live image, it doesn't scan source files for completion like a traditional IDE. Just load everything and completion is great.

Foober223··on Ask HN: How do you organize and manage database migrations?
I use good old fashioned numbered SQL scripts. 01_foo.sql 02_bar.sql 03_baz.sql

In my local dev environment, I have a DB backup representing the current state of production. This is the starting point SQL scripts must be applied to. A deployment script restores this DB, then applies the SQL scripts against it. The entire deployment process takes about 2 seconds even with many gigs of data in the DB backup.

Sometimes I'll include an extra "dummy data" script applied at the end.

My local environment, Test, and Production are deployed in almost exactly the same way. A few extra actions are done for Production of course. And Production is not restored as that would loose data. Local dev is optimized for a speedy restore/deploy.

Developers always want to treat the DB as if it's code. But it's not. It's a blob of valuable state that must be protected from corruption. You apply patches to that blob of state. The order patches occur matters. There's no "re-build" like in pure code.

Foober223··on Relearning to Type
Could Colemak increase pain and effort in non-english languages?
Foober223··on Ask HN: Are there any famous non-tech people that use Linux on a regular basis?
You probably mean the Android operating system. Every celebrity out there already uses linux on their android phones. PSA: the linux kernel is just one tiny irrelevant component of an android system. It's google's system level utilities and user applications that make android a complete operating system.
Foober223··on Tell HN: Thank you for not redesigning Hacker News
ditto. Hacker news also works great on mobile devices. While every other so-called mobile app/website is a pain in the butt.
Foober223··on IBM Stops Buybacks to Pay for Red Hat
Do you even thinkpad bro?
Foober223··on Ask HN: Why are non-technical managers paid more than engineers?
I upvoted it. It's a good insight.
Foober223··on Ask HN: What keyboard do you use?
Poker 3. 60% size. Cherry MX clear switches.

I prefer a larger 10 keyless at a fixed office space, but 60% is nice if you are on the go. Flat keyed laptops are terrible for real work.

Foober223··on Ask HN: What is your goto stack when building a MVP and why?
C++ and postgress. In theory it should be the worst choice for fast prototyping. No interactive development like lisp. Forces types on you. No awesome web framework.

But I'm so familiar with the language and tool chains I can prototype extremely rapidly. With just a few minimal sane decisions, the prototype can be "web scale" buzzword compliant.

Foober223··on Bedridden for 11 years, he discovered a surgery for his adrenal condition
Some doctors are idiots. No different than people in any other profession.
Foober223··on History and Effective Use of Vim
> Oct 2010 - Feb 2014 : Vundle (Discontinued after NeoBundle ripped off code)

Looks like Vundle has an MIT license. rip off usually implies something negative or dishonest. Copying MIT licensed code is a normal and encouraged activity.

Foober223··on Ask HN: Favorite cross platform lang/framework for command line apps?
command line? C/C++. Compiling separately for each environment is the best kind of cross platform for the end user.
Foober223··on Chinese developers fear the tech war will cost them access to GitHub
Git and Github are are like philosophically opposed. Git is distributed. Who cares if a hosting server is lost? 5 minutes and you're up on a different server.
Foober223··on Ask HN: How does your development team handle database migrations?
On my team we use numbered sql scripts. We restore a production db on our local boxes. This is the starting point. The numbered scripts are executed against this. So the actual deployment is getting tested out locally all the time. This is dead reliable, and handles tricky data transformation that would fail under a declarative/calculate approach.
Foober223··on Job choices: Big company like Google or small new startup company?
I agree with your disagreement.

But there are cases where it has paid off to be a lowly startup employee. For example google itself.

Foober223··on Ask HN: Which Bookmarking software do you use?
A text file. Viewed in Emacs with goto-address-mode.
Foober223··on Coc.nvim – Intellisense Engine for Vim8 and Neovim
Master grep. Searching is not perfect, but it's a trick that gets your petty close to any IDE feature. Find refs, go-to def. Even completion becomes possible via searches. Search to open the class/struct... boom now you can use dumb textual completions on the members.

Master your debugger. GDB? learn to use it.

You are set for life and can work on any language, anywhere, any time. Everyone wants a ready-made IDE, and it's great when it works out that way for your current dev environment. But it won't work for all languages, or for all project set ups.

Foober223··on Ask HN: CLI – Java or Python or Go?
You quote "in-house Java expertise" then recommend Go? Man that is not what you should quote, and he should use Java.
Foober223··on Ask HN: What are must know DBA concepts for developers?
On the deployment side of things...

Many developers don't get the concept of deploying a patch. They envision a script for each DB object stored in source control. Mimicking the the Java class files for all their objects. That's fine for code which can be re-built from scratch. But you can't re-build your DB, it must be patched to preserve the precious data.

It works fine for DB release #1. But when DB release #2 comes around there's no way to deploy the DB changes. Special diff tools are brought in to generate the patch. The auto generated patch drops a column.. ooops.

Foober223··on Ask HN: What sparked your interest in programming?
The movie Hackers started it all for me. 11 year old me thought it was the definition of cool.
Foober223··on John Ioannidis Aims His Bazooka at Nutrition Science (2018)
Is that racist?
Foober223··on Ask HN: What's the oldest software you still use today?
GNU grep. If you cheat and count years since the original grep it's pretty old.
Foober223··on C Macro Magic
FYI some people were taught to use an apostrophe to imply ownership. It used to be the "official" way, but no longer.

The gorilla guards it's bananas.

Foober223··on Ask HN: Would You Stay at a Boring, Well Paying Job?
Milk the cow!!!
Foober223··on Generics aren't ready for Go
An algorithm or data structure may be applied to various types of data. There's various ways to handle this. Macro expansion, generics (basically equivalent of macro expansion but as a language syntax), or losing types: void pointers, duck typing, interfaces.

Go puts it's head in the sand and and handles the problem like it's 1970 with the "void pointer" way of thinking. That's fine if you're using a dynamic language (ie python, lisp) and firmly decided your trade offs with regards to types and performance. But if you elect to use a statically typed language, it would be nice to reap the benefits.

Modern C++ is still the only way to go for serious software. Rust maybe in the future as the compilers improve. Go is a no no-go.

Foober223··on I’ve used Dvorak for 10 years, and it’s not all that
I tried dvorak for a little while. Had the same impression as most. It feels good and many letter combos flow smoothy off the fingers. But no significant gains in speed.

I switched back to qwerty for the ubiquity. Despite having no grand design behind it, qwerty gets many things right by accident. Many common letter combos bang out nicely under qwerty too.

Foober223··on This is for the fat ones: what changed it?
You lose weight by consuming less.

Cut all calories from your drinks. Water, black coffee, unsweetened tea only. Eat a reasonable sized plate of food for your meals. Favor protein and vegetables over starchy-carby-french-fryish things. Don't eat deserts. No pie, no donuts, no candy. No snacks between meals. You will look like a different person in 1 year.

Exercise improves the strength of your heart and other muscles. It even improves your nervous system. And you will look better. It's very important to exercise your body. but it's not the main driver of weight loss. You simply don't burn very many calories through exercise.

← PreviousPage 4 of 4