Mostrar mensagens com a etiqueta S12. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta S12. Mostrar todas as mensagens

sábado, agosto 10, 2019

p.name = (strcpy, "Manuel Augusto Antão"): "Your First Year in Code" by Isaac Lyman



“Your first year in code is a whirlwind, I know it was for me. The more you learn, the more you learn that there’s more to learn. Code is such an abstract problem that there’s no set of always-applicable rules or rock-solid advice. Code powers the planet these days, but knowledge is still passed down through our elders and cultivated via community.
There is no one true way to be a coder. Gone are the days, if ever they truly existed, of the archetypal “programmer.” We all carry supercomputers in our pockets. Cloud service outages are front page news; email servers and encryption can be everyday political topics. The nerds have won and code has become mainstream.”

By Ben Halpern in the foreword in “First Year in Code” by Isaac Lyman

If Lyman and his 15 co-authors had asked me to write a contribution to his book, this review would be it.

Newbie: "But how do computers understand the code inputed into them? How were they made to understand the code?"
Me: "they don't. it is the compiler's job to do that and turn it into an array of 1s and 0s called Machine Code. The computer's job is to execute the Machine Code."
Newbie: "So, how does the compiler know how to translate text into binary?"
Me: "It does not translate text into binary, it translates instructions into binary and it knows how to because it is programmed to do that. Every programming language has it's own compiler (unless it uses an interpreter, like PHP for example). Then the processor executes the binary code. Also if it has an interpreter it executes the code, line by line."
Newbie: "but how does it know how to translate instructions to binary?"
Me: "Because it was told by a fucking programmer."
Newbie: "two questions:
1) Was the programmer actually fucking? As in, having sexual intercourse?
And 2) how do you tell an electronic component that x=1 and y=0?"
Me: "TOO MANY QUESTIONS!"
Newbie: "so ur telling me to walk blindly? Through millions of trials and errors? When there is a shortcut?"
Me: "There is no shortcut you lazy sod,; just read the frigging documentation."
Newbie: "But how did the first programmer make a programming language? Also how did they make the keyboards that programmers use to code?"
Me: "The First Programmer codded in Machine code, so he basically typed 1s and 0s.It is programmed into the chip itself beforehand. They create sets of instructions that either turn something on and off. And theirs is a reaction which is just more things being turned on and off. Mostly just spots in memory or registers in the CPU that contain these values. They were coded to understand the code...."
Newbie: "So all of you mean that machines only understand coz of a chip inside that helps them to translate codes into other things and that chip itself contains various codes that helps it to translate? So why only codes and not simple language??"
Me: "Welcome to the Matrix!"
Newbie: "If you can teach me how to code pork chops, I’ll give u..."
Me: "Is that you Augusto??? Should have known...You #$#$%$%&%/”#!!!"

Anyone can learn to code. All you have to do is Google a tutorial for the language you want to program in. Coding takes logic and critical thinking. Some problems are easy to figure out, but some take trial and error that may put off kids to programming:

#include
#include
#include

struct Person
{
char name[];
char position[];
int age;
double income;
};

int main()
{
Person p;
p.name = (strcpy, "Manuel Augusto Antão");
p.position = (strcpy, "Systems Programmer");
p.age = 46;
p.income = 95000.00;

printf("Information on %s", p.name);
printf("Job title: %s", p.position);
printf("Age: %d", p.age);
printf("Income: %f", p.income);

return(0);
}

Declaration of interest, I first taught myself to code in the 1980s in high school as my parents bought me a ZX Spectrum. The language was a flavour of BASIC. Subsequently taught myself C, C++ and VB (in all three languages I was only doing procedural programming (I was still in high school ffs!); afterwards I moved on to OOP. When I got to college I already had a few more programming languages in the bag so to speak (DBASE, Clipper, etc.). When I finished college, I worked as a lowly coder for about 3 years before moving on to other stuff. My final college project at my corporate job (as an internee with a scholarship) was something I did adding up all the skills I had developed before: devise and build a solution to discover and store all the computer hardware they had hooked up in the Novell 3.11/12 network (project grade: 18 out of 20). Remember that in those days there were no packages to do this as there are today. After those 3 years developing software, I moved on to configuring S12 and EWSD commuting systems. A few years later I was invited to work on the brand-new SAP R/3 system being adopted at my company (one of the largest on Europe back then). I then became SAP R/3 department head, and the rest was history. Now I only code at home to my own amusement. And that’s enough. For several reasons, I was never very keen on coding/software development in a corporate ecosystem.

I was running a BBS and rewriting the hex in MS DOS command.com when I was 13 and MS didn’t let me have the source code to change it; if you know how to program, you know how to hack, and you will know that you can change the code controlled by other companies although it might take time, and there will always be exceptions, but nothing that time ultimately can’t overcome. One simple way is to use system hooks and change the windows messages, and/or bypass API calls with your own API controls. A system hook is how hackers can spy on your keyboard and mouse inputs to find out your passwords and usernames for example, but you could also use it to diagnose faulty software and loads of other things in between. You are only restricted by your imagination as to what you can and can’t do, if you really set your mind to it. Arguably every program ever written for an operating system is manipulating the underlying OS so that ultimately the user gets a program to use to manipulate their own data with.

If you want to see how windows works, download this program:

http://www.rohitab.com/apimonitor

and watch the values going into and out from the various API calls.

Giving more people an opportunity to see what’s involved in coding can only be a good thing – though I feel its potential benefits are being oversold. But, I’m not sure how much can be achieved in an hour as some people like to advertise; starting from first principles you would barely scratch the surface. I wish people would stop devaluing my profession by saying you can learn to code in an hour. It doesn't happen in any other profession:

Hello, being a chef is easy - learn to cook in an hour.
Hello, being a doctor is easy - learn to fix people in an hour.
Hello, being an engineer is easy - learn to build a bridge in an hour.

I've given not many years of my life to develop software professionally; only for people who have no understanding of software development to say: "oh could you build this for me - it should only take you a couple of hours." I think software developers should all go on strike. A colleague of mine at another firm a few years ago was made redundant and given 2 weeks to do knowledge transfer of 20 years development experience in various bank IT systems. He asked the manager if he could then spend a couple of weeks with him. The guy asked why. "I want to do what you do". The guy spluttered that you couldn't possibly learn all his knowledge and experience in 2 weeks. "Exactly!" In many organisations there’s a motto for that kind of thinking: "It's just a button." - They soon lose interest when you show them the hundreds of lines of code that clicking their button entails...I always think that if anyone describes someone else's job using the word "just" they haven't understood it fully. I did a lot of research and prototype development and being told by some manager, who really didn't understand what they were asking of me, that: "it should only take x time" used to really piss me off.

So in a nutshell, the suggestion is to spend an hour pointing to things under the bonnet of a car and then you'll be able to manufacture one from scratch and as a bonus, get one that's innovative (my least favorite buzz word de jour) too? It strikes me that the call "to get everyone coding" clashes strongly with one of the tidbits mentioned in the media. Then ask yourself: what are the chances, realistically speaking, that you can get any of these people - who have a powerful computer in front of their nose all the time but only ever use it for the bare minimum of tasks, for the simplest and least complicated of its functionalities - that you can get ever get these people to try coding?

The young, and anyone that's interested, should learn about software programming (code or coding seems like a word used by non-programmers to describe the subject. The one that makes me smile is a non-technical friend who uses his computer for word processing describes it as his "pooter-printer"). I wanted to be a Computer Engineer when I was young, so that I could be technologically creative. But after getting a degree in that subject and in my first job, computers were just becoming more accessible, and caught my interest. It started by writing programs to log data from my own electronic measuring devices, and ended up back at university and a career in software development and database technology.

The subject is huge and never stops advancing. What you learned yesterday will be obsolete tomorrow. Although the principles remain, even these get added to over time. I have found you are always in a state of learning, often applying what you have just learned. Even though I feel software development is a young person's game, it does keep your mind turning, and consequently makes you feel young if you are willing to embrace it. To me it's a modern way of being creative and expressing yourself. I would love to get involved in teaching the subject. But most of the time I am busy doing it for a living.

Kids should learn the value of programming, but they should not be forced upon it. We have bad code as it is, and need talented young minds with the ability to write and debug code to help fix this problem. But not everyone can, and they are no worse for it. There are things they can do that you and I cannot do. One size does not fit all. We should all exercise. Not everyone can learn to play even County level fast bowlers, and they shouldn't be made to try.

Someone once told me that the difference between a student and a master (of any art) is love of the art. I think in the end programming is an art. I just wish there were books like these when I started out. I have to say, I admire how Lyman and the book’s 15 co-authors implicitly say things like "if you aren't able to focus on something for long periods of time, then you need to develop that skill", instead of saying: “this career isn't for you”… they implicitly say that the person needs to work on that skill…ROTFL!

NB1:

When you’re in deep shit coding-wise:
1. Google
2. Stackoverflow
And when desperation kicks in: 3. Indian dudes' tutorials?

No! No! No! You’re doing it wrong you lazy bugger!

I had to dock a star because one of the contributors suggested we should all use the Mighty Google to get out of a coding pit. Back in the day, I tried to spend an hour coding 'offline' a day (couldn’t touch google, stackoverflow, internet, etc. for questions or 'how to' guides). If you get stuck, you gotta just figure it out yourself putting in a bunch of logs, using the debugger, experimenting with code.  When I transitioned from C++ to Java, I kept forgetting how certain pointers functioned, so I would frequently spend time looking it up online. I realized that if I had just figured the problem out myself instead of asking for someone to hold my hand (stackoverflow lol). I would have never needed to spend a half-hour to hour looking up my issue on google every week or so. The initial discovery of what I did wrong might take an extra hour or 2 than looking it up online in that moment, but as a result of figuring it out myself I internalize the information into my brains 'long term memory' (hard drive) instead of just throwing it on my 'short-term memory' (RAM) and forgetting it a couple of days later.  In my pre-internet days, people used to have to figure shit out for themselves and as a result they internalized it into their long-term memory. I remember having to do this in grade school because internet cellphones weren't a thing. I basically stopped trying to memorize something for the long term because of google and internet.  My point is remember how to figure shit out for yourself every once in a while. It’ll help tremendously when developing the ability to focus for long periods of time.

NB2: Book’s content:

Introduction: Code is the best, code is the worst
Different learning pathways into tech
How (not) to learn
How to code (in one chapter)
Steps to better code
Programming tools (although short loved the part on the emacs vs. vim wars…)
You are an interpreter
What to learn first
Learning to learn
Make the most of side projects
Getting your first job
My first job
I got my dream job. Now what?
Burnout, part 1
Burnout, part 2
Do I fit in?
Women in code
What to do when you’re stuck
Choosing a job title
The DevOps introduction I wish I had
A coder’s code of ethics
Software development beyond the keyboard
Code reviews
Appendix A: A coder’s vocabulary
Appendix B: To make this, learn that
Appendix C: Recommended reading