[Return] [Catalog]

1 guest@cc 1969-12-31T17:00:00
Here's an example of what's wrong with software today.

* https://github.com/laneb/congruence_solver

Some guy made a program that takes an equation and tries x=1,x=2,x=3,.. up to some limit to check if it can solve it.

Like, the entire computation is literally a for loop.

That's fine but let's see what he did to acheive this goal...
»
2 guest@cc 1969-12-31T17:00:00
First of all. The toplevel directory is like this:

* .gitignore
* .gitmodules
* .rspec
* .travis.yml
* README.md
* Rakefile
* congruence_solver.gem

bunch of weird git config files.

.rspec file is this:

--color
--require spec_helper

what the fuck is that? why is that here?

travis.yml is some kind of automatic testing thing.

then you have Rakefile which is some kind of ruby DSL makefile replacement. Then the .gem thing is another ruby DSL that describes it as a package.
»
3 guest@cc 1969-12-31T17:00:00
Now lets look inside the folders, we have: bench, bin, lib, ext, spec.

bench: seems to run the solver many times in a row and time it. utterly pointless.

bin: has a weird setup script with some queer bash hacks: set -euo pipefail; IFS=$'\n\t' that someone probably used at some point to install the program? not anymore though since its a gem. Also has csolve.rb the main binary, does the arg parsing and then calls the main program procedure (the for loop thing). Cool.

lib: Now we have the actual core algorithms in here. polynomial_interpreter.rb this is actually parsing (using regexes).. does evaluate polys as you might expect. Then we have congruence solver which just says "# Your code goes here...". What? Some weird OO thing where the code is defined elsewhere? Inside a subdir we have this too:

module CongruenceSolver
VERSION = "0.3.0"
end

great.

ext: oh okay. So code goes *here* https://github.com/laneb/congruence_solver_ext it's a completely sepearate git repo. It's the core algorithm (the for loop we're after) but it's in C now. For speed I guess? Since he benchmarks. There is not a lot of point optimizing counting to 100 on a computer but ok.
There is a whole bunch of complicated code in here involving allocating lists of prime numbers and shit.

spec: This is actually a test suite, could not call this a specification. It's well written tests over two files. Then there's a weird "test helper" script which is 100 lines long mostly comments.
»
4 guest@cc 1969-12-31T17:00:00
I mean here's what the program does

INPUT: x^2 + 2x + 1 = x^3 + 3x^5 mod 49
OUTPUT: 1, 8, 15, 22, 26, 29, 36, 43

but how many fucking lines code is there to do this? You could make this in a half page in any high level language yourself.
What's the point of all the bloat and frameworks and just general needless garbage all around the place.
I would rate this code very low. It's all written fine but there's so much there that shouldn't be. Perfect is when there is nothing left to take away. What this does can be acheived in 1/200th the amount of code. That will mean less space for bugs to creep in too.
»
5 guest@cc 1969-12-31T17:00:00
I guess this is similar to why I avoid GUI code editors. Once I realized I could just write a simple 1 file program in any text editor and tell gcc to spit out a binary I never wanted to go back to the GUIs that would put everything into "projects" with a whole bunch of extra useless files that overcomplicated things.
»
6 guest@cc 1969-12-31T17:00:00
>>5
yeah, plain text is the best

#textpunk
»
7 guest@cc 1969-12-31T17:00:00
>>5
I don't use IDEs either, but you can't go very far with a single source file. And then you have to deal with cmake and other overcomplicated shit like that, which add about as much bloat as an IDE would.

It sucks, but there's just no way around it.
»
8 guest@cc 1969-12-31T17:00:00
After reading all this, I have to say, what made you so angry? This obviously seems like a beginning programmer, there's only four projects in his repo and three of them are congruency solvers, and the last one is him experimenting and trying to learn how to implement basic cryptography algorithms. He's probably trying to figure out the framework for working on a larger scale by working on small projects first. I think you're going out of your way to make yourself angry here.
»
9 guest@cc 1969-12-31T17:00:00
itt we're mad about metadata and practicing project management
»
10 guest@cc 1969-12-31T17:00:00
>>6
did you say TEXT?

https://www.youtube.com/watch?v=OQxmKlPsJG0
»
11 guest@cc 1969-12-31T17:00:00
>>10

man it doesn't count if you only use block and dithered block

still cool though
»
12 guest@cc 1969-12-31T17:00:00
>>11
We should make our own demo for the next TMDC, who's in?
»
13 guest@cc 1969-12-31T17:00:00
>>12
First time I've even heard of that. You might get some interest though if you can suggest an interesting concept for it.
»
14 guest@cc 1969-12-31T17:00:00
>>13
We could do some sort of OtoMAD in /jp/ style, it could work as long as it's not too repetitive and we make it look good.
»
15 guest@cc 1969-12-31T17:00:00
>>12
I'm interested.

>>14
The rules state that we need to own the copyright of everything in it though.
»
16 guest@cc 1969-12-31T17:00:00
>>15
That's extremely limiting. I don't have any original creative content
»
17 guest@cc 1969-12-31T17:00:00
>>15
>>16

What about something 2hu related? ZUN's terms of use seem pretty loose:

http://en.touhouwiki.net/wiki/Touhou_Wiki:Copyrights
»
18 guest@cc 1969-12-31T17:00:00
>>17
I was thinking that too, but wasn't sure of the wording in the contest rules. I just looked and it says
>own (or have access to) copyrights

and I think we definitely have access. Also according to the translation of ZUN's terms of use on that link
>The copyright of derivative works belong to the creators of said derivatives.

So I guess we would technically own it anyway.

So I think we're in business. Someone want to start a new thread for it or something?
»
19 guest@cc 1969-12-31T17:00:00
>>17
In that case, it sounds good to me.
»
20 guest@cc 1969-12-31T17:00:00
zenity: https://help.gnome.org/users/zenity/stable/index.html.en

this is fucking awesome, let's making something fun with it!
»
21 guest@cc 1969-12-31T17:00:00
>>20
Like what?
»
22 guest@cc 1969-12-31T17:00:00
>>20
>fun dialog boxes


ok...
»
23 guest@cc 1969-12-31T17:00:00
>>22
you've got more imagination than that!
»
24 guest@cc 1969-12-31T17:00:00
>>1,4
The project is written in ruby, which is optimized for modern computers.
Which means that because of the abundance of resources it is not optimized at all.
»
25 guest@cc 2019-05-04T19:53:11
>>5
Yeah. Work buddies keep making projects with bunch of useless files. Really bad, keep trying to force me to use an IDE.

[Return] [Catalog]
Delete Post:
OptionsPassword
Name
Comment
File