1,673 karma · joined Sep 27, 2013 (13y ago) · 683 submissions
Software design and implementation should be a joyous art, a kind of high-level play. If this attitude seems preposterous or vaguely embarrassing to you, stop and think; ask yourself what you've forgotten. Why do you design software instead of doing something else to make money or pass the time? You must have thought software was worthy of your passion once...
To do the Unix philosophy right, you need to recover that attitude. You need to care. You need to play. You need to be willing to explore.
comment 9y ago · link · parent
Looking at the link, the second advice is that you could require users to implement special functions such as ImplementsFooer() to explicitly declare which interface they're implementing. This could help, but this practice is not present in the codebases I've seen including the Go standard library (to the best of my knowledge).
comment 9y ago · link · parent
And as there is no way to immediately see where some interface is declared and if/which interface is implemented, you have to rely on comments and resort to manual search to find out more. That may be easy in smaller codebases or worthy of effort in important codebases such as Go standard library. But all an all this ambiguity does not fit with Go's discipline to prevent human errors by making everything uniform and explicit as possible.
Just for the sake of providing an example, let's look at time.go under https://golang.org/src/time/time.go, we can see in the comments of several functions that the programmer states a particular interface is implemented. Line 1112 of the aforementioned file is as follows:
// MarshalBinary implements the encoding.BinaryMarshaler interface.
func (t Time) MarshalBinary() ([]byte, error) {
Now where is encoding.BinaryMarshaler declared? There is a package called encoding, maybe there? But the package has many many files, where would I find where BinaryMarshaler is defined? I'd have to resort to manual search. Now imagine that this is not an interface in the standard library, but rather an interface in some mediocre codebase that you're handed for the first time...Tl;dr All I'm saying is that runtime errors due to empty interfaces are not the only flaw of Golang. Interfaces as implemented in Go could in some cases present a serious threat to code structure.
comment 9y ago · link · parent
Now, I am using firefox 56 on OpenBSD, and it is really really smooth.
comment 9y ago · link · parent
In a single processed browser, ram is not an issue. I've been using 25+ tabs for many years, only recently in Chrome I experienced a low ram warning (i have 8GB). I switched back to firefox 56.
455.
10 things you (probably) don't know about Go (2012)(talks.golang.org ↗)
1 points · by terminalcommand · 9y ago · discuss
comment 9y ago · link · parent
Btw Visual Basic continues to exist under Visual Basic.NET and if you stick to the basics you could learn to write C# GUI programs pretty quickly.
I agree writing GUIs by hand is very counter-productive.
comment 9y ago · link · parent
I, myself was thinking to acquire a Ryzen 5 1600 for a high performance programming desktop. I was thinking of running FreeBSD, it's sad to hear that it's glitchy.
comment 9y ago · link · parent
For example you can define an Activity for each project, arrange your windows and settings (ie. desktop shortcuts, widgets, etc.), work on you project, then switch to a different activity. When you come back to your project, you'll continue from where you've left.
comment 9y ago · link · parent
HN also helps meto forget about my surroundings and make the time fly away. For example I usually don't recall anything about my commute, when I'm on HN. I can shut everything off if I want to.
All the crowds make me extremely stressed to the point where my hands shake. HN really helps me to get through the day. Without distractions I don't think I would be able to stay somewhat functioning.
comment 9y ago · link · parent
Most of the times all your questions will be answered by a simple google search, as there are mountains of good questions and answers on stackoverflow.
IMHO for you, getting back into programming will be as simple as opening the interpreter and starting to type.
I don't think programming has changed, the basic mentality is still the same. And nothing beats good old experience.
The new niche "trends" such as asyncronous programming, actor-based programming etc. could be easily learned by lingering on HN for a while :).
Best of luck getting back on the keyboard!
comment 9y ago · link · parent
I used to work crazy hours in workdays, on weekends I felt sick and sad. I actually wished for the stress of working at a high tempo. The downside was that I knew deep inside that the constant stress was detrimental to my health.
For years I've aimed for a work/life balance. But I am yet to achieve it. Either I work super hard, or I spend all my days procrastinating.
comment 9y ago · link · parent
I feel sad that I didn't have the opportunity to study CS. Outside of school/internships all I think about is still computers. I've been struggling with this throughout my entire college life.
My advice would be that if you're genuinely interested about something, think real hard before choosing another field of study.
comment 9y ago · link · parent
FreeBSD on the laptop has decent support, and in a couple of weeks you will learn about initrd etc. to be able to work with DragonflyBSD.
If you want to learn more about system internals, you might want to learn how to use bhyve (FreeBSD's awesome hypervisor) on FreeBSD. By trying to use bhyve you will learn how to extract the kernel from an img build, load it etc.
Have fun and good luck on your studies!
comment 9y ago · link · parent
In Smalltalk everything is an object, that is including numbers, characters etc. The standar method-lookup searches from the innermost class methods to the outermost class methods.
The method finder could simply iteratively go through all applicable methods that return the class requested and match results.
[1]: http://esug.org/data/Old/vw-tutorials/vw25/vw25ug.pdf (page 42 method-lookup)
466.
Self-referential functions and the design of options (2014)(commandcenter.blogspot.com ↗)
1 points · by terminalcommand · 9y ago · discuss
467.
Windows Assembly Programming Tutorial [pdf](www-s.acm.illinois.edu ↗)
3 points · by terminalcommand · 9y ago · discuss
comment 9y ago · link · parent
But discover weekly only gives recomendations for the dominant genre.
comment 9y ago · link · parent
Joke aside, the basics of SQL can be learned in a very short time. Before fancy ORMs all novice programmers managed to get by using SQL in big-ridden PHP projects ;). I for example, got my introduction from querying a national database leak and than writing a simple blog with tricks I've learned from sqlzoo.
comment 9y ago · link · parent
You could always upload your encrypted key database to dropbox, and keep your private key on your phone, on your computer, or on a USB stick, if you want automatic sync.
comment 9y ago · link · parent
The problem I had with BSDs was that they were slower than Linux. Especially when it came to boot times, Linux booted up in seconds due to parallel starting of system services. On FreeBSD the same machine with an SSD took nearly half a minute to boot. Some people here on HN had advised me to use a parallel system initializer, or never completely shutdown my laptop. Always keeping the laptop at sleep did not work for me, because I was (and am) very paranoid when it comes to computers, I can't sleep if my computer is not shutdown and has an ethernet cable plugged into it. Using a parallel system initializer did not work, because I was too lazy to set one up.
Battery consumption was another issue. Although FreeBSD provided decent battery life, utilities like powertop did not exist for BSD platforms.
What I liked about FreeBSD was that it was a pure OS. When I opened htop, I could see only a handful of processes running, and I knew what each process did.
On the other hand, everything required manual configuration. I basically lived in the terminal to operate my laptop. But that is probably due to my lazyness to automate and write scripts.
I'd also be interested in the differences in day-to-day life between FreeBSD and OpenBSD.
comment 9y ago · link · parent
For encapsulation and message passing, coroutines work wonders. You could use a generator in Python, or a goroutine in Golang. And then you could treat different modules of your program, as if they were a standalone independent part.
comment 9y ago · link · parent
Most network related small apps were written in C, now you can write them in Go. With the added benefit of simple libraries, memory management and goroutines. You don't have to mess arround with platform specific sockets, threading libraries etc. Plus every piece of code you open is written in understandable Go. With C, there is years of baggage, multiple standards, pre-compiled headers, undefined behaviour etc.
And lastly, new is always more exciting than old :)
comment 9y ago · link · parent
But many of the CS pioneers dealt with the issue of reading input, processing it, and giving a meaningful output. Recently I've stumbled upon Jackson's Principles of Program Design and it has really helped me in writing a parser. IMHO general understanding of structuring a program goes a long way than arbitrary design patterns. I now am a propenent of modular programming. For me it resembles functional programming and TDD. Basically it states your program should be made up of numerous self-contained modules that can be independently tested.
For data science workflow it could be an import package, further divided in modules such as general helpers and implementations for different file types; a computation package etc.
comment 9y ago · link · parent
I admit, setting up the system can be a little time-consuming. But once everything is working, it is real easy to operate.
If there are any problems, I help.
comment 9y ago · link · parent
I remember the agony I experienced when I needed to use Word365 online for a project. The javascript implementation was so slow and resource heavy that I was almost going to go crazy. Google Docs on the other hand worked fine most of the time. But none of them could replace a native MS Office or Libreoffice. Maybe with webassembly things are going to get different, but adding abstraction layers come at a cost.
Also these machines need to run videos and process pictures and maybe movies. With those requirements performance doesn't hurt.