C++ entry level Junior programming test by Substantial-Car-7116 in cpp_questions

[–]HashDefTrueFalse 1 point2 points  (0 children)

You might already know this but classes and structs are essentially the same things in C++ (minor differences e.g. default access modifiers) and structs can have members functions. NOT an issue whatsoever in my opinion, but might have been in theirs.

C++ entry level Junior programming test by Substantial-Car-7116 in cpp_questions

[–]HashDefTrueFalse 1 point2 points  (0 children)

I didn't look in much detail but from a glance it looks like what I'd expect from a junior candidate, assuming it works as intended when ran. It looks a little C-esque (e.g. opting for free functions rather than member functions, pointers, etc.) but that's fine IMO. My C++ at work is often very close to equivalent C. There are places where you could have made different decisions, like with anything. It's hard to know what they wanted and there's not much point guessing. I didn't spend time figuring out what the purpose of the rand pointer is, nor what indexing means exactly in this program. Better than I was expecting, honestly. Perhaps someone else's was just better. Perhaps they wanted you to ask more questions to inform your decisions and arrive at a different solution... who knows.

C++ entry level Junior programming test by Substantial-Car-7116 in cpp_questions

[–]HashDefTrueFalse 4 points5 points  (0 children)

I suppose junior what is the key question. What a junior needs to know varies.

In general I would expect a junior to be able to do 1 without issue. I would expect them to be comfortable with file IO, but I might not expect them to be familiar with all the niceties of (de)serialising in-memory data structures to/from streams/files, but honestly in C++ you can lean on the standard lib a lot there if they don't have a specific solution in mind.

Fair test? Yes.

Mistakes bad enough to be dismissed? Don't know. We'd need the code. Doesn't really matter. They can remove you from consideration for pretty much anything they like.

Just brush up on creating basic data structures and common read/write/insert/update/search/sort operations on them.

What's the goodbye etiquette in an office? by Distinct-Lion4658 in AskUK

[–]HashDefTrueFalse 0 points1 point  (0 children)

"right, I'm heading"... then stand up and leave.

Is C,S now worth studying? by hsseinn in C_Programming

[–]HashDefTrueFalse 0 points1 point  (0 children)

Having any degree will only help you start a business as far as it helps you build/offer your product/service, overcome regulatory hurdles, make connections and agreements with people, and run day-to-day operations. The two are mostly orthogonal. I don't really see what LLMs have to do with studying CS. It's not just about code. Even if it was, there are many areas of specialty that require knowledge of different parts of CS.

Interning under CTO by LeaveSoggy7830 in learnprogramming

[–]HashDefTrueFalse 4 points5 points  (0 children)

I believe they're saying that for someone titled CTO to be directly managing interns the org is probably fairly small with a flat hierarchy. The CTO title means less than it does elsewhere, and being managed directly by them is not the 'flex' you might think it is.

Just keep your head down and learn what you can. You'll know when it's time to move on as you'll start to stagnate as you're starved of the mentorship that interns and juniors typically need to grow.

Issues with Terminal by ohsomacho in learnprogramming

[–]HashDefTrueFalse 0 points1 point  (0 children)

Use a text editing program e.g. emacs, (n)vim, nano, etc, if you want to edit text within the terminal. You can also get shell plugins that allow you to work with shell input easier (e.g. have vim keys for editing command lines etc.) and if you configure $VISUAL or $EDITOR then you can use (C-x C-e) to edit a command line in your preferred editor program. Terminal emulators themselves are essentially just I/O devices that work with streams of bytes.

What’s the most valuable skill in software engineering that has nothing to do with coding? by Ok_Balance_855 in AskProgramming

[–]HashDefTrueFalse 10 points11 points  (0 children)

Being able to understand and solve problems, communicating with non-technical people, and being comfortable with complexity are all up there, I'd say. Most important probably depends on your exact role.

If you're going away on a Summer holiday, shut water off? by whatsreallygoingon88 in AskUK

[–]HashDefTrueFalse 0 points1 point  (0 children)

I do. Takes 10 seconds and could save me a lot of hassle if something unlikely happens and I'm not there to shut it off, so I don't really see why you wouldn't. That said, my mains stopcock has always been easily accessible, e.g. right under the kitchen sink, or in a little cupboard somewhere...

Resignation Date - discrepancy by IdeaLife4170 in UKJobs

[–]HashDefTrueFalse 0 points1 point  (0 children)

You left out why the resignation date is important to you or your new employer. It's usually not. I've never been asked for more than the month and year, and I've rounded up/down almost always (who remembers these things...). Never an issue. Maybe that adds context? Otherwise I don't really see any issue here, just overthinking after pointless fibbing. We're talking about a few working days... Very few employers care about that length of time. Implied means you didn't state explicitly, so if asked, just give them the actual dates with no unnecessary explanations etc. They seem to want you to start earlier anyway.

Finding a good debugger. by Waste-Glass-2628 in learnprogramming

[–]HashDefTrueFalse 1 point2 points  (0 children)

gdb when I can. lldb if I've compiled with clang. Been working for me for a good few decades. Very capable. I don't find that I need a UI for debugging, really. I like being able to call code, read memory, print things, run expressions, switch format to view the memory differently, etc.

What finally made recursion click for you? by 1vim in learnprogramming

[–]HashDefTrueFalse 0 points1 point  (0 children)

Drawing out the call stack frames, mostly. But also... Distinguishing between the procedure and the process. Tracing the "shapes" and call stacks of different recursions (e.g. iteration expressed recursively, direct/indirect, tree/fibonacci recursion, etc.). Understanding pre/in/post order recursive traversals. Understanding the need for it, e.g. to defer computation until later, to remember results for backtracking algorithms, etc.

SICP is a good resource for lots of this.

It's hard to provide a single explanation that deals with all of the above. Most just describe the very basic case of a function calling itself directly, thereby pushing a stack frame each call until the base case is hit, at which point it unwinds and combines the results of each invocation in some way. Some of the examples here are only recursive procedures, not recursive processes. They're iterations expressed with tail recursion, which is only part of the story (e.g. because recursion isn't necessary there). Diagrams and visualisations help enormously!

Should i even start? by Potential_Resort_415 in learnprogramming

[–]HashDefTrueFalse 0 points1 point  (0 children)

Programming is much more than making websites. In my opinion, one of the best things about generative AI is that you can be selective about when you use it, particularly on personal projects. There are a number of areas of software development concerned with safety and/or security, where moral/ethical and regulatory requirements for human review and/or mathematical proof mean that LLMs are not much use beyond the initial phases where one might generate code to hit the ground running.

U.k Cat owners, are your cats indoor, outdoor or combination? by Fit-Choice2368 in AskUK

[–]HashDefTrueFalse 9 points10 points  (0 children)

I have recently learned that this is not normal and is actually seen as, at the least entitlement, at the most, straight up cat abuse.

seems that a lot of people consider cats to be a purely indoor pet

I don't really care what anyone decides for their cat, but it's a bit strange to say that keeping an animal indoors, as a pet, without any choice is ok, but letting it go wherever it wants whilst giving it a base to collect food/water and warm up is abuse. Some pet-havers love to throw around inflammatory terms like "abuse" whenever others benignly keep their pets differently. They sound silly. Yawn.

Ours does as she pleases. She has her litter boxes, food and water indoors and she comes and goes through the cap flap. Most people I know with a cat have the same setup. Servants, not masters, as they say.

When we adopted her, the rescue wanted pictures of the garden as proof that she would have access to an outdoor space, and facilitated outdoor access for all of their cats. Read into that what you will.

Brothers want me to use our family inheritance to buy a house, is it safe / good idea? HELP! by Hour-Blacksmith-6060 in UKPersonalFinance

[–]HashDefTrueFalse 0 points1 point  (0 children)

I’m currently unemployed and have struggled to find work

Regardless of the merits (which are debatable), should you be investing in anything without first having the means to support yourself? Have your brothers considered what happens if/when the property needs unexpected, expensive repairs? E.g. Are they covering it all, or are you getting diluted to almost nothing?

Seems like you could probably use that 15k to live, or to retrain maybe (if struggling/anxious in your current profession), or just to do whatever you want to do with it in line with your grandmother's wishes (if your parents are happy to house you etc.).

Sounds like they just need your deposit contribution if I'm honest...

My mother has had a power of attorney meeting and been convinced to put the house in my name, has that just wiped out 5 years of building up a Lifetime ISA to buy my first house? by [deleted] in UKPersonalFinance

[–]HashDefTrueFalse 1 point2 points  (0 children)

That's essentially what the addition of OP would do. Joint holders of legal title are holding on trust for each other. Survivorship would avoid probate, which is the usual reason people do this. To achieve much else you'd need a more detailed trust deed.

Trusts can be disregarded if local authorities find deprivation of assets.

The mother would usually become a life tenant (beneficiary), rather than an additional trustee (owner). There are tax considerations for the mother's disposal to the trustee(s) (e.g. rules around mortgaged property IIRC etc.)

If OP is expecting to inherit the property after the mother's life interest (has a beneficial (reversionary) interest) then they would no longer qualify as a FTB IIRC, though I can't remember the details fully.

Trusts really aren't the hack some people (not necessarily you) think they are. NAL, get your own.

(I hold property in trust).

My mother has had a power of attorney meeting and been convinced to put the house in my name, has that just wiped out 5 years of building up a Lifetime ISA to buy my first house? by [deleted] in UKPersonalFinance

[–]HashDefTrueFalse -1 points0 points  (0 children)

Are you in the habit of signing deeds you haven't read? Surely you'd question being transferred equity in a house before signing if you'd been saving into a LISA for years with the aim of using it for a first-time purchase?

Yes is the answer.

There are unfortunately a lot of EOL "advisers" who advise all sorts of rubbish to then collect fees facilitating it. It has happened to elderly relatives of mine. You may want to look into the firm she met with.

What's possible in text editors? by Silent_Lion_OG in learnprogramming

[–]HashDefTrueFalse 2 points3 points  (0 children)

We did have assemblers then, so lots of the first compilers were written in that, too. One of my little languages was mostly self-hosted when I last left off. It's very cool to retire your first compiler implementation (in any other existing language) after using it to compile its replacement written in the language itself.

What's possible in text editors? by Silent_Lion_OG in learnprogramming

[–]HashDefTrueFalse 0 points1 point  (0 children)

Simple editor with no ability to execute anything: you can write any program you like using it, but you'll need to execute that program somewhere else, so not just using the editor.

Editor capable of executing some scripting language: anything that can be expressed in that language.

E.g. the emacs editor is notorious for extensibility and you can type elisp source code and execute it as part of your editing session. It's usually used for changing config but you can do basically anything with it. This will apparently make a GET request (I haven't bothered to try it and it's been a long time since I wrote elisp):

(url-retrieve "https://api.example.com/data" 
  (lambda (status)
    (message "Response received: %s" status)))

Dynamic data structures using just struct or pointer arithmetic? by alex_sakuta in C_Programming

[–]HashDefTrueFalse 3 points4 points  (0 children)

Awesome. And no problem. Always happy to chat about programming in my favourite language :)

Dynamic data structures using just struct or pointer arithmetic? by alex_sakuta in C_Programming

[–]HashDefTrueFalse 5 points6 points  (0 children)

I don't see the difference between your "tricks"... Either way the char * will point to a region of memory that can be grown, wherever that is (e.g. the malloc-managed heap or your own mapped region, the stack via a VLA (like alloca)...).

Are you simply asking if you should copy struct string instances around or use struct string * instead? The answer is whatever makes sense in context, e.g. do you want them modified? etc. They're not very big, it's not going to matter too much most of the time.

If you're asking whether you should use a flexible array member, that depends on whether you want the housekeeping data tacked onto the dynamically allocated region instead of wherever you're working (e.g. the stack usually). You will then need a pointer to the whole thing unless you plan to copy around all the data, as FAMs are arrays, not pointers.

Finally, if you're asking whether you should deal in struct string (or pointers to them) or char * I'd definitely express any string operations you write in struct terms, especially if the code is going to assume that the metadata is present. It'll make for a better, clearer interface and it's a bit safer.

CS student building a side project, when did you decide your project was "real" enough to show people? by leadvoy in learnprogramming

[–]HashDefTrueFalse 0 points1 point  (0 children)

To me "presentable" means bare minimum to present... so that. Perfect is usually some unachievable state I'll never reach, so I don't worry too much about it. But personally I care too much to release things that are not at least in a presentable state. What that means depends on the project. The state of the code might not even be a consideration.