C
C-Sharp
Our great sponsors
C | C-Sharp | |
---|---|---|
5 | 4 | |
17,872 | 6,248 | |
1.5% | 3.0% | |
5.9 | 8.1 | |
17 days ago | about 2 months ago | |
C | C# | |
GNU General Public License v3.0 only | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
C
- what resources do you recommend for learning C ?
-
My Favorite Language has Changed to PHP
C: https://github.com/TheAlgorithms/C/blob/master/sorting/merge_sort.c
-
Algorithms by Jeff Erickson (Free algorithms textbook)
I like the awesome-algorithms link, but some of the code linked is definitely not perfect. A few questionable things from one of the header files [0] in https://github.com/TheAlgorithms/C:
- Defines a macro with no parentheses
- Uses unsigned for length and capacity (should be size_t)
- Uses () instead of (void) for an empty parameter list
- Useless use of "extern" for function declarations
- I think that leading double underscores and structures ending with _t are reserved identifiers, but I don't really have a good source for this
[0]: https://github.com/TheAlgorithms/C/blob/master/data_structur...
C-Sharp
-
Yes, PHP is faster than C#
The previous post on this blog makes another worthless comparison, this time based on lines of code:
https://withinboredom.info/blog/2022/03/16/my-favorite-langu...
> Like, look at this Merge Sort in C# [1] (130 lines) and then look at it in PHP (31 lines) [2]. You can’t beat that kind of productivity, not to mention in PHP, you can even mix data types (like ints and floats) where in the C# version, it’d be much more difficult.
[1] https://github.com/TheAlgorithms/C-Sharp/blob/master/Algorit...
[2] https://www.w3resource.com/php-exercises/searching-and-sorti...
The C# version is the first Google result for "c# merge sort". But a later result is from w3resource.com, which where the PHP code came from. That C# code is only 55 lines and could easily be shorter by replacing loops with standard library calls:
https://www.w3resource.com/csharp-exercises/searching-and-so...
Also, both versions of the code from w3resources.com are trash -- they use an O(N) step to remove an element from the front of the array (array_slice in PHP and List.Remove in C#), which makes them O(N^2 log N), which is even worse than a naive selection sort or bubble sort.
-
My Favorite Language has Changed to PHP
Well, except the better C# comparison would be this one (same place, but sorts an array, not an ISequentialStorage, which the PHP version doesn't even attempt): https://github.com/TheAlgorithms/C-Sharp/blob/master/Algorithms/Sorters/Comparison/MergeSorter.cs
-
My Favorite Language Has Changed to PHP
There's a much more sensible C# merge sort implementation in the same repo as the oddly-over-the-top one linked in the article, which is very very close to the PHP one: https://github.com/TheAlgorithms/C-Sharp/blob/master/Algorit...
What are some alternatives?
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
C-Plus-Plus - Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
Dart - All Algorithms implemented in Dart
Kotlin - All Algorithms implemented in Kotlin
F-Sharp - All Algorithms implemented in F#
JavaScript - Algorithms and Data Structures implemented in JavaScript for beginners, following best practices.
julia - Simple fractal drawing software
Java - All Algorithms implemented in Java
C# Algorithms - :books: :chart_with_upwards_trend: Plug-and-play class-library project of standard Data Structures and Algorithms in C#
awesome-algorithms - A curated list of awesome places to learn and/or practice algorithms.
Swift - All Algorithms implemented in Swift