Hacker News new | ask | show | jobs
by gallerdude 3264 days ago
I've had one semester of Computer Science, and have zero clue of how people do stuff like this.

How does he get the UI working so fast and looking so good? How do you reverse engineer an API - this seems like some hacker stuff you'd see in Halt & Catch Fire, in my mind anyways.

I'm sure I'll get there, but right now there's a major disconnect between the C investment calculator text program I made, and these super functional, beautiful works of art.

11 comments

Experience. Pure experience.

Once you work in a domain enough - pretty much any domain - you begin to intuitively understand the assumptions that others in the field make. In the case of reverse-engineering the API, he would be able to take an educated guess that eliminates 95% of the possibilities because he can think of how he'd design the API, which is probably close to how other competent people would do it too. That experience is invaluable in making rapid decisions that are going to be 'close enough' a lot of the time.

W.r.t the UI, if you have a package of choice that you use frequently enough, you begin to be able to piece together the building blocks quickly. You have all of the boilerplate code required to make it work more or less committed to memory or, at the very least, in other examples that you can just copy/paste and modify.

Uni isn't really about this experience. The coding you do is essentially just a domain-relevant conduit to help you learn and demonstrate competency over the theories. Uni is usually about the theoretical, not the practical, and that's why a common complaint is that uni teaches stuff that isn't relevant to the 'real world'. What this complaint misses, though, is the ancillary benefits you gain through understanding the theoretical, which isn't necessarily easy to quantify.

In summary, don't be disheartened by the uni stuff not reflecting what you see in reality. Think of it as (an important) half of the puzzle. The other half is the practical experience you pick up along the way. In uni, this is probably going to be side projects - stuff you code and throw in Github and then mention in your resume. In later life, it's your professional work experience. This is no different to other technical disciplines - mechanical engineering, for example, teaches you theory but then undergrads go and do Formula SAE or other undertakings to get that practical experience.

There _is_ a major disconnect! You’re studying computer science and wondering how it applies to software engineering. When I studied CS (graduated a year ago) we never went over things like building a GUI, reverse engineering an API, or designing a UI. Those are software engineering topics. By the time I graduated I learned how to do those things, but it was by learning them on my own. If you want to learn these things you’ll need to take the initiative yourself.

Here are some links to get you started:

1. http://lancenewman.me/reverse-engineering-the-tinder-api/

2. https://www.raywenderlich.com/151741/macos-development-begin...

3. https://medium.com/@erikdkennedy/7-rules-for-creating-gorgeo...

Even in software engineering programs, stuff like this just doesn't get covered.

Yet it's way more fun than what they teach you in school and will often involve learning the same concepts anyways. Just sad really.

It seems like many if not most computer science students are actually interested in software engineering and not CS. It is a shame that more schools don't offer separate software engineering programs or at least make the distinction between the two more apparent to prospective students.

I am sure I wasn't the only 17 year old told I should get a CS degree if I wanted to be a software developer. Meanwhile the most value I have gotten out of the CS classes that taught me to write a loop in MIPS or two build a XOR gate out of NAND gates is commiserating about those experiences with fellow CS grads. I would have much rather had a class about reverse engineering an API or other less theoretical and more vocational classes.

Knowing how a loop is implemented in MIPS means your now have enough knowledge to debug assembly, and perhaps do low level performance optimisations. It's not useless, just not directly and immediately. You won't be able to lean on any foundational work if you hadn't learnt it, and you'll have a super hard time doing complex things later, like reverse engineering.
What percentage of developers ever have to debug assembly or do low level performance optimizations? I am 10 years into my career and I have only professionally seen assembly code once. We have abstracted most of these low level things out of the normal life of most developers. That isn't to say it isn't important for some, but there are a lot more developers who would benefit more from a class on design principles than a class on assembly.
> How do you reverse engineer an API

For HTTP, this is about as easy as it gets in terms of reverse engineering. In firefox, just hit ctrl-shift-q while on any modern website. The network requests made will be displayed for you and you can then start making your own by guesses at what the programmer would have done.

e.g. on HN you can see that each upvote button press loads an image from

https://news.ycombinator.com/vote?id=14786509&how=up&auth=2d...

or twitter I can see that pressing "retweet" makes a request to "https://api.twitter.com/1.1/statuses/retweet.json" with a payload of {id "some tweet id"}.

Try it, it's fun and entertaining.

The proper "hacker stuff" is when you have to break out a hex editor, instruction set decoder, or in-circuit debugger probe.

Is posting your auth number safe?
I did wonder, but they appear to be unique not just to the page but to the specific link being upvoted.
A lot of what class will teach you is theory. They'll cover enough programming so that they can use code to help illustrate theory, and probably not a lot more in the non-elective major classes. In my degree program, there were some electives for UI and graphics programming, some specific languages, and so on. I'm sure there'd be some things about web programming that wouldn't have been available when I was there.

A lot starts out as magic. Class gives you enough to get started and demystifies some things, but I'd recommend doing side projects with classmates, competing in programming competitions, reading about anything that interests you (you'll find things that you have a burning curiosity about; don't wait for them to teach you that in school, because they might not).

My opinion is that the degree gives you a solid theoretical basis, and a checkmark on job listing requirements. Other than that, you're surrounded by a bunch of smart people with overlapping interests. It as perfect a time as any to set up study groups, clubs, and any other group activities you can think of to encourage extra projects and experimentation.

At some point you learn to debug the network requests in your own apps or websites. Once you've done that, it doesn't take a big leap of imagination to realise you can use the same techniques to look at the network requests for other apps and websites. Once you have enough sample requests and responses, you can usually figure out how it all fits together. Sometimes networking might be obfuscated (intentionally or otherwise) to the point that it's much more challenging, but the vast majority of products out there are easily inspectable.
reverse engineering an HTTP api isn't particularly difficult- it's a pretty simple key-value protocol 99% of the time so you just figure out what the values do through experimentation and tampering.
It's very simple API with very basic functionality and this guy probably already did some GUI applications, so he just put few images, buttons, forms and lists together.

Reverse engineering HTTP API is not hard either, open developer console, inspect API requests, responses, etc. You need to have some web development experience, I guess.

Just read any introductory book for OS X programming and you'll be able to build this app yourself.

Honestly reverse engineering the API was probably the easiest part. Just use the app with the inspector open in chrome recording the request and responses, it's probably a REST API and you can assume a bunch based on that.
I think the things I've been happiest with, at least visually, have been a result of the things I've been the most unhappy with to the point where I want to fix them. Things where I understand how I use them and understand how I'd _prefer_ to use them end up working well.

> I've had one semester of Computer Science, and have zero clue of how people do stuff like this.

Just wait, I've had about a decade of front-end dev experience and I think I could reverse engineer an API like this (maybe not quite so quickly). What I couldn't do, however, is write a C investment calculator text program. You're a whiz :)

I might be taking you too literally, but I think “just wait” is bad advice. Many of my peers at college graduated without ever building anything of substance on their own. Don’t know where they ended up, but I doubt they got good jobs.

I think it’s super important for CS students to pursue their interests beyond what’s covered in school. It’s the only way to gain the skills you need to get a good job out of college.

>How does he get the UI working so fast and looking so good?

That's mainly just experience with whatever he's using for the design. I've gotten to the point where I can hack together some pretty looking CSS in a short amount of time.

>How do you reverse engineer an API

I have less experience with this, but from what I have done, I've learned that XHR breakpoints in chrome dev tools is your best friend.

Do something every day for 5-10 years and you get better at it? I think it’s good but he’s probably using electron or react native desktop, which cuts out time.