Skip to content

Yusup R. - #10

Closed
Yusuprozimemet wants to merge 2 commits into
HackYourAssignment:mainfrom
Yusuprozimemet:main
Closed

Yusuprozimemet wants to merge 2 commits into
HackYourAssignment:mainfrom
Yusuprozimemet:main

Conversation

@Yusuprozimemet

Copy link
Copy Markdown

No description provided.

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown

📝 HackYourFuture auto grade

Assignment Score: 0 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 0
🧪 The auto grade is experimental and still being improved

Test Details

@rafaelhdr
rafaelhdr requested review from rafaelhdr and removed request for rafaelhdr April 8, 2026 06:19
@rafaelhdr rafaelhdr self-assigned this Apr 8, 2026

@rafaelhdr rafaelhdr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job in this exercise 👏

Your code is very easy to read. I had just some small suggestions.

Comment thread task-1/queries.sql
SELECT b.title, b.published_year
FROM books b
JOIN authors a ON a.id = b.author_id
WHERE a.first_name || ' ' || a.last_name = 'Stephen King'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is not necessary to create the author full name. AND would be better, because databases could even use some performance improvements

- WHERE a.first_name || ' ' || a.last_name = 'Stephen King'
+ WHERE a.first_name = 'Stephen' AND a.last_name = 'King'

Comment thread task-2/src/database.js
const aSingleDeck = db.prepare('SELECT * FROM decks WHERE id = ?').get(id);
if (aSingleDeck) {
return aSingleDeck;
} else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good, but you don't need the else here. It is fine tho, because this is small, but it would be nice to take a quick look in the pattern of early return.

https://dev.to/eddiegoldman/early-return-vs-classic-if-else-a-universal-pattern-for-writing-cleaner-code-1083 (this was the first result of a quick search)

But it is something nice. When you have many if ... else if ... else, it makes your code more clean :)

Comment thread task-2/src/migrate.js
// Insert all cards from JSON into database
const allCardsFromJson = parsedJsonData.cards;
for (const eachCard of allCardsFromJson) {
let learnedValue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works great the way it is 👍

But you could use ternary here.

const learnedValue === true ? 1 : 0;

And it would have the same result

@rafaelhdr rafaelhdr added Reviewed This assignment has been reivewed by a mentor and a feedback has been provided and removed Review in progress labels Apr 8, 2026
@Yusuprozimemet Yusuprozimemet closed this by deleting the head repository May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed This assignment has been reivewed by a mentor and a feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants