News for hackers. Stuff that matters.

Bambo

Ask HN: What are your top 3 coolest software engineering tools?

Let's start a discussion about cool tools we use in software engineering that others might not know about, here's my top 3. 1) BitBucket's CI/CD pipelines - For running various tests and checks on code when a commit is made. [1] 2) CTest - Automated C/C++ testing. [2] 3) Arduino-CLI - For Arduino testing. [3] What's yours?Links: 1)...

( Read More... | 1 comment | 2 points | on HN )
Re:Show HN: GNU Indent – CLI code formatting on Monday October 17, 2022 @03:56AM (#33230848)
I'm not sure if it is actively maintained, but another option for formatting C code is https://clang.llvm.org/docs/ClangFormat.html
Re:Ask HN: Best way to learn C++ in 2022 on Monday October 10, 2022 @11:51AM (#33152937)
A good way to learn more is to search for books about topics you're interested in e.g.; sqlite, zeromq, google testing libraries, opengl...

1. https://www.amazon.co.uk/Design-Patterns-Object-Oriented-Add...

2. https://www.oreilly.com/library/view/using-sqlite/9781449394...

3. https://www.glprogramming.com/red/

4. https://gameprogrammingpatterns.com/

5. https://zguide.zeromq.org/

Re:Show HN: Embedded Ring Buffer C++98 on Sunday June 06, 2021 @06:58AM (#27412234)
Looking for CC, advice and bugs!
Re:Ask HN: What is a good alternative to Clean Code? on Thursday May 27, 2021 @05:49AM (#27301006)
"The Pragmatic Programmer" is much more detailed.
A problem with the chunk system is that i don't know how big a chunk is at the time it's declared?
I like to apply the things i learn and enjoy how they change the way i work or do tasks!
Re:Show HN: Design by Contract (tm) – C++ on Monday December 14, 2020 @03:41PM (#25422984)
You can't implement the assertions at compile time since they are predicates evaluated at runtime. This is also why it is a performance hit on the code. I chose to use C-style macros because it is easier to debug than templates.
Re:Show HN: Design by Contract (tm) – C++ on Monday December 14, 2020 @03:33PM (#25422892)
Yes OLD stores the value of the variable before the execution of the DO.

This is because all of the virtual methods that have been overriden are visited in order to gather their assertions, but not execute their DO(). So while the assertions are being collected it also collects OLD() values which then can be tested at the called virtual method in its ENSURE() clause.

OLD is a complicated mechanism to implement in C++ because it requires saving current variables at the same time deferring the code to be executed.

Using the OLD() and ENSURE() (along with the other) clauses together, is described as subcontracting where subclasses "require less" and "ensure more", given in the https://en.wikipedia.org/wiki/Object-Oriented_Software_Const... (first edition).

Re:Show HN: Design by Contract (tm) – C++ on Monday December 14, 2020 @03:23PM (#25422763)
The exception throwing is a compromise, it allows you to view the stack trace in an IDE to find out which assertions failed.
Re:Ask HN: Essential skill needed to be a programmer? on Wednesday October 07, 2020 @02:25PM (#24711120)
Imagination, to come up with solutions!
Re:Ask HN: What did you make during lockdown? on Sunday June 21, 2020 @01:33PM (#23593593)
I learnt C++!
Re:Tell HN: C Experts Panel – Ask us anything about C on Tuesday April 14, 2020 @11:08AM (#22866901)
What is your favourite design pattern?
Re:SeaMonkey 2.53.1 on Friday February 28, 2020 @11:23AM (#22443858)
My windows defender indicates this has malware in the download.
Encryption!

Older »