Poll

What should I use?

C
17 (89.5%)
Go
2 (10.5%)

Total Members Voted: 19

Author Topic: C or Go  (Read 494 times)

Should I start my next project in C, which I already know, or should I go back and finish learning Go?
« Last Edit: November 05, 2019, 09:32:14 PM by Writer The Wolf »

what is the project about?

if you are making something that needs multi-threading or a web backend? go.
if its embedded/low-level development or robotics? c.

what is the project about?

if you are making something that needs multi-threading or a web backend? go.
if its embedded/low-level development or robotics? c.
It honestly doesn't matter too much which it is in this case. There are advantages and disadvantages to either.

The biggest things with C are that I already know it, so it's fairly easy for me to work with it. It's also very fast, and light, so long as you're smart with your code.
But C is, of course, quite low-level, and a challenge to use for anything overly complex.

Go would be great for taking the headache out of multiprocessing and memory management. It's also still quite fast, and has type-safety and out-of-box object-oriented functionality.
But I'd have to learn a whole new language and formatting style. Plus, it's still so new, there's nowhere near the reference material or dev community of C which is approaching 50 years old (but still remains incredibly powerful and widely used).

It's really just me deciding whether to go with what I know, or take the time with something new.
I can't decide, so this is my coin-flip.

I had also considered Rust, but decided I'd rather not for now. I've at least looked at Go before, whereas Rust would mean starting from the ground up.

I mean in the sense that the two languages are used for completely different things in terms of what kind of libraries are available and stuff.

it's like comparing java or C for mobile development, obviously, you would pick java because that's the supported language for android and you literally can't make apks in C

it just depends on what you are doing

it sounds like hes coding for fun/to make some sort of applet. Go would be a lot less finicky to work with cause you dont have stuff like segfaults or manual memory management, unless you specifically choose to use it. go’s also quite fast so its not like c vs java/c#, and the style of programming matches C pretty closely as well.

id say if getting the project complete/done as well as possible is important to you, only use what you’re familiar with. but if you’re doing it to try something new or expand your skillset, then using and learning go would probably be better.

I mean in the sense that the two languages are used for completely different things in terms of what kind of libraries are available and stuff.

it's like comparing java or C for mobile development, obviously, you would pick java because that's the supported language for android and you literally can't make apks in C

it just depends on what you are doing
I chose the options I did, knowing that, for my use, it wouldn't matter too much either way.
it sounds like hes coding for fun/to make some sort of applet. Go would be a lot less finicky to work with cause you dont have stuff like segfaults or manual memory management, unless you specifically choose to use it. go’s also quite fast so its not like c vs java/c#, and the style of programming matches C pretty closely as well.

id say if getting the project complete/done as well as possible is important to you, only use what you’re familiar with. but if you’re doing it to try something new or expand your skillset, then using and learning go would probably be better.
It's a system utility. I actually printed the entire POSIX XCU as a reference for implementation (For this and for future reference). Pretty sure my printer hates me now. Even if I did clean the roller that was causing it to jam.
While I am doing it for fun, I also have a specific goal in mind (Call it an experimental concept).

Either way there will be a learning curve for what I'm doing. It'll just be a bit different depending on the language I end up using.
In the end, I will have a lot to learn. And I expect that, either way, I'll come out a better programmer than I was going in.




neither: python
This wouldn't be a great choice, for a number of reasons.

If I were building a high-level user utility where I wanted to be able to build it quickly, or if I were writing heavy automation, or back-end scripting for a website, or any number of uses where execution speed isn't necessarily the highest concern, then python would be a great choice.
Really, it's just not as conducive to what I'm doing. It's absolutely possible to do it in python, and I have, in fact, seen it done, but the only way to make it practical would either be to use a JIT compiler, which I can't assume the target environment will have (I can't even assume it will have python), or to compile to a binary, which, while possible isn't something that is quite as straightforward in python.
Meanwhile there are plenty of other languages that will work great for what I want to do, without making assumptions about the target environment, or messing about with any of the slue of python compilers that exist in various states of functionality.

It's more of a "right tool for the job" situation where python is concerned.

if you don't think the platform will run python why would it have a go compiler homie........... C is practically the only language that's a given on any architecture

if you don't think the platform will run python why would it have a go compiler homie........... C is practically the only language that's a given on any architecture
The issue isn't in assuming if it can run python, but that python will even be present on the system.
You can always cross compile, but this program should be able to execute in even a minimal environment.

Also, I should mention, there's a go compiler for the gcc toolchain, so any system that can run gcc can, in theory, compile go.
« Last Edit: November 08, 2019, 12:29:15 AM by Writer The Wolf »

if you don't think the platform will run python why would it have a go compiler homie........... C is practically the only language that's a given on any architecture
python is literally cancer to write anything bigger than 5 line scripts in

python is literally cancer to write anything bigger than 5 line scripts in
ok slut

anyway needless to say choose C. go is a google thing which means they'll stop supporting it in five years

anyway needless to say choose C. go is a google thing which means they'll stop supporting it in five years
Except for the fact that now the language has a specification and a userbase, so now it's entirely out of their hands.

Look at Objective-C. Apple has been trying to push people to transition away from it for years now, but people already know it, and the specification exists.
Hell there's an Objective-C compiler as an official part of the GCC and LLVM toolchains!

Once a programming language has been described in an official capacity, it's not as simple as dropping support for it. If it where, we probably wouldn't still have Cobol or Fortran compilers.
Go's not going anywhere, any time soon.
« Last Edit: November 09, 2019, 09:07:25 AM by Writer The Wolf »