What is your favorite programming language, and what are the best things and worst things about working in it?
For further actions, you may consider blocking this person and/or reporting abuse
What is your favorite programming language, and what are the best things and worst things about working in it?
For further actions, you may consider blocking this person and/or reporting abuse
Soloudo Uzoukwu -
Hana Sato -
Antonio | CEO at Litlyx.com -
Balraj Singh -
Top comments (16)
It's a tough call between C# and Dart. But I think C# has the edge.
The good
The bad
I'll start with Ruby
The Good Parts
The Bad Parts
Rust
The good
null
.Result<T, E>
and?
operator allows you to easily propagate errors (so you get best of the both worlds). Edit: there is apanic!
which is similar to exceptions in it's behavior but it's used for non-recoverable errors only (see my comment below)The bad
I'm a bit of a Rust newbie, but some of the "good" things seem like semantics. Maybe you can correct my thinking here?
The compiler throws a ton of exceptions, Rust is famous for it. And there's
panic!
, which in my experience is more common than advertised.But there is
None
, which doesn't seem that different to me. Is there a difference in the way you handle a nullable value in another language (sayint?
) and the way you handle optional values in Rust (likeOption<isize>
)?I agree with your other points. Rust is my favorite language for performance-sensitive scripts, and I'm always happy to see things being rewritten in it.
What I wanted to say is that there are no exceptions in the same sense there are in other languages (like Java, C++ or C# for example).
panic!
exists but is used for non-recoverable errors (and while technically it is possible to catch a panic with catch_unwind it's not guaranteed you'll be able to do it). Basically, try / catch mechanism has been replaced by introducing error handling byResult
.Returning
Result
allows you to have information about functions that could fail ingrained into the type system, forcing you to act on it. But I understand that this could lead to confusion for beginners so I'll edit my comment.None
andnull
are not the same thing.Option<T>
type is in fact an enum which could only beSome<T>
orNone
, therefore everything that could be done with other enums could be done withOption<T>
- you can match on it and there are several built-in functions likeand_then
orunwrap_or
for more granular control.null
on the other hand basically means null pointer or a pointer that does not point to any valid object. While modern languages like Kotlin do introduce optional types, they won't prevent you from having uninitialized variables, because you need to useString?
instead ofString
to ensure you don't end up havingnull
. In Rust, this is prevented by ensuring every variable must be initialized before it's used. Whether you have anOptional<i32>
ori32
, you need to initialize it first.So, while they may seem as the same thing,
null
andNone
are not the same.Keep in mind that things I wrote are focused on the safe Rust. Unsafe Rust, on the other hand, is a different beast and topic for itself; there is for example
std::men::MaybeUninit
for wrapping possibly uninitialized instances.I don't know if I have a favourite programming language... For sure I have ones I use more often than others and some that are my go-to for specific project types or even just the hacky-get-something-processed-quick-and-throw-away-to-the-misc-folder projects.
That being said... I will pick the top one I do the most work in these days: The Dread-Language: JavaScript!
Good Bits (not the book)
Not to very good parts
this
reference, howvar
differs fromlet
not only in allowing redefinition, but in hoisting behaviour.Often I jump to JS to do some quick processing of lists or data or try out an algorithm, or some meta-programming task.
Is it a favourite? Not really, there are a ton of flaws and reasons to choose something else. But it is handy, its there and it's good enough for most of the stuff I use it for.
Great summary.
Backwards compatibility has got to be the best and worst thing about JavaScript (and the web in general). On the one hand, if your website worked in 2008, it will probably always work, with minor exceptions for non-core technologies like Flash and ActiveX. On the other hand, our grandkids will probably still be seeing
"use strict";
and wondering whyNaN !== NaN
.When you spend time working with any other platform, you come to appreciate "don't break the web." But then you come back to JavaScript and start to wish we could break just one or two old websites by getting rid of things like "null and undefined both exist and don't mean the same thing" or "0 is falsy, so you can't null-guard a number using
!
".Go
The Good
go fmt
orgofmt
)The bad
why backed by Google are both Good & bad?
Depends on your perspective. It helped with giving Go a huge community (pro), but there are plenty of people trying to "DeGoogle", which means for them, it's a con.
You Know, google has many failed or forgotten projects.
I wrote this about Java. I think a lot of people write bad stuff about Java so it's important to highlight some of the good stuff.
C#
Good parts: LINQ and async support. Love it
Bad parts: Many alternatives for the same task :/ For example,
Microsoft Stack (VB.NET, C#)
Pro:
Cons:
Of course it's javascript, what else could it be?
PROS
CONS
Worst thing: there are not many jobs for juniors. The language: Elixir.