Bitcoin Forum
June 17, 2024, 01:51:36 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 [4] 5 »  All
  Print  
Author Topic: Bitcoin source code is a giant mess  (Read 10718 times)
jdbtracker
Hero Member
*****
Offline Offline

Activity: 727
Merit: 500


Minimum Effort/Maximum effect


View Profile
June 12, 2013, 02:52:57 PM
 #61

So what would be the ideal programming language to build Bitcoins succesor?

If you think my efforts are worth something; I'll keep on keeping on.
I don't believe in IQ, only in Determination.
hf
Member
**
Offline Offline

Activity: 98
Merit: 10


there will be no fucking vegetables


View Profile
June 12, 2013, 03:05:08 PM
 #62

Go.
grau
Hero Member
*****
Offline Offline

Activity: 836
Merit: 1021


bits of proof


View Profile WWW
June 12, 2013, 03:05:45 PM
 #63

Java was already a step forward.

The next time I would consider Scala as it runs on JVM is OOP and is functional.
Lohoris
Hero Member
*****
Offline Offline

Activity: 630
Merit: 500


Bitgoblin


View Profile
June 12, 2013, 03:33:20 PM
 #64

Java was already a step forward.
SBROFL.

Java is a terrible step backward, it's a total mess, manages to overcomplicates everything both over modern+higher level languages, AND over C/C++ themselves.

1LohorisJie8bGGG7X4dCS9MAVsTEbzrhu
DefaultTrust is very BAD.
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
June 12, 2013, 03:56:07 PM
 #65

Whilst I am an advocate of C++ (and don't see any reason to change the language at all) I think in any case the importance is the choice of algorithms and design patterns not the language itself.

Any language that provides the correct semantics with reasonable enough performance and is readable should be acceptable.

BTW - all the C++ haters should have a list of bugs that *crash* the bitcoin-qt client (and lose people BTC) - could we have a list please just so we have an idea of how *broken* it actually is?

(and if it is not broken then why are people arguing it *needs* to rewritten in another language?)

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
jdbtracker
Hero Member
*****
Offline Offline

Activity: 727
Merit: 500


Minimum Effort/Maximum effect


View Profile
June 12, 2013, 04:04:06 PM
 #66

I'm just asking, I wanted to try to learn a new language and build a Bitcoin clone with extra features that the language can provide, just extra features or flexibility.

If you think my efforts are worth something; I'll keep on keeping on.
I don't believe in IQ, only in Determination.
grau
Hero Member
*****
Offline Offline

Activity: 836
Merit: 1021


bits of proof


View Profile WWW
June 12, 2013, 04:13:58 PM
 #67

Whilst I am an advocate of C++ (and don't see any reason to change the language at all) I think in any case the importance is the choice of algorithms and design patterns not the language itself.

Any language that provides the correct semantics with reasonable enough performance and is readable should be acceptable.
+1

I do not hate C++.

I think that there are languages that better support good design patterns, readability, code quality and have a performance that is acceptable. That does not mean there would not be any C++ code that has the right patterns, readability and quality.

In case of bitcoin quality and performance is high because of high effort of highly capable people committed to it. It however does not have the right patterns and is not well readable.

CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
June 12, 2013, 04:21:59 PM
 #68

In case of bitcoin quality and performance is high because of high effort of highly capable people committed to it. It however does not have the right patterns and is not well readable.

So then I think that *fundamentally* what we are really looking at identifying is which are the *wrong* patterns and how they should be reworked and also how any *unreadable* code should be changed to make it more readable.

This would be a much more productive direction than just having a "language war" (which never gets anywhere that I've seen in following such things since using Usenet back in the early 90's).

(I also don't think that Bitcoin should be *exclusively* C++ as I do support the idea of eventually there being a Bitcoin protocol RFC type document that *could* be implemented in any decent language).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
jubalix
Legendary
*
Offline Offline

Activity: 2618
Merit: 1022


View Profile WWW
June 12, 2013, 04:39:22 PM
 #69

heretical as it is

I think goto's are fine, they are just unfashionable

but fast and handy.


Admitted Practicing Lawyer::BTC/Crypto Specialist. B.Engineering/B.Laws

https://www.binance.com/?ref=10062065
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
June 12, 2013, 04:50:22 PM
 #70

I think goto's are fine, they are just unfashionable

but fast and handy.

In C they can indeed make sense - but in C++ they present problems that the language itself does *not* provide guarantees for (in regards to safe exception handling).

So in C++ "goto" really is a "no no" (for error handling as the "goto" in this topic was originally referring to you should just use a "throw").

The *only* reason that *goto* was not *dropped* as a keyword from C++ was to keep backwards compatibility as much as possible with C.

So "fast and handy" they maybe - but in C++ they are 100% *wrong* (as any exception handling would get *screwed* by the *goto* as the language does not cater for this situation).

It goes the same for "setjmp" and "longjmp" (guess most don't remember those) - they can also *not* be used safely in C++ apps.

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
hf
Member
**
Offline Offline

Activity: 98
Merit: 10


there will be no fucking vegetables


View Profile
June 12, 2013, 05:36:10 PM
 #71

+1 CIYAM. To add to your good and explanative post, we could add that the main *good* usage of goto in C is for error handling, or to rephrase : to compensate for the lack of ... exceptions. Exception handling being provided by C++, there's no good reason to use gotos in C++ anymore.
kokjo
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000

You are WRONG!


View Profile
June 12, 2013, 06:01:10 PM
 #72

+1 CIYAM. To add to your good and explanative post, we could add that the main *good* usage of goto in C is for error handling, or to rephrase : to compensate for the lack of ... exceptions. Exception handling being provided by C++, there's no good reason to use gotos in C++ anymore.
gotoes are directly dangerous in C++.

"The whole problem with the world is that fools and fanatics are always so certain of themselves and wiser people so full of doubts." -Bertrand Russell
Trongersoll
Hero Member
*****
Offline Offline

Activity: 490
Merit: 501



View Profile
June 12, 2013, 06:01:24 PM
 #73

Isn't this open source? anybody can rewrite the code in any language that they want.
kokjo
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000

You are WRONG!


View Profile
June 12, 2013, 06:17:27 PM
 #74

Isn't this open source? anybody can rewrite the code in any language that they want.
... but the satoshi client is still official community approved and most well tested client, so nobody gonna use it unless rewrite is very good, or suits there specific needs.

"The whole problem with the world is that fools and fanatics are always so certain of themselves and wiser people so full of doubts." -Bertrand Russell
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
June 12, 2013, 06:17:48 PM
 #75

Isn't this open source? anybody can rewrite the code in any language that they want.

It definitely *is* open source but not just *anybody* can rewrite the code - to do that you would need to understand not just the C++ language (which I don't think anyone here is arguing is easy itself) but also boost (a big library which I actually don't use) as well as the other libraries that are being used in the project.

Even the devs themselves missed the subtleties of BerkleyDB that led to the temporary "hard-fork".

In short - no-one is going to come up with a 100% compatible Bitcoin equivalent in another language without a *lot* of work (a point that has been argued in various other threads - the problem was that Satoshi wrote the spec *after* he wrote the code).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
Trongersoll
Hero Member
*****
Offline Offline

Activity: 490
Merit: 501



View Profile
June 12, 2013, 06:55:56 PM
 #76

Isn't this open source? anybody can rewrite the code in any language that they want.

It definitely *is* open source but not just *anybody* can rewrite the code - to do that you would need to understand not just the C++ language (which I don't think anyone here is arguing is easy itself) but also boost (a big library which I actually don't use) as well as the other libraries that are being used in the project.

Even the devs themselves missed the subtleties of BerkleyDB that led to the temporary "hard-fork".

In short - no-one is going to come up with a 100% compatible Bitcoin equivalent in another language without a *lot* of work (a point that has been argued in various other threads - the problem was that Satoshi wrote the spec *after* he wrote the code).


so, anyone with the time, the knowledge, and the desire can rewrite it in any language.  as for it being used. I don't see that being an issue. It doesn't mean that it can't be done.
Aido
Sr. Member
****
Offline Offline

Activity: 248
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
June 12, 2013, 08:42:09 PM
 #77

   
[ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
razorfishsl
Sr. Member
****
Offline Offline

Activity: 399
Merit: 250


View Profile WWW
June 12, 2013, 11:36:26 PM
 #78

+1 CIYAM. To add to your good and explanative post, we could add that the main *good* usage of goto in C is for error handling, or to rephrase : to compensate for the lack of ... exceptions. Exception handling being provided by C++, there's no good reason to use gotos in C++ anymore.
gotoes are directly dangerous in C++.

And a Jump table is what?

High Quality USB Hubs for Bitcoin miners
https://bitcointalk.org/index.php?topic=560003
Trongersoll
Hero Member
*****
Offline Offline

Activity: 490
Merit: 501



View Profile
June 12, 2013, 11:56:10 PM
 #79

Ok, this is getting nuts. there is nothing inheritantly wrong wrong with goto. the problem is that not everyone uses them responsibly. there once was a time in history when poor use of goto created what was called "spaghetti code" where people used goto's to jump into the middle of functions and such all over the place. this made the code hard to read and costly to return. This caused the stigma on goto. Structured Programming using accepted constructs becae the norm.

For any company paying to have code developed, Maintainability became the mandate. Arguing about goto accomplishes nothing. if you are coding for free, do what ya want, go ahead, develop bad habits. Somebody will make you confrom sooner or later.  the US Gov. spent hugh sums getting ADA developed and used to encourage a common structured, readable language. Today, ADA isn't so popular, i suspect because the rebels couldn't do what ever they wanted.

The thing to do if you are coding for public consumption is to write and document your code as if the next person isn't as smart as you and what is clear to you may not be clear to them. Do this and you'll be a successful Professional Programmer/Software Engineer.
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
June 13, 2013, 02:49:41 AM
 #80

And a Jump table is what?

It is not part of the C++ language (so not relevant to this discussion).

Understand that the main evil in coding goto is the possibility of it leading to undefined behavior which does not have to be reported by the compiler (same as something like a[ i ] = i++; which compilers are not likely to give you any warning about).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
Pages: « 1 2 3 [4] 5 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!