|
Providing bare recipes is fine! And just explain that "This code illustrates the bare necessities. In a real system you must do 1,2,3,4 ... error handling, logging, better modularisation, ..., ..., ...
"
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
Well, yes expect the recipes in this case often require modification, not just addition. It's cut-to-fit like I said - one of the downsides of no frameworks and disparate hardware.
Real programmers use butterflies
|
|
|
|
|
I started reading this book, The Go Programming Language, The (Addison-Wesley Professional Computing Series) 1st Edition (Donovan & Kernighan)[^], on a whim, just to see what Go was all about and now I'm discovering how nice the language is.
Interestingly, this book will remind you of the old book K&R C (and Brian Kernighan is one of the authors).
Here are a couple of interesting things that Go does:
1) makes it very easy to build to a native Exe --
a) on Linux you can just do
$ go build hello.go
That will build the native exe named hello and it even handles making the file executable (no need to run chmod 777)
b) There's not a huge toolchain to learn. Just use the Go command. it's kind of nice.
2) Go is "smaller" and so it feels like the days of past when you could actually wrap your head around a language instead of feeling like you could never learn it all.
3) It makes retrieving data over HTTP much easier than other languages -- more like just opening a file.
4) It cleans up concurrency issues / makes them easier to handle
It feels like learning a language that keeps you focused. Sometimes stuff is so huge now that you are going in a million directions with various tech like CSS, HTML, JavaScript, Angular, TypeScript.
Now, I'm just interested in why I might choose Go over something like Rust (or vice-versa).
Have you tried out Go? What have your experiences with it been?
modified 6-Dec-20 15:07pm.
|
|
|
|
|
|
That’s another positive about learning Go : you can get tools installed quickly and try it out with low impact. Probably get it set up in 5 minutes if you already have VS Code.
That’s a nice list on that slant url.
|
|
|
|
|
I see that list has 'CON no GUI Designer' .. yet I don't think that's actually a CON - Go is good at what is is intended for, and as far as I'm led to believe, that doesn't included GUI's anyway - we all know there are better languages for GUI's/Front-Ends
|
|
|
|
|
That's true, but a lot of (old farts) like me are used to having a GUI designer, guess it all depends what purpose you will be using a language for ...
|
|
|
|
|
Of course you are referring to VB6
|
|
|
|
|
raddevus wrote: (no need to run chmod 777)
There never is. chmod a+x would be a better choice.
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Haha I always forget my chmod values.
I was trying to say make it exe for everyone.
These are the things I’ve googled for 15 years.
I’m terrible about memorizing things. Let the internet remember for me.
|
|
|
|
|
raddevus wrote: I’m terrible about memorizing things. Let the internet remember for me. “Never memorize something that you can look up.”
― Albert Einstein
I have bad memory for some things too... I have always used this quote everytime that I forgot a formula or something like that.
The "kiss my ass" variation when someone was trying to piss me off was:
I prefer to use my brain understanding things, because I can always look up what I forget. In your case is more difficult
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Another relevant one : "Quote: It is better to understand something than to memorize something. - Neil Degrasse Tyson
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Nice...
I didn't know about that one. It was exactly my point
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Not memorizing the drwxrwxrwx mask is like not memorizing the syntax of a while loop: yes you can always look it up, but is it worth to look every time that you have to write a while?
Besides, the syntax
chmod a + x
All add eXecution
o - w
Others Remove Write
is easier than remembering even the drwxrwxrwx mask since they are pretty simple declarations of intent.
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
|
Quote: I’m terrible about memorizing things When I (for some reason) did a Law degree, one of the first things they taught us was not to memorize things but to learn how to look them up when needed. Which was fine except the exams required us to memorize things!
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
� Forogar � wrote: they taught us was not to memorize things but to learn how to look them up when needed. Which was fine except the exams required us to memorize things!
That's Academia for you: Paradoxical Situations.
Do as your told, not as you think, but make sure you think for yourself.
|
|
|
|
|
|
PIEBALDconsult wrote: Will it do .net ?
I'm not sure. I don't think so, but there is IronPython[^] so...
|
|
|
|
|
I have never understood how you can program anything by placing white and black stones on a board...
|
|
|
|
|
Rage wrote: I have never understood how you can program anything by placing white and black stones on a board...
Yes, it is a challenge, but it's all binary, I guess.
|
|
|
|
|
raddevus wrote: makes it very easy to build to a native Exe --
And also very, very, very easy to cross-compile native EXEs. Want to compile for Windows as well as Linux? Here you go:
GOOS=windows GOARCH=amd64 go build hello.go
Or a Raspberry Pi?
GOOS=linux GOARCH=arm go build hello.go
Having said that... I'm not so keen on Go. Mainly because of:
- Error handling. I just don't like the way they do it, with a pair of error/return value. I prefer the Rust way, having a tagged union that is either error code or return value.
- Type system. Not just a lack of generics - I like the flexibility that sum types give you.
This article also resonates with me...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yeah, the ease of building native exe is amazing.
Stuart Dootson wrote: I'm not so keen on Go. Mainly because of
Those are the main complaints I've heard elsewhere also. I wonder if it has quashed the interest in Go and if the language is already waning?
|
|
|
|
|
Quote: This article also resonates with me...
That article is a really unfair comparison designed specifically to make Rust look good. It is a large bit of Rust hype that is mostly garbage.
1. The author complains about how changing permission bits in Go under Windows doesn't change anything on the NTFS filesystem, but then praises Rust for not being able to do it at all on *any* system.
2. The author complains that Go doesn't handle invalid filenames with broken UTF8, and praises Rust for handling that, except that Rust doesn't handle that on Windows anyway.
TLDR: When Go handles failures on Windows gracefully by doing the only sensible thing, the author complains that it is broken and praises the Rust way of doing it (breaking completely).
When Rust breaks down on Windows the author praises Rust for doing something halfway sensible, and complains that Go should match the Rust bug.
The article is not one of a fair comparison. A fair comparison would be performing each tested feature on both mentioned OSes and tabulating the result, NOT doing different "tests" for each language so that your preferred language looks better.
|
|
|
|
|
No - the author is highlighting how he feels Go's design is slapdash and thrown together. Go presumes that all systems have Unix permissions - they don't. Rust presents portable functionality (is the file readonly?) in the common module, then also has a Unix specific module for full permissions.
I think it's highlighting a difference between attitudes - you say that Go "handles failures on Windows gracefully on Windows by doing the only sensible thing", whereas Rust "breaks completely". I, on the other hand, would see the only sensible thing as highlighting an error condition that needs to be handled, probably at a higher level of abstraction in the program.
I've written substantial programs in both Go and Rust. I have less confidence that the programs written in Go will handle unexpected situations gracefully.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|